vidpush/spec/models/campaign_spec.rb
2014-04-24 16:33:48 -04:00

17 lines
353 B
Ruby

require 'spec_helper'
describe Campaign, 'associations' do
let(:campaign){ attributes_for :campaign }
it {should have_many(:videolistings) }
it 'disallows duplicate listingcode' do
one = Campaign.new(campaign)
one.save
two = Campaign.new(campaign)
two.listingcode = one.listingcode
expect(two.valid?).to be false
end
end