Create tests for models
This commit is contained in:
parent
3172cfcbb2
commit
6a8b9f8d2d
3 changed files with 41 additions and 0 deletions
24
spec/models/booth_spec.rb
Normal file
24
spec/models/booth_spec.rb
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'Booth' do
|
||||
subject { create(:booth) }
|
||||
let!(:conference) { create(:conference) }
|
||||
|
||||
describe 'validation' do
|
||||
it 'has a valid factory' do
|
||||
expect(build(:booth)).to be_valid
|
||||
end
|
||||
|
||||
it { is_expected.to validate_presence_of(:conference) }
|
||||
|
||||
it 'is not valid without a title' do
|
||||
should validate_presence_of(:title)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'association' do
|
||||
it { is_expected.to belong_to(:conference) }
|
||||
it { is_expected.to have_many(:booth_requests) }
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue