Changed physical_ticket to plural
This commit is contained in:
parent
2247231d6e
commit
568d89b620
12 changed files with 10 additions and 10 deletions
|
|
@ -1,5 +1,5 @@
|
|||
module Admin
|
||||
class PhysicalTicketController < Admin::BaseController
|
||||
class PhysicalTicketsController < Admin::BaseController
|
||||
before_action :authenticate_user!
|
||||
load_resource :conference, find_by: :short_title
|
||||
load_and_authorize_resource
|
||||
|
|
@ -19,7 +19,7 @@ class PaymentsController < ApplicationController
|
|||
|
||||
if @payment.purchase && @payment.save
|
||||
update_purchased_ticket_purchases
|
||||
redirect_to conference_physical_ticket_index_path,
|
||||
redirect_to conference_physical_tickets_path,
|
||||
notice: 'Thanks! Your ticket is booked successfully.'
|
||||
else
|
||||
@total_amount_to_pay = Ticket.total_price(@conference, current_user, paid: false)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class PhysicalTicketController < ApplicationController
|
||||
class PhysicalTicketsController < ApplicationController
|
||||
before_action :authenticate_user!
|
||||
load_resource :conference, find_by: :short_title
|
||||
load_and_authorize_resource find_by: :token
|
||||
|
|
@ -12,7 +12,7 @@ class TicketPurchasesController < ApplicationController
|
|||
redirect_to new_conference_payment_path,
|
||||
notice: 'Please pay here to get tickets.'
|
||||
elsif current_user.ticket_purchases.by_conference(@conference).paid.any?
|
||||
redirect_to conference_physical_ticket_index_path,
|
||||
redirect_to conference_physical_tickets_path,
|
||||
notice: 'You have free tickets for the conference.'
|
||||
else
|
||||
redirect_to conference_tickets_path(@conference.short_title),
|
||||
|
|
|
|||
|
|
@ -40,4 +40,4 @@
|
|||
.row
|
||||
.col-md-12
|
||||
= link_to 'Add Ticket', new_admin_conference_ticket_path, class: 'btn btn-success pull-right'
|
||||
= link_to 'Tickets Sold', admin_conference_physical_ticket_index_path, class: 'button btn btn-default btn-info pull-right'
|
||||
= link_to 'Tickets Sold', admin_conference_physical_tickets_path, class: 'button btn btn-default btn-info pull-right'
|
||||
|
|
|
|||
|
|
@ -47,4 +47,4 @@
|
|||
- else
|
||||
= link_to 'Unsubscribe', conference_subscriptions_path(conference.short_title), method: :delete, class: 'btn btn-default'
|
||||
- if current_user && current_user.physical_tickets.by_conference(conference).any?
|
||||
= link_to "My Tickets", conference_physical_ticket_index_path(conference.short_title), class: 'btn btn-default'
|
||||
= link_to "My Tickets", conference_physical_tickets_path(conference.short_title), class: 'btn btn-default'
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ Osem::Application.routes.draw do
|
|||
resources :targets, except: [:show]
|
||||
resources :campaigns, except: [:show]
|
||||
resources :emails, only: [:show, :update, :index]
|
||||
resources :physical_ticket, only: [:index]
|
||||
resources :physical_tickets, only: [:index]
|
||||
resources :roles, except: [:new, :create] do
|
||||
member do
|
||||
post :toggle_user
|
||||
|
|
@ -184,7 +184,7 @@ Osem::Application.routes.draw do
|
|||
resources :tickets, only: [:index]
|
||||
resources :ticket_purchases, only: [:create, :destroy, :index]
|
||||
resources :payments, only: [:index, :new, :create]
|
||||
resources :physical_ticket, only: [:index, :show]
|
||||
resources :physical_tickets, only: [:index, :show]
|
||||
resource :subscriptions, only: [:create, :destroy]
|
||||
resource :schedule, only: [:show] do
|
||||
member do
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe PhysicalTicketController do
|
||||
describe PhysicalTicketsController do
|
||||
let(:conference) { create(:conference) }
|
||||
let(:user) { create(:user) }
|
||||
let(:paid_ticket_purchase) { create(:ticket_purchase, conference: conference, user: user) }
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ feature Registration do
|
|||
|
||||
click_button 'Continue'
|
||||
|
||||
expect(current_path).to eq(conference_physical_ticket_index_path(conference.short_title))
|
||||
expect(current_path).to eq(conference_physical_tickets_path(conference.short_title))
|
||||
purchase = TicketPurchase.where(user_id: participant.id, ticket_id: free_ticket.id).first
|
||||
expect(purchase.quantity).to eq(5)
|
||||
expect(purchase.paid).to be true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue