Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- When I fill up the first passenger field
- Then I should see the passenger list update with the first passenger details
- When I follow "Add Another Passenger"
- Then I should see a second passenger field
- When I fill up the second passenger field
- Then I should see the passenger list update with the second passenger details
- When /^I fill up the first passenger field$/ do
- fill_in("booking_passengers_attributes_0_first_name", :with => "Blah")
- fill_in("booking_passengers_attributes_0_last_name", :with => "blah")
- select("5' to 6'", :from => "booking_passengers_attributes_0_height")
- select("100 to 150lbs", :from => "booking_passengers_attributes_0_weight")
- end
- When /^I fill up the second passenger field$/ do
- fill_in("booking_passengers_attributes_1_first_name", :with => "Wee")
- fill_in("booking_passengers_attributes_1_last_name", :with => "Sir")
- select("5' to 6'", :from => "booking_passengers_attributes_1_height")
- select("150 to 200lbs", :from => "booking_passengers_attributes_1_weight")
- end
- When /^I fill up the "([^"]*)" passenger field$/ do |id|
- input_id = id.to_i - 1
- fill_in("booking_passengers_attributes_#{input_id}_first_name", :with => id)
- fill_in("booking_passengers_attributes_#{input_id}_last_name", :with => "Passenger")
- select("5' to 6'", :from => "booking_passengers_attributes_#{input_id}_height")
- select("100 to 150lbs", :from => "booking_passengers_attributes_#{input_id}_weight")
- end
- When /^I fill up the (d+)st|nd|rd|th passenger field$/ do |n|
- # etc...
- end
- 1.ordinalize # => "1st"
- 2.ordinalize # => "2nd"
- 1002.ordinalize # => "1002nd"
Add Comment
Please, Sign In to add comment