Skip to content

Commit 7247918

Browse files
test: that a change to the discarded_at is staged as a difference
Jira-Issue: MAV-1346
1 parent 49033b2 commit 7247918

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

spec/models/immunisation_import_row_spec.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,12 +925,13 @@
925925
end
926926
end
927927

928-
context "with an existing vaccination record" do
928+
context "with an existing, discarded vaccination record" do
929929
let!(:existing_vaccination_record) do
930930
create(
931931
:vaccination_record,
932932
programme: programmes.first,
933-
session: create(:session, team:, programmes:)
933+
session: create(:session, team:, programmes:),
934+
discarded_at: Time.current
934935
)
935936
end
936937

@@ -940,6 +941,10 @@
940941

941942
it { should_not be_nil }
942943
it { should eq(existing_vaccination_record) }
944+
945+
it "stages changes discarded at to nil" do
946+
expect(vaccination_record.pending_changes["discarded_at"]).to be_nil
947+
end
943948
end
944949

945950
describe "#batch" do

0 commit comments

Comments
 (0)