Retire semantic_form_for
Also a buttload of form cleanups...
This commit is contained in:
parent
350b1ebbbe
commit
81853d1ef9
136 changed files with 1825 additions and 1441 deletions
|
|
@ -29,19 +29,6 @@ feature Ticket do
|
|||
expect(Ticket.count).to eq(2)
|
||||
end
|
||||
|
||||
scenario 'add a invalid ticket', feature: true, js: true do
|
||||
visit admin_conference_tickets_path(conference.short_title)
|
||||
click_link 'Add Ticket'
|
||||
|
||||
fill_in 'ticket_title', with: ''
|
||||
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
|
||||
|
||||
context 'Ticket already created' do
|
||||
let!(:ticket) { create(:ticket, title: 'Business Ticket', price: 100, conference_id: conference.id) }
|
||||
|
||||
|
|
@ -63,24 +50,6 @@ feature Ticket do
|
|||
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', href: edit_admin_conference_ticket_path(conference.short_title, ticket.id))
|
||||
|
||||
fill_in 'ticket_title', with: ''
|
||||
fill_in 'ticket_price', with: '-5'
|
||||
|
||||
click_button 'Update Ticket'
|
||||
|
||||
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.")
|
||||
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', href: admin_conference_ticket_path(conference.short_title, ticket.id))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue