Make ticket layout configurable
Added option for conference organizer to switch between ticket layouts (horizontal or vertical). Added test for the same.
This commit is contained in:
parent
e25de318bd
commit
dd52a9b2ab
10 changed files with 38 additions and 2 deletions
20
spec/controllers/physical_ticket_controller_spec.rb
Normal file
20
spec/controllers/physical_ticket_controller_spec.rb
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe PhysicalTicketController do
|
||||
let(:conference) { create(:conference) }
|
||||
let(:user) { create(:user) }
|
||||
let(:paid_ticket_purchase) { create(:ticket_purchase, conference: conference, user: user) }
|
||||
let(:physical_ticket) { create(:physical_ticket, ticket_purchase: paid_ticket_purchase) }
|
||||
|
||||
describe 'GET #show' do
|
||||
before :each do
|
||||
sign_in user
|
||||
get :show, id: physical_ticket.id, conference_id: conference.short_title
|
||||
end
|
||||
|
||||
it 'assigns ticket_layout' do
|
||||
ticket_layout = conference.ticket_layout.to_sym
|
||||
expect(assigns(:ticket_layout)).to eq ticket_layout
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -10,6 +10,7 @@ FactoryGirl.define do
|
|||
start_hour 9
|
||||
end_hour 20
|
||||
registration_limit 0
|
||||
ticket_layout 'portrait'
|
||||
description { Faker::Hipster.paragraph }
|
||||
organization
|
||||
after(:create) do |conference|
|
||||
|
|
|
|||
|
|
@ -1573,6 +1573,10 @@ describe Conference do
|
|||
should validate_presence_of(:end_hour)
|
||||
end
|
||||
|
||||
it 'is not valid without a ticket_layout' do
|
||||
should validate_presence_of(:ticket_layout)
|
||||
end
|
||||
|
||||
it 'is not valid with a duplicate short title' do
|
||||
should validate_uniqueness_of(:short_title)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue