Advertisement
Guest User

Untitled

a guest
Aug 7th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. require 'rails_helper.rb'
  2. require 'spec_helper.rb'
  3.  
  4. feature "Register users:" do
  5. scenario "Register with trully input data" do
  6. number_of_iterations = (1..10)
  7. number_of_iterations.map do |counter|
  8. email = (0...10).map { ('a'..'z').to_a[rand(25)] }.join
  9. email = "#{email}@gmail.com"
  10. name_of_user = (0...12).map { ('a'..'z').to_a[rand(25)] }.join.to_s
  11. digit_number = (0...6).map { (1..9).to_a[rand(9)] }.join.to_s
  12. password = (0...13).map { ('a'..'z').to_a[rand(9)] }.join.to_s
  13. #Wputs ("\n email = #{email_name} \n user = #{name_of_user} \n group id = #{digit_number} \n password = #{password} ")
  14. visit "/"
  15. click_link "Register"
  16. expect(page).to have_content("Sign up")
  17. fill_in "user_email", with: "#{email}"
  18. puts email
  19. expect(page).to have_content("#{email}")
  20. fill_in 'User name', with: "#{name_of_user}"
  21. #expect(page).to have_content("#{name_of_user}")
  22. fill_in 'Number of group', with: "#{digit_number}"
  23. fill_in "Password", with: "#{password}", match: :first
  24. fill_in 'Password confirmation', with: "#{password}"
  25. click_button "Sign up"
  26.  
  27. expect(page).to have_content("Instructions here.")
  28. click_link "Logout"
  29. expect(page).to have_content("Log in")
  30. end
  31. end
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement