mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
remove tickets testing ambiguity
This commit is contained in:
parent
fe828d24db
commit
b9b7a4d97d
1 changed files with 10 additions and 10 deletions
|
|
@ -24,7 +24,7 @@ feature Ticket do
|
|||
|
||||
click_button 'Create Ticket'
|
||||
expect(flash).to eq('Ticket successfully created.')
|
||||
expect(Ticket.count).to eq(1)
|
||||
expect(Ticket.count).to eq(2)
|
||||
end
|
||||
|
||||
scenario 'add a invalid ticket', feature: true, js: true do
|
||||
|
|
@ -36,7 +36,7 @@ feature Ticket do
|
|||
|
||||
click_button 'Create Ticket'
|
||||
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(0)
|
||||
expect(Ticket.count).to eq(1)
|
||||
end
|
||||
|
||||
context 'Ticket already created' do
|
||||
|
|
@ -44,9 +44,9 @@ feature Ticket do
|
|||
|
||||
scenario 'edit valid ticket', feature: true, js: true do
|
||||
visit admin_conference_tickets_path(conference.short_title)
|
||||
click_link 'Edit'
|
||||
click_link('Edit', href: edit_admin_conference_ticket_path(conference.short_title, ticket.id))
|
||||
|
||||
fill_in 'ticket_title', with: 'Free Ticket'
|
||||
fill_in 'ticket_title', with: 'Event Ticket'
|
||||
fill_in 'ticket_price', with: '50'
|
||||
|
||||
click_button 'Update Ticket'
|
||||
|
|
@ -54,14 +54,14 @@ feature Ticket do
|
|||
ticket.reload
|
||||
# It's necessary to multiply by 100 because the price is in cents
|
||||
expect(ticket.price).to eq(Money.new(50 * 100, 'USD'))
|
||||
expect(ticket.title).to eq('Free Ticket')
|
||||
expect(ticket.title).to eq('Event Ticket')
|
||||
expect(flash).to eq('Ticket successfully updated.')
|
||||
expect(Ticket.count).to eq(1)
|
||||
expect(Ticket.count).to eq(2)
|
||||
end
|
||||
|
||||
scenario 'edit invalid ticket', feature: true, js: true do
|
||||
visit admin_conference_tickets_path(conference.short_title)
|
||||
click_link 'Edit'
|
||||
click_link('Edit', href: edit_admin_conference_ticket_path(conference.short_title, ticket.id))
|
||||
|
||||
fill_in 'ticket_title', with: ''
|
||||
fill_in 'ticket_price', with: '-5'
|
||||
|
|
@ -73,15 +73,15 @@ feature Ticket do
|
|||
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.")
|
||||
expect(Ticket.count).to eq(1)
|
||||
expect(Ticket.count).to eq(2)
|
||||
end
|
||||
|
||||
scenario 'delete ticket', feature: true, js: true do
|
||||
visit admin_conference_tickets_path(conference.short_title)
|
||||
click_link 'Delete'
|
||||
click_link('Delete', href: admin_conference_ticket_path(conference.short_title, ticket.id))
|
||||
|
||||
expect(flash).to eq('Ticket successfully destroyed.')
|
||||
expect(Ticket.count).to eq(0)
|
||||
expect(Ticket.count).to eq(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue