Friday, April 15, 2011

[Rails] rspect transactional fixture problem

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

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate