Guest User

Untitled

a guest
Jan 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. describe "visit /signup/step2" do
  2. it "has the correct fields" do
  3. visit signup_path
  4. fill_in 'user_email', :with=>Faker::Internet.email
  5. click_on "submit"
  6. page.should have_selector("input#user_email")
  7. page.should have_selector("input#user_password")
  8. page.should have_selector("input#user_password_confirmation")
  9. page.should have_selector("input#user_first_name")
  10. page.should have_selector("input#user_last_name")
  11. page.should have_selector("input#user_postcode")
  12. page.should have_selector("select#user_gender")
  13. end
  14. it "should validate correctly" do
  15. @user = Fabricate.build(:user)
  16. @password = Devise.friendly_token[0,20]
  17. visit signup_path
  18.  
  19. fill_in 'user_email', :with => @user.email
  20. click_on "submit"
  21. fill_in "user_email", :with => @user.email
  22. fill_in "user_password", :with => @password
  23. fill_in "user_password_confirmation", :with => @password
  24. fill_in "user_first_name", :with => @user.first_name
  25. fill_in "user_last_name", :with => @user.last_name
  26. fill_in "user_postcode", :with => @user.postcode
  27. # fill_in "user_gender", :with => @user.gender
  28. click_on "submit"
  29.  
  30. end
  31. end
Add Comment
Please, Sign In to add comment