Make tests independent on mailer settings

So tests won't fail when institutions change these default settings.
This commit is contained in:
Javi Martín
2020-12-13 15:10:06 +01:00
parent 1a58fcf2a2
commit df280ffbfe
2 changed files with 7 additions and 0 deletions

View File

@@ -48,6 +48,11 @@ describe "Dashboards Rake" do
let!(:action) { create(:dashboard_action, :proposed_action, :active, day_offset: 0) } let!(:action) { create(:dashboard_action, :proposed_action, :active, day_offset: 0) }
let!(:resource) { create(:dashboard_action, :resource, :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 it " when there are news actions actived for published proposals" do
proposal = create(:proposal) proposal = create(:proposal)
action.update!(published_proposal: true) action.update!(published_proposal: true)

View File

@@ -11,6 +11,8 @@ describe Dashboard::Mailer do
before do before do
Setting["feature.dashboard.notification_emails"] = true Setting["feature.dashboard.notification_emails"] = true
Setting["mailer_from_name"] = "CONSUL"
Setting["mailer_from_address"] = "noreply@consul.dev"
end end
describe "#forward" do describe "#forward" do