add payment mode to ticket schema

This commit is contained in:
Rishabh Saxena 2016-05-26 23:01:36 +05:30
parent 301ad1c722
commit a8fd1a7903
5 changed files with 14 additions and 3 deletions

View file

@ -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