diff options
author | Claire <claire.github-309c@sitedethib.com> | 2024-04-05 09:48:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-05 07:48:07 +0000 |
commit | 1f11aa5f042542cbac1191df4e7b657ecda99280 (patch) | |
tree | 0b90f6ad3d49a9b5c04953b4696d8ff10c32e6b4 | |
parent | 601834d74646955ad878024a8b32d35ad3ac0a56 (diff) |
Add stub for trending tags in user mailer spec (#29850)
-rw-r--r-- | spec/mailers/user_mailer_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb index 404b8347028..5a8c293740b 100644 --- a/spec/mailers/user_mailer_spec.rb +++ b/spec/mailers/user_mailer_spec.rb @@ -247,6 +247,12 @@ describe UserMailer do describe '#welcome' do let(:mail) { described_class.welcome(receiver) } + before do + # This is a bit hacky and low-level but this allows stubbing trending tags + tag_ids = Fabricate.times(5, :tag).pluck(:id) + allow(Trends.tags).to receive(:query).and_return(instance_double(Trends::Query, allowed: Tag.where(id: tag_ids))) + end + it 'renders welcome mail' do expect(mail) .to be_present |