From df280ffbfe14fe694fc97c1c8e008d017d5a2a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sun, 13 Dec 2020 15:10:06 +0100 Subject: [PATCH] Make tests independent on mailer settings So tests won't fail when institutions change these default settings. --- spec/lib/tasks/dashboards_spec.rb | 5 +++++ spec/mailers/dashboard/mailer_spec.rb | 2 ++ 2 files changed, 7 insertions(+) diff --git a/spec/lib/tasks/dashboards_spec.rb b/spec/lib/tasks/dashboards_spec.rb index 6e50a31a1..78143a8e4 100644 --- a/spec/lib/tasks/dashboards_spec.rb +++ b/spec/lib/tasks/dashboards_spec.rb @@ -48,6 +48,11 @@ describe "Dashboards Rake" do let!(:action) { create(:dashboard_action, :proposed_action, :active, day_offset: 0) } let!(:resource) { create(:dashboard_action, :resource, :active, day_offset: 0) } + before do + Setting["mailer_from_name"] = "CONSUL" + Setting["mailer_from_address"] = "noreply@consul.dev" + end + it " when there are news actions actived for published proposals" do proposal = create(:proposal) action.update!(published_proposal: true) diff --git a/spec/mailers/dashboard/mailer_spec.rb b/spec/mailers/dashboard/mailer_spec.rb index 6a646e959..5c9315b6a 100644 --- a/spec/mailers/dashboard/mailer_spec.rb +++ b/spec/mailers/dashboard/mailer_spec.rb @@ -11,6 +11,8 @@ describe Dashboard::Mailer do before do Setting["feature.dashboard.notification_emails"] = true + Setting["mailer_from_name"] = "CONSUL" + Setting["mailer_from_address"] = "noreply@consul.dev" end describe "#forward" do