Guest User

Untitled

a guest
Mar 9th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. describe "When advertiser user login" do
  2. controller_name :user
  3.  
  4. it "should redirect to user/post_signup when user" \
  5. + " exists and is already active " do
  6.  
  7. # esta linea te esta faltando!
  8. @user = mock_model(User)
  9. User.should_receive(:authenticate).with("bruce", "leehoichuen").and_return(@user)
  10. @user.stub!(:track_loggedin).and_return(true)
  11. @user.should_receive(:post_signup_complete).and_return(false)
  12. @user.should_receive(:id).twice.and_return(1)
  13. @user.should_receive(:save_with_validation).and_return(true)
  14. post 'login', { :user => { :login => "bruce", :password => "leehoichuen" } }
  15. response.should redirect_to(:action => 'post_signup')
  16. end
  17.  
  18. end
Add Comment
Please, Sign In to add comment