diff --git a/spec/features/dashboard/polls_spec.rb b/spec/features/dashboard/polls_spec.rb index c3bccc65d..5ccd270b6 100644 --- a/spec/features/dashboard/polls_spec.rb +++ b/spec/features/dashboard/polls_spec.rb @@ -193,7 +193,7 @@ feature "Polls" do end page.driver.browser.switch_to.window page.driver.browser.window_handles.last do - expect(page).to have_current_path(results_poll_path(poll)) + expect(page).to have_current_path(results_proposal_poll_path(proposal, poll)) end end diff --git a/spec/lib/tasks/dashboards_spec.rb b/spec/lib/tasks/dashboards_spec.rb index f01620131..f0d4ab8de 100644 --- a/spec/lib/tasks/dashboards_spec.rb +++ b/spec/lib/tasks/dashboards_spec.rb @@ -8,9 +8,14 @@ describe "Dashboards Rake" do before do Rake.application.rake_require "tasks/dashboards" Rake::Task.define_task(:environment) + Setting["dashboard.emails"] = true ActionMailer::Base.deliveries.clear end + after do + Setting["dashboard.emails"] = nil + end + let :run_rake_task do Rake::Task["dashboards:send_notifications"].reenable Rake.application.invoke_task "dashboards:send_notifications" diff --git a/spec/models/proposal_spec.rb b/spec/models/proposal_spec.rb index 8f5bb7e76..426e59e70 100644 --- a/spec/models/proposal_spec.rb +++ b/spec/models/proposal_spec.rb @@ -1024,9 +1024,14 @@ describe Proposal do describe "#send_new_actions_notification_on_create" do before do + Setting["dashboard.emails"] = true ActionMailer::Base.deliveries.clear end + after do + Setting["dashboard.emails"] = nil + end + it "send notification after create when there are new actived actions" do create(:dashboard_action, :proposed_action, :active, day_offset: 0, published_proposal: false) create(:dashboard_action, :resource, :active, day_offset: 0, published_proposal: false) @@ -1050,9 +1055,14 @@ describe Proposal do describe "#send_new_actions_notification_on_published" do before do + Setting["dashboard.emails"] = true ActionMailer::Base.deliveries.clear end + after do + Setting["dashboard.emails"] = nil + end + it "send notification after published when there are new actived actions" do create(:dashboard_action, :proposed_action, :active, day_offset: 0, published_proposal: true) create(:dashboard_action, :resource, :active, day_offset: 0, published_proposal: true)