DubiousProcedure: improve spec
This commit is contained in:
parent
9f06308dbd
commit
c00f56d454
2 changed files with 8 additions and 2 deletions
|
@ -119,6 +119,12 @@ FactoryBot.define do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
trait :whitelisted do
|
||||||
|
after(:build) do |procedure, _evaluator|
|
||||||
|
procedure.update(whitelisted_at: DateTime.now)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
trait :with_notice do
|
trait :with_notice do
|
||||||
after(:create) do |procedure, _evaluator|
|
after(:create) do |procedure, _evaluator|
|
||||||
procedure.notice.attach(
|
procedure.notice.attach(
|
||||||
|
|
|
@ -35,13 +35,13 @@ RSpec.describe FindDubiousProceduresJob, type: :job do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'and a whitelisted procedure' do
|
context 'and a whitelisted procedure' do
|
||||||
let(:procedure) { create(:procedure, whitelisted_at: DateTime.now) }
|
let(:procedure) { create(:procedure, :whitelisted) }
|
||||||
|
|
||||||
it { expect(AdministrationMailer).to have_received(:dubious_procedures).with([]) }
|
it { expect(AdministrationMailer).to have_received(:dubious_procedures).with([]) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'and a archived procedure' do
|
context 'and a archived procedure' do
|
||||||
let(:procedure) { create(:procedure, archived_at: DateTime.now) }
|
let(:procedure) { create(:procedure, :archived) }
|
||||||
|
|
||||||
it { expect(AdministrationMailer).to have_received(:dubious_procedures).with([]) }
|
it { expect(AdministrationMailer).to have_received(:dubious_procedures).with([]) }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue