Advertisement
Guest User

Untitled

a guest
Feb 17th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.24 KB | None | 0 0
  1. require 'rails_helper'
  2.  
  3. feature 'New user sign up' do
  4. scenario "+valid - User fills out Personal Information", js: true do
  5. visit new_user_path
  6. fill_in_personal_information
  7. fill_in_residence_information
  8. fill_in_employment_information
  9. fill_in_credit_information
  10. fill_in_mother_information
  11. fill_in_login_information
  12. fill_in_referral_information
  13. check_check_boxes
  14. click_button "SUBMIT INFORMATION"
  15. expect(page).to have_content("Your request has been sent. Please log out, and wait for an email to be sent to you with further instructions. Thank you")
  16. end
  17. def check_check_boxes
  18. find(".name-warning").click
  19. find(:css, "#correct_information").click
  20. find(:css, "#accept_statement").click
  21. sleep(1)
  22. find(:css, "#final_statement").click
  23. end
  24. def fill_in_phone_number(element_name,number=["555","444","1234"])
  25. fill_in("user_#{element_name}_1", with: number[0])
  26. fill_in("user_#{element_name}_2", with: number[1])
  27. fill_in("user_#{element_name}_3", with: number[2])
  28. end
  29. def fill_in_dob(element_name, date=['1985', 'February', '21'])
  30. select("#{date[0]}", from: "#{element_name}_1i")
  31. select("#{date[1]}", from: "#{element_name}_2i")
  32. select("#{date[2]}", from: "#{element_name}_3i")
  33. end
  34. def fill_in_referral_information
  35. fill_in('user_referred_by', with: 'Test Name')
  36. end
  37. def fill_in_mother_information
  38. fill_in_dob("user_credit_mother_dob")
  39. end
  40. def fill_in_credit_information
  41. fill_in('user_credit_login', with: 'xxx@aol.com')
  42. fill_in('user_credit_password', with: 'thisisapassword')
  43. fill_in('user_credit_security_answer', with: 'securityquestion')
  44. end
  45. def fill_in_employment_information
  46. fill_in('user_employer_name', with: 'USAA')
  47. fill_in('user_occupation', with: 'Programmer')
  48. fill_in('user_employment_address', with: 'Text')
  49. fill_in('user_employment_city', with: 'Text')
  50. select('FL', from: 'user_employment_state')
  51. fill_in('user_employment_zipcode', with: 74133)
  52. fill_in_phone_number('employment_phone')
  53. fill_in('user_employment_gross_income', with: '5000')
  54. select('2', from: 'user_employment_years')
  55. select('2', from: 'user_employment_months')
  56. end
  57. def fill_in_residence_information
  58. fill_in('user_home_address', with: 'Text')
  59. fill_in('user_city', with: 'Text')
  60. select('FL', from: 'user_state')
  61. fill_in('user_zipcode', with: 74133)
  62. select('2', from: 'user_time_at_address_months')
  63. select('5', from: 'user_time_at_address_years')
  64. select('Rent', from: 'user_residence_type')
  65. fill_in('user_household_payment', with: '5000')
  66. end
  67. def fill_in_personal_information
  68. select('Mr.', from: 'user_suffix')
  69. fill_in('user_first_name', with: 'Text')
  70. fill_in('user_middle_name', with: 'Text')
  71. fill_in('user_last_name', with: 'Text')
  72. fill_in_phone_number('phone_number')
  73. fill_in_phone_number('other_phone_number')
  74. fill_in('user_driver_license', with: 'Text')
  75. fill_in('user_ss_1', with: 590)
  76. fill_in('user_ss_2', with: 41)
  77. fill_in('user_ss_3', with: 5333)
  78. fill_in_dob("user_dob")
  79. end
  80.  
  81. def fill_in_login_information
  82. fill_in('user_email', with: Faker::Internet.email)
  83. fill_in('user_password', with: "brasileiro1")
  84. fill_in('user_password_confirmation', with: "brasileiro1")
  85. end
  86. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement