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.
winescout (Guest)
on 2005-12-11 02: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
technoweenie (Guest)
on 2005-12-11 02:34
(Received via mailing list)
On 12/10/05, matthew clark <removed_email_address@domain.invalid> 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 C.'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.