2017-10-02 17:03:30 +02:00
|
|
|
describe AssignTo, type: :model do
|
|
|
|
describe '#procedure_presentation_or_default' do
|
2018-10-23 11:03:43 +02:00
|
|
|
let(:procedure) { create(:procedure) }
|
|
|
|
let(:assign_to) { AssignTo.create(procedure: procedure) }
|
|
|
|
|
|
|
|
let(:procedure_presentation_or_default) { assign_to.procedure_presentation_or_default }
|
2017-10-02 17:03:30 +02:00
|
|
|
|
2018-10-23 11:03:43 +02:00
|
|
|
context "without a procedure_presentation" do
|
|
|
|
it { expect(procedure_presentation_or_default.persisted?).to be_falsey }
|
2017-10-02 17:03:30 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
context "with a procedure_presentation" do
|
|
|
|
let!(:procedure_presentation) { ProcedurePresentation.create(assign_to: assign_to) }
|
|
|
|
|
2018-10-23 11:03:43 +02:00
|
|
|
it { expect(procedure_presentation_or_default).to eq(procedure_presentation) }
|
2017-10-02 17:03:30 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|