Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- it "should load all bookings for event" do
- check_number_of_rows( 'bookings', 2 )
- check_row( 'bookings', 0, [@bookings[0].checkin_code,'2','0', 'John Doe', 'jdoe@email.com', '12345', '/images/done.png', '2,checkin'] )
- check_row( 'bookings', 1, [@bookings[1].checkin_code,'1','0', 'John Doe', 'jdoe@email.com', '12345', '/images/done.png', '1,checkin'] )
- end
- it "should checkin quantity of 1 on first booking from datagrid form" do
- @browser.text_input({:id => 'quantity_form', :automationName => 'booking_checkin_quantity_1'}).input('1')
- @browser.button({:id => 'booking_checkin_button', :automationName => 'booking_checkin_button_1'}).click and wait_for_application_to_complete_request
- flash_message.should eql(@bookings[0].checkin_code+' - checked in OK (1 remaining)')
- check_row( 'bookings', 0, [@bookings[0].checkin_code,'2','1', 'John Doe', 'jdoe@email.com', '12345', '/images/done.png', '1,checkin'] )
- end
- it "should checkin qunatity of 1 on frist booking from checkin code form" do
- @browser.text_input({:id => 'checkin_code_form', :automationName => 'checkin_code_form'}).input(@bookings[0].checkin_code)
- @browser.button({:id => 'checkin_button', :automationName => 'checkin_button'}).click and wait_for_application_to_complete_request
- flash_message.should eql(@bookings[0].checkin_code+' - checked in OK (1 remaining)')
- check_row( 'bookings', 0, [@bookings[0].checkin_code,'2','1', 'John Doe', 'jdoe@email.com', '12345', '/images/done.png', '1,checkin'] )
- @browser.text_input({:id => 'checkin_code_form', :automationName => 'checkin_code_form'}).text.should eql('')
- end
- it "should not allow checkin more than booking quantity" do
- @browser.text_input({:id => 'quantity_form', :automationName => 'booking_checkin_quantity_1'}).input('3')
- @browser.button({:id => 'booking_checkin_button', :automationName => 'booking_checkin_button_1'}).click and wait_for_application_to_complete_request
- flash_message.should eql(@bookings[0].checkin_code+' - ALL 2 checked in OK')
- check_row( 'bookings', 0, [@bookings[0].checkin_code,'2','2', 'John Doe', 'jdoe@email.com', '12345', '/images/done.png', '0,checkin'] )
- @browser.text_input({:id => 'checkin_code_form', :automationName => 'checkin_code_form'}).input(@bookings[0].checkin_code)
- @browser.button({:id => 'checkin_button', :automationName => 'checkin_button'}).click and wait_for_application_to_complete_request
- flash_message.should eql('application errors code: ' + @bookings[0].checkin_code + ' already checked in')
- end
- it "should require a checkin code to be valid" do
- @browser.button({:id => 'checkin_button', :automationName => 'checkin_button'}).click and wait_for_application_to_complete_request
- flash_message.should eql('please enter a valid checkin code!')
- @browser.text_input({:id => 'checkin_code_form', :automationName => 'checkin_code_form'}).input('12345')
- @browser.button({:id => 'checkin_button', :automationName => 'checkin_button'}).click and wait_for_application_to_complete_request
- flash_message.should eql('please enter a valid checkin code!')
- end
Add Comment
Please, Sign In to add comment