commit
c486027e6b
5 changed files with 13 additions and 13 deletions
|
|
@ -22,7 +22,7 @@ module Admin
|
||||||
redirect_to admin_conference_commercials_path,
|
redirect_to admin_conference_commercials_path,
|
||||||
notice: 'Commercial was successfully created.'
|
notice: 'Commercial was successfully created.'
|
||||||
else
|
else
|
||||||
flash[:alert] = "A error prohibited this Commercial from being saved: #{@commercial.errors.full_messages.join('. ')}."
|
flash[:alert] = "An error prohibited this Commercial from being saved: #{@commercial.errors.full_messages.join('. ')}."
|
||||||
render :new
|
render :new
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -32,7 +32,7 @@ module Admin
|
||||||
redirect_to admin_conference_commercials_path,
|
redirect_to admin_conference_commercials_path,
|
||||||
notice: 'Commercial was successfully updated.'
|
notice: 'Commercial was successfully updated.'
|
||||||
else
|
else
|
||||||
flash[:alert] = "A error prohibited this Commercial from being saved: #{@commercial.errors.full_messages.join('. ')}."
|
flash[:alert] = "An error prohibited this Commercial from being saved: #{@commercial.errors.full_messages.join('. ')}."
|
||||||
render :edit
|
render :edit
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ class CommercialsController < ApplicationController
|
||||||
redirect_to edit_conference_proposal_path(conference_id: @conference.short_title, id: @event.id),
|
redirect_to edit_conference_proposal_path(conference_id: @conference.short_title, id: @event.id),
|
||||||
notice: 'Commercial was successfully created.'
|
notice: 'Commercial was successfully created.'
|
||||||
else
|
else
|
||||||
flash[:alert] = "A error prohibited this Commercial from being saved: #{@commercial.errors.full_messages.join('. ')}."
|
flash[:alert] = "An error prohibited this Commercial from being saved: #{@commercial.errors.full_messages.join('. ')}."
|
||||||
render :new
|
render :new
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -28,7 +28,7 @@ class CommercialsController < ApplicationController
|
||||||
redirect_to edit_conference_proposal_path(conference_id: @conference.short_title, id: @event.id),
|
redirect_to edit_conference_proposal_path(conference_id: @conference.short_title, id: @event.id),
|
||||||
notice: 'Commercial was successfully updated.'
|
notice: 'Commercial was successfully updated.'
|
||||||
else
|
else
|
||||||
flash[:alert] = "A error prohibited this Commercial from being saved: #{@commercial.errors.full_messages.join('. ')}."
|
flash[:alert] = "An error prohibited this Commercial from being saved: #{@commercial.errors.full_messages.join('. ')}."
|
||||||
render :edit
|
render :edit
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ class TicketPurchasesController < ApplicationController
|
||||||
if message.blank?
|
if message.blank?
|
||||||
redirect_to conference_conference_registrations_path(@conference.short_title),
|
redirect_to conference_conference_registrations_path(@conference.short_title),
|
||||||
notice: 'Congratulations, you have successfully purchased a ticket! ' \
|
notice: 'Congratulations, you have successfully purchased a ticket! ' \
|
||||||
"You can pay it cash on check in! Thank you for supporting #{@conference.title}!"
|
"You can pay for it in cash when you arrive! Thank you for supporting #{@conference.title}!"
|
||||||
else
|
else
|
||||||
redirect_to conference_conference_registrations_path(@conference.short_title),
|
redirect_to conference_conference_registrations_path(@conference.short_title),
|
||||||
alert: "Oops, something went wrong with your purchase! #{message}"
|
alert: "Oops, something went wrong with your purchase! #{message}"
|
||||||
|
|
@ -19,10 +19,10 @@ class TicketPurchasesController < ApplicationController
|
||||||
@ticket_purchases = current_user.ticket_purchases.find_by(ticket_id: params[:id])
|
@ticket_purchases = current_user.ticket_purchases.find_by(ticket_id: params[:id])
|
||||||
if @ticket_purchases.destroy
|
if @ticket_purchases.destroy
|
||||||
redirect_to conference_conference_registrations_path(@conference.short_title),
|
redirect_to conference_conference_registrations_path(@conference.short_title),
|
||||||
notice: 'Ticket successfully destroyed.'
|
notice: 'Ticket successfully deleted.'
|
||||||
else
|
else
|
||||||
redirect_to conference_conference_registrations_path(@conference.short_title),
|
redirect_to conference_conference_registrations_path(@conference.short_title),
|
||||||
notice: 'A error prohibited deleting your purchase! '\
|
alert: 'An error prohibited deleting your purchase! '\
|
||||||
"#{@ticket_purchases.errors.full_messages.join('. ')}."
|
"#{@ticket_purchases.errors.full_messages.join('. ')}."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ feature Commercial do
|
||||||
select('SlideShare', from: 'commercial_commercial_type')
|
select('SlideShare', from: 'commercial_commercial_type')
|
||||||
|
|
||||||
click_button 'Create Commercial'
|
click_button 'Create Commercial'
|
||||||
expect(flash).to eq("A error prohibited this Commercial from being saved: Commercial can't be blank.")
|
expect(flash).to eq("An error prohibited this Commercial from being saved: Commercial can't be blank.")
|
||||||
expect(conference.commercials.count).to eq(expected_count - 1)
|
expect(conference.commercials.count).to eq(expected_count - 1)
|
||||||
|
|
||||||
# Create valid commercial
|
# Create valid commercial
|
||||||
|
|
@ -39,7 +39,7 @@ feature Commercial do
|
||||||
fill_in 'commercial_commercial_id', with: ''
|
fill_in 'commercial_commercial_id', with: ''
|
||||||
|
|
||||||
click_button 'Update Commercial'
|
click_button 'Update Commercial'
|
||||||
expect(flash).to eq("A error prohibited this Commercial from being saved: Commercial can't be blank.")
|
expect(flash).to eq("An error prohibited this Commercial from being saved: Commercial can't be blank.")
|
||||||
expect(conference.commercials.count).to eq(expected_count)
|
expect(conference.commercials.count).to eq(expected_count)
|
||||||
|
|
||||||
# Update valid commercial
|
# Update valid commercial
|
||||||
|
|
@ -97,7 +97,7 @@ feature Commercial do
|
||||||
select('SlideShare', from: 'commercial_commercial_type')
|
select('SlideShare', from: 'commercial_commercial_type')
|
||||||
|
|
||||||
click_button 'Create Commercial'
|
click_button 'Create Commercial'
|
||||||
expect(flash).to eq("A error prohibited this Commercial from being saved: Commercial can't be blank.")
|
expect(flash).to eq("An error prohibited this Commercial from being saved: Commercial can't be blank.")
|
||||||
expect(event.commercials.count).to eq(@expected_count - 1)
|
expect(event.commercials.count).to eq(@expected_count - 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -125,7 +125,7 @@ feature Commercial do
|
||||||
select('SlideShare', from: 'commercial_commercial_type')
|
select('SlideShare', from: 'commercial_commercial_type')
|
||||||
fill_in 'commercial_commercial_id', with: ''
|
fill_in 'commercial_commercial_id', with: ''
|
||||||
click_button 'Update Commercial'
|
click_button 'Update Commercial'
|
||||||
expect(flash).to eq("A error prohibited this Commercial from being saved: Commercial can't be blank.")
|
expect(flash).to eq("An error prohibited this Commercial from being saved: Commercial can't be blank.")
|
||||||
expect(event.commercials.count).to eq(@expected_count)
|
expect(event.commercials.count).to eq(@expected_count)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ feature Registration do
|
||||||
expect(purchase.quantity).to eq(2)
|
expect(purchase.quantity).to eq(2)
|
||||||
expect(current_path).to eq(conference_conference_registrations_path(conference.short_title))
|
expect(current_path).to eq(conference_conference_registrations_path(conference.short_title))
|
||||||
expect(flash).
|
expect(flash).
|
||||||
to eq('Congratulations, you have successfully purchased a ticket! You can pay it cash on check in! Thank you for supporting ExampleCon!')
|
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
|
expect(page.has_content?('Business Ticket')).to be true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -43,7 +43,7 @@ feature Registration do
|
||||||
expect(page.has_content?('Business Ticket')).to be true
|
expect(page.has_content?('Business Ticket')).to be true
|
||||||
|
|
||||||
click_link 'Delete'
|
click_link 'Delete'
|
||||||
expect(flash).to eq('Ticket successfully destroyed.')
|
expect(flash).to eq('Ticket successfully deleted.')
|
||||||
expect(TicketPurchase.count).to eq(0)
|
expect(TicketPurchase.count).to eq(0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue