Merge pull request #560 from hennevogel/feature-user-view
Various small UI fixes
This commit is contained in:
commit
b65a33f047
64 changed files with 932 additions and 2243 deletions
|
|
@ -16,6 +16,7 @@ feature 'Has correct abilities' do
|
|||
let(:user) { create(:user, role_ids: [role_organizer.id, role_cfp.id, role_info_desk.id, role_volunteer_coordinator.id]) }
|
||||
|
||||
scenario 'when user is organizer' do
|
||||
user.is_admin = false
|
||||
sign_in user
|
||||
visit admin_conference_path(conference1.short_title)
|
||||
|
||||
|
|
@ -86,6 +87,7 @@ feature 'Has correct abilities' do
|
|||
end
|
||||
|
||||
scenario 'when user is cfp' do
|
||||
user.is_admin = false
|
||||
sign_in user
|
||||
visit admin_conference_path(conference2.short_title)
|
||||
|
||||
|
|
@ -156,6 +158,7 @@ feature 'Has correct abilities' do
|
|||
end
|
||||
|
||||
scenario 'when user is info desk' do
|
||||
user.is_admin = false
|
||||
sign_in user
|
||||
visit admin_conference_path(conference3.short_title)
|
||||
|
||||
|
|
@ -227,6 +230,7 @@ feature 'Has correct abilities' do
|
|||
end
|
||||
|
||||
scenario 'when user is volunteer coordinator' do
|
||||
user.is_admin = false
|
||||
sign_in user
|
||||
visit admin_conference_path(conference4.short_title)
|
||||
|
||||
|
|
|
|||
|
|
@ -18,21 +18,22 @@ feature Registration do
|
|||
|
||||
scenario 'updates conference registration', feature: true, js: true do
|
||||
visit root_path
|
||||
click_link 'Modify Registration'
|
||||
click_link 'My Registration'
|
||||
expect(current_path).to eq(conference_conference_registrations_path(conference.short_title))
|
||||
|
||||
click_link 'Edit your Registration'
|
||||
expect(current_path).to eq(edit_conference_conference_registrations_path(conference.short_title))
|
||||
click_button 'Update Registration'
|
||||
|
||||
click_button 'Update Registration'
|
||||
expect(conference.user_registered?(participant)).to be(true)
|
||||
end
|
||||
|
||||
scenario 'unregisters for a conference', feature: true, js: true do
|
||||
visit root_path
|
||||
click_link 'Modify Registration'
|
||||
click_link 'My Registration'
|
||||
expect(current_path).to eq(conference_conference_registrations_path(conference.short_title))
|
||||
|
||||
expect(current_path).to eq(edit_conference_conference_registrations_path(conference.short_title))
|
||||
click_link 'Unregister'
|
||||
|
||||
expect(conference.user_registered?(participant)).to be(false)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ feature DifficultyLevel do
|
|||
within('table#difficulty_levels') do
|
||||
expect(page.has_content?('Hard')).to be true
|
||||
expect(page.has_content?('Life is the hardest')).to be true
|
||||
expect(page.assert_selector('tr', count: 2)).to be true
|
||||
expect(page.assert_selector('tr', count: 5)).to be true
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -38,12 +38,17 @@ feature DifficultyLevel do
|
|||
conference_id: conference.short_title)
|
||||
|
||||
# Remove difficulty level
|
||||
click_link 'Delete'
|
||||
within('table tr:nth-of-type(4)') do
|
||||
click_link 'Delete'
|
||||
end
|
||||
|
||||
# Validations
|
||||
expect(flash).to eq('Difficulty level successfully deleted.')
|
||||
within('table#difficulty_levels') do
|
||||
expect(page.assert_selector('tr', count: 1)).to be true
|
||||
expect(page.assert_selector('tr', count: 4)).to be true
|
||||
expect(page.has_content?('Easy Events')).to be true
|
||||
expect(page.has_content?('Medium Events')).to be true
|
||||
expect(page.has_content?('Hard Events')).to be true
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ require 'spec_helper'
|
|||
|
||||
feature Registration do
|
||||
let!(:ticket) { create(:ticket) }
|
||||
let!(:conference) { create(:conference, title: 'ExampleCon', tickets: [ticket]) }
|
||||
let!(:conference) { create(:conference, title: 'ExampleCon', tickets: [ticket], registration_period: create(:registration_period, start_date: 3.days.ago)) }
|
||||
let!(:participant) { create(:user) }
|
||||
|
||||
context 'as a participant' do
|
||||
|
|
@ -18,7 +18,10 @@ feature Registration do
|
|||
|
||||
scenario 'purchases a ticket', feature: true, js: true do
|
||||
visit root_path
|
||||
click_link 'Support'
|
||||
click_link 'Register'
|
||||
|
||||
expect(current_path).to eq(new_conference_conference_registrations_path(conference.short_title))
|
||||
click_button 'Register'
|
||||
|
||||
fill_in "tickets__#{ticket.id}", with: '2'
|
||||
expect(current_path).to eq(conference_tickets_path(conference.short_title))
|
||||
|
|
@ -29,20 +32,18 @@ feature Registration do
|
|||
expect(purchase.quantity).to eq(2)
|
||||
expect(current_path).to eq(conference_conference_registrations_path(conference.short_title))
|
||||
expect(flash).
|
||||
to eq('Congratulations, you have successfully purchased a ticket! You can pay for it in cash when you arrive! Thank you for supporting ExampleCon!')
|
||||
expect(page.has_content?('Business Ticket')).to be true
|
||||
to eq("Thank you for supporting #{conference.title} by purchasing a ticket.")
|
||||
expect(page.has_content?('2 Business Ticket Tickets for 10')).to be true
|
||||
end
|
||||
|
||||
scenario 'deletes a purchased ticket', feature: true, js: true do
|
||||
create(:ticket_purchase,
|
||||
user_id: participant.id,
|
||||
ticket_id: ticket.id,
|
||||
quantity: 2)
|
||||
create(:registration, conference: conference, user: participant)
|
||||
create(:ticket_purchase, conference: conference, user: participant, ticket: ticket, quantity: 4)
|
||||
|
||||
visit conference_conference_registrations_path(conference.short_title)
|
||||
expect(page.has_content?('Business Ticket')).to be true
|
||||
expect(page.has_content?('4 Business Ticket Tickets for 10')).to be true
|
||||
|
||||
click_link 'Delete'
|
||||
click_link "ticket-#{ticket.id}-delete"
|
||||
expect(flash).to eq('Ticket successfully deleted.')
|
||||
expect(TicketPurchase.count).to eq(0)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue