Guest User

Untitled

a guest
Feb 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. Given("no Users and no BetaUsers") do
  2. User.delete_all
  3. BetaUser.delete_all
  4. end
  5.  
  6. Given("a User with no login, email '$email', and password '$password'") do |email, password|
  7. Factory(:user, :email => email, :login => nil, :password => password, :password_confirmation => password)
  8. end
  9.  
  10. Given("a BetaUser '$email'") do |email|
  11. @beta_user = Factory(:beta_user, :email => email)
  12. end
  13.  
  14. # THIS one breaks my stories! is there something wrong with my post and delete here?
  15. Given("a BetaUser '$email' who is no bum") do |email|
  16. beta_user = Factory(:beta_user, :email => email)
  17. post_via_redirect '/users', :user => {:email => email, :password => 'password', :password_confirmation => 'password'}, :beta_code => beta_user.beta_code
  18. delete_via_redirect '/session'
  19. end
  20.  
  21. Given("'$login_or_email' logged in with password '$password'") do |login_or_email, password|
  22. post '/session', { :login_or_email => login_or_email, :password => password }
  23. # require 'ruby-debug'
  24. # debugger
  25. # response.body is empty!!! WTF
  26. response.should be_redirect
  27. end
Add Comment
Please, Sign In to add comment