Remove unnecessary code

It looks like these variables were left by accident. The Ruby
interpreter was giving us warnings about unused variables.
This commit is contained in:
Javi Martín
2019-09-24 18:44:58 +02:00
parent fcaa30dc57
commit cb2069858c
9 changed files with 3 additions and 17 deletions

View File

@@ -3,8 +3,6 @@ module Abilities
include CanCan::Ability include CanCan::Ability
def initialize(user) def initialize(user)
tracker = user.tracker
can :index, Budget can :index, Budget
can [:index, :show, :edit], Budget::Investment can [:index, :show, :edit], Budget::Investment
can :manage, Milestone can :manage, Milestone

View File

@@ -8,7 +8,6 @@ describe "Admin shifts" do
end end
scenario "Show" do scenario "Show" do
poll = create(:poll)
officer = create(:poll_officer) officer = create(:poll_officer)
booth1 = create(:poll_booth) booth1 = create(:poll_booth)
@@ -246,7 +245,6 @@ describe "Admin shifts" do
end end
scenario "Destroy an officer" do scenario "Destroy an officer" do
poll = create(:poll)
booth = create(:poll_booth) booth = create(:poll_booth)
officer = create(:poll_officer) officer = create(:poll_officer)
@@ -261,7 +259,6 @@ describe "Admin shifts" do
end end
scenario "Empty" do scenario "Empty" do
poll = create(:poll)
booth = create(:poll_booth) booth = create(:poll_booth)
visit new_admin_booth_shift_path(booth) visit new_admin_booth_shift_path(booth)

View File

@@ -388,8 +388,6 @@ describe "Stats" do
end end
scenario "Participants by poll" do scenario "Participants by poll" do
oa = create(:poll_officer_assignment)
poll1 = create(:poll) poll1 = create(:poll)
poll2 = create(:poll) poll2 = create(:poll)

View File

@@ -1760,7 +1760,6 @@ describe "Budget Investments" do
scenario "Due to being unfeasible" do scenario "Due to being unfeasible" do
user = create(:user, :level_two) user = create(:user, :level_two)
investment = create(:budget_investment, :selected, heading: heading) investment = create(:budget_investment, :selected, heading: heading)
heading2 = create(:budget_heading, group: group)
ballot = create(:budget_ballot, user: user, budget: budget) ballot = create(:budget_ballot, user: user, budget: budget)
ballot.investments << investment ballot.investments << investment

View File

@@ -60,7 +60,6 @@ describe "Direct messages" do
end end
scenario "User not logged in" do scenario "User not logged in" do
sender = create(:user)
receiver = create(:user) receiver = create(:user)
visit new_user_direct_message_path(receiver) visit new_user_direct_message_path(receiver)

View File

@@ -39,12 +39,11 @@ describe "Answers" do
end end
scenario "Add video to answer" do scenario "Add video to answer" do
answer1 = create(:poll_question_answer, question: question) answer = create(:poll_question_answer, question: question)
answer2 = create(:poll_question_answer, question: question)
visit admin_question_path(question) visit admin_question_path(question)
within("#poll_question_answer_#{answer1.id}") do within("#poll_question_answer_#{answer.id}") do
click_link "Video list" click_link "Video list"
end end
@@ -55,7 +54,7 @@ describe "Answers" do
click_button "Save" click_button "Save"
within("#poll_question_answer_video_#{answer1.videos.last.id}") do within("#poll_question_answer_video_#{answer.videos.last.id}") do
expect(page).to have_content "Awesome project video" expect(page).to have_content "Awesome project video"
expect(page).to have_content "https://www.youtube.com/watch?v=123" expect(page).to have_content "https://www.youtube.com/watch?v=123"
end end

View File

@@ -50,8 +50,6 @@ describe "Voter" do
end end
scenario "Voting in booth", :js do scenario "Voting in booth", :js do
user = create(:user, :in_census)
login_through_form_as_officer(officer.user) login_through_form_as_officer(officer.user)
visit new_officing_residence_path visit new_officing_residence_path

View File

@@ -58,7 +58,6 @@ describe Poll::Shift do
it "creates and destroy corresponding officer_assignments" do it "creates and destroy corresponding officer_assignments" do
poll2 = create(:poll) poll2 = create(:poll)
poll3 = create(:poll)
booth_assignment1 = create(:poll_booth_assignment, poll: poll, booth: booth) booth_assignment1 = create(:poll_booth_assignment, poll: poll, booth: booth)
booth_assignment2 = create(:poll_booth_assignment, poll: poll2, booth: booth) booth_assignment2 = create(:poll_booth_assignment, poll: poll2, booth: booth)

View File

@@ -183,7 +183,6 @@ describe Signature do
it "creates a user with that document number" do it "creates a user with that document number" do
create(:geozone, census_code: "01") create(:geozone, census_code: "01")
signature = create(:signature, document_number: "12345678Z") signature = create(:signature, document_number: "12345678Z")
proposal = signature.signable
signature.verify signature.verify