Merge pull request #77 from CactusPuppy/176895045-clarify-registration-status-somehow
176895045 clarify registration status somehow
This commit is contained in:
commit
7ae22d6d2a
2 changed files with 44 additions and 0 deletions
|
|
@ -1,6 +1,11 @@
|
|||
- cache [conference, venue, '#splash#header'] do
|
||||
#banner{ style: ("background-image: url(#{conference.picture_url})" if conference.picture_url) }
|
||||
.container
|
||||
- if user_signed_in?
|
||||
- if current_user.ticket_purchases.by_conference(@conference).empty?
|
||||
.alert.bg-info{ :role => "alert", :style => "margin-bottom: 100px" }
|
||||
You have not purchased any tickets for this conference yet.
|
||||
= link_to "Book your tickets now!", "#tickets"
|
||||
.row
|
||||
.col-md-6.col-md-offset-3{ id: (conference.picture? ? "header-image" : "header-no-image") }
|
||||
.row
|
||||
|
|
|
|||
|
|
@ -164,4 +164,43 @@ feature Splashpage do
|
|||
expect(happening_now).to have_content(event_schedule4.event.title)
|
||||
end
|
||||
end
|
||||
|
||||
context 'clarify registration status' do
|
||||
let!(:splashpage) { create(:splashpage, conference: conference, public: true)}
|
||||
let!(:ticket_1) { create(:ticket) }
|
||||
let!(:free_ticket) { create(:ticket, price_cents: 0) }
|
||||
|
||||
scenario 'user signed in with no tickets', feature: true do
|
||||
sign_in participant
|
||||
visit conference_path(conference.short_title)
|
||||
expect(page).to have_content 'You have not purchased any tickets for this conference yet.'
|
||||
end
|
||||
|
||||
scenario 'user signed in with 1 free ticket', feature: true do
|
||||
sign_in participant
|
||||
create(:ticket_purchase, conference: conference, user: participant, ticket: free_ticket, quantity: 1)
|
||||
visit conference_path(conference.short_title)
|
||||
expect(page).not_to have_content 'You have not purchased any tickets for this conference yet.'
|
||||
end
|
||||
|
||||
scenario 'user signed in with 1 paid ticket', feature: true do
|
||||
sign_in participant
|
||||
create(:ticket_purchase, conference: conference, user: participant, ticket: ticket_1, quantity: 1)
|
||||
visit conference_path(conference.short_title)
|
||||
expect(page).not_to have_content 'You have not purchased any tickets for this conference yet.'
|
||||
end
|
||||
|
||||
scenario 'user signed in with multiple ticket', feature: true do
|
||||
sign_in participant
|
||||
create(:ticket_purchase, conference: conference, user: participant, ticket: ticket_1, quantity: 1)
|
||||
create(:ticket_purchase, conference: conference, user: participant, ticket: free_ticket, quantity: 1)
|
||||
visit conference_path(conference.short_title)
|
||||
expect(page).not_to have_content 'You have not purchased any tickets for this conference yet.'
|
||||
end
|
||||
|
||||
scenario 'user not signed in', feature: true do
|
||||
visit conference_path(conference.short_title)
|
||||
expect(page).not_to have_content 'You have not purchased any tickets for this conference yet.'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue