gestionnaire_spec: factorize a assign helper
This commit is contained in:
parent
2e29825415
commit
421f125c45
1 changed files with 8 additions and 2 deletions
|
@ -6,10 +6,10 @@ describe Gestionnaire, type: :model do
|
|||
let!(:procedure_2) { create :procedure, :published, administrateur: admin }
|
||||
let!(:procedure_3) { create :procedure, :published, administrateur: admin }
|
||||
let(:gestionnaire) { create :gestionnaire, administrateurs: [admin] }
|
||||
let!(:procedure_assign) { create :assign_to, gestionnaire: gestionnaire, procedure: procedure }
|
||||
let!(:procedure_assign) { assign(procedure) }
|
||||
|
||||
before do
|
||||
create :assign_to, gestionnaire: gestionnaire, procedure: procedure_2
|
||||
assign(procedure_2)
|
||||
end
|
||||
|
||||
describe 'follow' do
|
||||
|
@ -390,4 +390,10 @@ describe Gestionnaire, type: :model do
|
|||
it { expect(follow.demande_seen_at).to eq(freeze_date) }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def assign(procedure_to_assign)
|
||||
create :assign_to, gestionnaire: gestionnaire, procedure: procedure_to_assign
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue