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:

  1. test validators/relationships
  2. test scopes
  3. 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

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -