diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb index 404b834702..5a8c293740 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