Fix up test failures in Chrome & Firefox
This commit is contained in:
parent
b72bb8a0ed
commit
1b9a12746d
29 changed files with 145 additions and 78 deletions
|
|
@ -25,6 +25,7 @@ feature Ticket do
|
|||
fill_in 'ticket_price', with: '100'
|
||||
|
||||
click_button 'Create Ticket'
|
||||
page.find('#flash')
|
||||
expect(flash).to eq('Ticket successfully created.')
|
||||
expect(Ticket.count).to eq(2)
|
||||
end
|
||||
|
|
@ -37,6 +38,7 @@ feature Ticket do
|
|||
fill_in 'ticket_price', with: '-1'
|
||||
|
||||
click_button 'Create Ticket'
|
||||
page.find('#flash')
|
||||
expect(flash).to eq("Creating Ticket failed: Title can't be blank. Price cents must be greater than or equal to 0.")
|
||||
expect(Ticket.count).to eq(1)
|
||||
end
|
||||
|
|
@ -55,9 +57,10 @@ feature Ticket do
|
|||
|
||||
ticket.reload
|
||||
# It's necessary to multiply by 100 because the price is in cents
|
||||
page.find('#flash')
|
||||
expect(flash).to eq('Ticket successfully updated.')
|
||||
expect(ticket.price).to eq(Money.new(50 * 100, 'USD'))
|
||||
expect(ticket.title).to eq('Event Ticket')
|
||||
expect(flash).to eq('Ticket successfully updated.')
|
||||
expect(Ticket.count).to eq(2)
|
||||
end
|
||||
|
||||
|
|
@ -72,6 +75,7 @@ feature Ticket do
|
|||
|
||||
ticket.reload
|
||||
# It's necessary to multiply by 100 because the price is in cents
|
||||
page.find('#flash')
|
||||
expect(ticket.price).to eq(Money.new(100 * 100, 'USD'))
|
||||
expect(ticket.title).to eq('Business Ticket')
|
||||
expect(flash).to eq("Ticket update failed: Title can't be blank. Price cents must be greater than or equal to 0.")
|
||||
|
|
@ -81,7 +85,8 @@ feature Ticket do
|
|||
scenario 'delete ticket', feature: true, js: true do
|
||||
visit admin_conference_tickets_path(conference.short_title)
|
||||
click_link('Delete', href: admin_conference_ticket_path(conference.short_title, ticket.id))
|
||||
|
||||
page.accept_alert
|
||||
page.find('#flash')
|
||||
expect(flash).to eq('Ticket successfully destroyed.')
|
||||
expect(Ticket.count).to eq(1)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue