Forum: Ruby on Rails fixtures misbehaving

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
69b2ef4bce76b5b27c94e898976dc6d8?d=identicon&s=25 winescout (Guest)
on 2005-12-11 01:22
(Received via mailing list)
I think I'm understanding fixtures, but apparently not, because this
should
work, according to this page -

http://manuals.rubyonrails.com/read/chapter/26#page67

Using Ubuntu 5.10, Ruby 1.8, current Rails

Any ideas?

File Edit Options Buffers Tools Help
require File.dirname(__FILE__) + '/../test_helper'

class UserTest < Test::Unit::TestCase

  fixtures :users

  def test_fixtures
    assert_not_nil @users
  end
end



$ ruby fixture_test.rb
Loaded suite fixture_test
Started
F
Finished in 0.124553 seconds.

  1) Failure:
test_fixtures(UserTest) [fixture_test.rb:8]:
<nil> expected to not be nil.

1 tests, 1 assertions, 1 failures, 0 errors
821395fe70906c8290df7f18ac4ac6cf?d=identicon&s=25 technoweenie (Guest)
on 2005-12-11 01:34
(Received via mailing list)
On 12/10/05, matthew clark <winescout@gmail.com> wrote:
> I think I'm understanding fixtures, but apparently not, because this should
> work, according to this page -

The defaults for unit testing changed.  For performance reasons, all
fixtures are not instantiated as models on each test.  Mike Clark's
blog gives the details on this change:

http://clarkware.com/cgi/blosxom/2005/10/24

--
rick
http://techno-weenie.net
This topic is locked and can not be replied to.