demarches-normaliennes/spec/models/evenement_vie_spec.rb

27 lines
936 B
Ruby
Raw Normal View History

require 'spec_helper'
describe EvenementVie do
describe 'database column' do
it { is_expected.to have_db_column(:nom) }
it { is_expected.to have_db_column(:created_at) }
it { is_expected.to have_db_column(:updated_at) }
it { is_expected.to have_db_column(:use_admi_facile) }
end
describe 'associations' do
it { is_expected.to have_many(:formulaires) }
end
describe '.for_admi_facile' do
2015-08-20 17:30:17 +02:00
let(:evenement_for_admi_facile) { described_class.where(use_admi_facile: true).first }
let(:evenement_not_for_admi_facile) { described_class.where(use_admi_facile: false).first }
subject { described_class.for_admi_facile }
it 'returns elements where use_admi_facile is true' do
expect(subject).to include(evenement_for_admi_facile)
end
it 'does not return elements where use_admi_facile is false' do
expect(subject).not_to include(evenement_not_for_admi_facile)
end
end
2015-08-20 17:30:17 +02:00
end