I am having a problem with the following test and I cannot figure out why. I am working through the tutorial on http://ruby.railstutorial.org/ and just finished chapter 9. It seems the following spec test works once and then in order to get it to pass again I have to purge the test database. This doesn't seem necessary if I have transactional fixtures enabled (which I do).
Here is the test:
describe "success" do it "should make a new user" do lambda do visit signup_path fill_in "Name", :with => "Example User" fill_in "Email", :with => "user@example.com" fill_in "Password", :with => "foobar" fill_in "Confirmation", :with => "foobar" click_button response.should have_selector("div.flash.success", :content => "Welcome") response.should render_template('users/show') end.should change(User, :count).by(1) end end