clarion/spec/models/workshop_spec.rb
Petko Bordjukov 89de56d94d Add an initial implementation of the Event model
Initial implementation & specs of the Event model and its children
2014-08-10 21:18:41 +03:00

24 lines
510 B
Ruby

require 'rails_helper'
RSpec.describe Workshop, :type => :model do
let(:event) { build :workshop }
it_behaves_like 'an event'
describe 'length' do
it 'must be between 30 and 120 minutes' do
event.length = 20
expect(event).to have_error_on :length
event.length = 240
expect(event).to have_error_on :length
event.length = 30
expect(event).to_not have_error_on :length
event.length = 120
expect(event).to_not have_error_on :length
end
end
end