Fix specs

This commit is contained in:
decabeza
2019-04-25 12:28:24 +02:00
parent dfbdc0568c
commit 20f505ab7c
3 changed files with 16 additions and 1 deletions

View File

@@ -193,7 +193,7 @@ feature "Polls" do
end end
page.driver.browser.switch_to.window page.driver.browser.window_handles.last do 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
end end

View File

@@ -8,9 +8,14 @@ describe "Dashboards Rake" do
before do before do
Rake.application.rake_require "tasks/dashboards" Rake.application.rake_require "tasks/dashboards"
Rake::Task.define_task(:environment) Rake::Task.define_task(:environment)
Setting["dashboard.emails"] = true
ActionMailer::Base.deliveries.clear ActionMailer::Base.deliveries.clear
end end
after do
Setting["dashboard.emails"] = nil
end
let :run_rake_task do let :run_rake_task do
Rake::Task["dashboards:send_notifications"].reenable Rake::Task["dashboards:send_notifications"].reenable
Rake.application.invoke_task "dashboards:send_notifications" Rake.application.invoke_task "dashboards:send_notifications"

View File

@@ -1024,9 +1024,14 @@ describe Proposal do
describe "#send_new_actions_notification_on_create" do describe "#send_new_actions_notification_on_create" do
before do before do
Setting["dashboard.emails"] = true
ActionMailer::Base.deliveries.clear ActionMailer::Base.deliveries.clear
end end
after do
Setting["dashboard.emails"] = nil
end
it "send notification after create when there are new actived actions" do 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, :proposed_action, :active, day_offset: 0, published_proposal: false)
create(:dashboard_action, :resource, :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 describe "#send_new_actions_notification_on_published" do
before do before do
Setting["dashboard.emails"] = true
ActionMailer::Base.deliveries.clear ActionMailer::Base.deliveries.clear
end end
after do
Setting["dashboard.emails"] = nil
end
it "send notification after published when there are new actived actions" do 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, :proposed_action, :active, day_offset: 0, published_proposal: true)
create(:dashboard_action, :resource, :active, day_offset: 0, published_proposal: true) create(:dashboard_action, :resource, :active, day_offset: 0, published_proposal: true)