Displaying 2 results from an estimated 2 matches for "news_release_test".
2006 Jun 08
2
accessing fixtures in tests
hi all,
my first attempt at tests and i''m having trouble accessing the
fixture values, if anyone can make it suggestions.
i have news_release_test.rb, using new_releases.yml as the fixture file
according to the agile book, i should be able to access the fixture
properties within my test as such:
assert_equal @first_test.id , @news_release.id
unfortunately, i try that and get:
"test_create(NewsReleaseTest):
RuntimeError: Called id f...
2006 Jun 08
1
fixtures instance variable naming
...trouble with accessing
the fixture instance variable
built a test for my NewsRelease model.
have a news_releases.yml as a fixture with:
first:
id: 1
title: my first release
body: this is still my first test of a news release
publish: 0
date_publication: 2006-06-06 17:28:00
in news_release_test.rb, i have
def setup
@news_release = NewsRelease.find(1)
end
def test_create
assert_kind_of NewsRelease, @news_release
assert_equal @news_release["first"]["id"], @news_release.id
end
and i receive:
"NoMethodError: You have a nil object when you didn'&...