ruby on rails - error using rspec for devise -
i using rspec testing devise authentication. following code
require 'spec_helper' describe user describe "user registration" "allows new users register email address , password" "/users/sign_up" fill_in "email", :with => "abc@example.com" fill_in "password", :with => "abc123" fill_in "password confirmation", :with => "abc123" click_button "sign up" response.should have_content("welcome! have signed successfully.") end end end
i getting following error.
"nomethoderror:undefined method `get' #"
you using controller methods , integration test methods (capybara) in model spec. not work.
a model spec (unit test) contain things like:
- test validators/relationships
- test scopes
- methods of model
check out series of blog articles on testing rspec, should help: http://everydayrails.com/2012/03/12/testing-series-intro.html
Comments
Post a Comment