Add (admin-only) tickets via 'visibile' attribute [migration]
(cherry picked from commit ce0db3d7a736e7bcde480721986dbfb4a82aa083)
This commit is contained in:
parent
1fcd5c68c5
commit
26f0377c76
15 changed files with 56 additions and 10 deletions
|
|
@ -43,6 +43,22 @@ feature Ticket do
|
|||
expect(Ticket.count).to eq(1)
|
||||
end
|
||||
|
||||
scenario 'add a hidden ticket', feature: true do
|
||||
visit admin_conference_tickets_path(conference.short_title)
|
||||
click_link 'Add Ticket'
|
||||
|
||||
fill_in 'ticket_title', with: 'Hidden Ticket'
|
||||
fill_in 'ticket_description', with: 'The hidden ticket'
|
||||
fill_in 'ticket_price', with: '100'
|
||||
uncheck 'ticket_visible'
|
||||
|
||||
click_button 'Create Ticket'
|
||||
page.find('#flash')
|
||||
expect(flash).to eq('Ticket successfully created.')
|
||||
expect(Ticket.count).to eq(2)
|
||||
expect(Ticket.visible.count).to eq(1)
|
||||
end
|
||||
|
||||
context 'Ticket already created' do
|
||||
let!(:ticket) { create(:ticket, title: 'Business Ticket', price: 100, conference_id: conference.id) }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue