From bb731aec003a4626fec110577f14bb64fcdf46db Mon Sep 17 00:00:00 2001 From: Stella Rouzi Date: Tue, 2 Sep 2014 23:28:23 +0300 Subject: [PATCH] tickets controller fix message --- app/controllers/ticket_purchases_controller.rb | 6 +++--- spec/features/ticket_purchases_spec.rb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/ticket_purchases_controller.rb b/app/controllers/ticket_purchases_controller.rb index 5f548d88..40059e69 100644 --- a/app/controllers/ticket_purchases_controller.rb +++ b/app/controllers/ticket_purchases_controller.rb @@ -8,7 +8,7 @@ class TicketPurchasesController < ApplicationController if message.blank? redirect_to conference_conference_registrations_path(@conference.short_title), 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 redirect_to conference_conference_registrations_path(@conference.short_title), 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]) if @ticket_purchases.destroy redirect_to conference_conference_registrations_path(@conference.short_title), - notice: 'Ticket successfully destroyed.' + notice: 'Ticket successfully deleted.' else 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('. ')}." end end diff --git a/spec/features/ticket_purchases_spec.rb b/spec/features/ticket_purchases_spec.rb index 64cc4f31..ae782f9e 100644 --- a/spec/features/ticket_purchases_spec.rb +++ b/spec/features/ticket_purchases_spec.rb @@ -29,7 +29,7 @@ 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 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 end @@ -43,7 +43,7 @@ feature Registration do expect(page.has_content?('Business Ticket')).to be true click_link 'Delete' - expect(flash).to eq('Ticket successfully destroyed.') + expect(flash).to eq('Ticket successfully deleted.') expect(TicketPurchase.count).to eq(0) end end