From c15ead714015c0e123478488c6e6630def1752a3 Mon Sep 17 00:00:00 2001 From: Matthew Rider Date: Thu, 7 Nov 2024 13:06:44 +0100 Subject: [PATCH] Add case where someone has unsubscribed --- spec/models/organization_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/models/organization_spec.rb b/spec/models/organization_spec.rb index 367e26fd2..e7bef616d 100644 --- a/spec/models/organization_spec.rb +++ b/spec/models/organization_spec.rb @@ -97,7 +97,10 @@ end context 'given an inactive contributor with the same tag' do - before { create(:contributor, tag_list: %w[Homeowner], organization: organization, deactivated_at: 1.day.ago) } + before do + create(:contributor, tag_list: %w[Homeowner], deactivated_at: 1.day.ago, organization: organization) + create(:contributor, tag_list: 'teacher', unsubscribed_at: 1.day.ago, organization: organization) + end it "does not count inactive contributor's tags" do expect(subject).to eq([['Homeowner', 1]])