demarches-normaliennes/spec/models/expert_spec.rb

16 lines
532 B
Ruby
Raw Normal View History

2021-01-07 15:45:02 +01:00
RSpec.describe Expert, type: :model do
describe 'an expert could be add to a procedure' do
let(:procedure) { create(:procedure) }
2021-01-15 16:33:36 +01:00
let(:expert) { create(:expert) }
2021-01-07 15:45:02 +01:00
before do
procedure.experts << expert
procedure.reload
end
it { expect(procedure.experts).to eq([expert]) }
it { expect(ExpertsProcedure.where(expert: expert, procedure: procedure).count).to eq(1) }
it { expect(ExpertsProcedure.where(expert: expert, procedure: procedure).first.allow_decision_access).to be_falsy }
2021-01-07 15:45:02 +01:00
end
end