add payment mode to ticket schema
This commit is contained in:
parent
301ad1c722
commit
a8fd1a7903
5 changed files with 14 additions and 3 deletions
|
|
@ -3,5 +3,6 @@ FactoryGirl.define do
|
|||
title { "#{Faker::Hipster.word} Ticket" }
|
||||
price_cents 1000
|
||||
price_currency 'USD'
|
||||
payment_mode 'Online'
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ require 'spec_helper'
|
|||
|
||||
describe Ticket do
|
||||
let(:conference) { create(:conference) }
|
||||
let(:ticket) { create(:ticket, price: 50, price_currency: 'USD', conference: conference) }
|
||||
let(:ticket) { create(:ticket, price: 50, price_currency: 'USD', payment_mode: 'Online', conference: conference) }
|
||||
let(:user) { create(:user) }
|
||||
|
||||
describe 'validation' do
|
||||
|
|
@ -22,6 +22,10 @@ describe Ticket do
|
|||
should validate_presence_of(:price_currency)
|
||||
end
|
||||
|
||||
it 'is not valid without a payment_mode' do
|
||||
should validate_presence_of(:payment_mode)
|
||||
end
|
||||
|
||||
it 'is not valid with a price_cents equals zero' do
|
||||
should_not allow_value(0).for(:price_cents)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue