Guest User

Untitled

a guest
Jul 16th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. When I fill up the first passenger field
  2. Then I should see the passenger list update with the first passenger details
  3. When I follow "Add Another Passenger"
  4. Then I should see a second passenger field
  5. When I fill up the second passenger field
  6. Then I should see the passenger list update with the second passenger details
  7.  
  8. When /^I fill up the first passenger field$/ do
  9. fill_in("booking_passengers_attributes_0_first_name", :with => "Blah")
  10. fill_in("booking_passengers_attributes_0_last_name", :with => "blah")
  11. select("5' to 6'", :from => "booking_passengers_attributes_0_height")
  12. select("100 to 150lbs", :from => "booking_passengers_attributes_0_weight")
  13. end
  14.  
  15. When /^I fill up the second passenger field$/ do
  16. fill_in("booking_passengers_attributes_1_first_name", :with => "Wee")
  17. fill_in("booking_passengers_attributes_1_last_name", :with => "Sir")
  18. select("5' to 6'", :from => "booking_passengers_attributes_1_height")
  19. select("150 to 200lbs", :from => "booking_passengers_attributes_1_weight")
  20. end
  21.  
  22. When /^I fill up the "([^"]*)" passenger field$/ do |id|
  23. input_id = id.to_i - 1
  24. fill_in("booking_passengers_attributes_#{input_id}_first_name", :with => id)
  25. fill_in("booking_passengers_attributes_#{input_id}_last_name", :with => "Passenger")
  26. select("5' to 6'", :from => "booking_passengers_attributes_#{input_id}_height")
  27. select("100 to 150lbs", :from => "booking_passengers_attributes_#{input_id}_weight")
  28. end
  29.  
  30. When /^I fill up the (d+)st|nd|rd|th passenger field$/ do |n|
  31. # etc...
  32. end
  33.  
  34. 1.ordinalize # => "1st"
  35. 2.ordinalize # => "2nd"
  36. 1002.ordinalize # => "1002nd"
Add Comment
Please, Sign In to add comment