Add trait to create a poll associated to a budget

This commit is contained in:
Javi Martín
2019-09-23 05:47:58 +02:00
parent 4edab79910
commit 52e54363ae
7 changed files with 11 additions and 14 deletions

View File

@@ -1,8 +1,7 @@
require "rails_helper"
describe "Poll budget ballot sheets" do
let(:budget) { create(:budget) }
let(:poll) { create(:poll, budget: budget, ends_at: 1.day.ago) }
let(:poll) { create(:poll, :for_budget, ends_at: 1.day.ago) }
let(:booth) { create(:poll_booth) }
let(:poll_officer) { create(:poll_officer) }

View File

@@ -60,8 +60,7 @@ describe "Admin Budgets" do
context "Show" do
scenario "Do not show questions section if the budget have a poll associated" do
budget = create(:budget)
poll = create(:poll, budget: budget)
poll = create(:poll, :for_budget)
visit admin_poll_path(poll)

View File

@@ -6,7 +6,7 @@ describe "Polls" do
scenario "Budget polls should not be listed" do
poll = create(:poll)
budget_poll = create(:poll, budget: create(:budget))
budget_poll = create(:poll, :for_budget)
visit polls_path
@@ -22,7 +22,7 @@ describe "Polls" do
login_as(create(:administrator).user)
poll = create(:poll)
budget_poll = create(:poll, budget: create(:budget))
budget_poll = create(:poll, :for_budget)
visit admin_polls_path

View File

@@ -8,10 +8,8 @@ describe "Poll Questions" do
end
scenario "Do not display polls associated to a budget" do
budget = create(:budget)
poll1 = create(:poll, name: "Citizen Proposal Poll")
poll2 = create(:poll, budget: budget, name: "Participatory Budget Poll")
poll2 = create(:poll, :for_budget, name: "Participatory Budget Poll")
visit admin_questions_path