Guest User

Untitled

a guest
May 18th, 2018
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. steps_for(:login) do
  2. Given "no current user" do
  3. @username = nil
  4. end
  5.  
  6. Given "a username '$username'" do |username|
  7. @username = username
  8. end
  9.  
  10. Given "a password '$password'" do |password|
  11. @password = password
  12. end
  13.  
  14. Given "a location '$location'" do |location|
  15. @location = location
  16. end
  17.  
  18. Given "there is no user with this username" do
  19. User.find_by_login(@username).should be_nil
  20. end
  21.  
  22. When "the user accesses a page" do
  23. get "/people/search"
  24. end
  25.  
  26. When "the user logs in with username and password" do
  27. login_user(@username, @password, @location)
  28. end
  29.  
  30. Then "the login form should be shown again" do
  31. response.should render_template("user/login")
  32. end
  33.  
  34. Then "should redirect to '$path'" do |path|
  35. response.should redirect_to(path)
  36. end
  37.  
  38. Then "should show message '$message'" do |message|
  39. response.should have_text(/#{message}/)
  40. end
  41.  
  42. end
Add Comment
Please, Sign In to add comment