It states on page 140 of Agile Web D. with Rails:
Here?s the bottom line: even if a test method updates the test database,
the database is put back to its default state before the next test
run. This is important because we don?t want tests to become dependent
on the results of previous tests.
Well, I’ve been running into a brick wall with some functional tests
based off of what the scaffold generator created for me.
Here’s a couple snippets:
publish_on: 2006-01-24 14:50:30
get :edit, :id => 1, :version_id => 1
post :destroy, :id => 1
assert_redirected_to :action => ‘list’
And finally, the error that’s being thrown when this is run:
ActiveRecord::RecordNotFound: Couldn’t find Article with ID=1
So, it looks like test_destroy is being run first… any idea why my
fixtures aren’t being reloaded before each test is being run? Is there
something else I should be doing?
Thanks in advance,