Apply Rspec/LetSetup rubocop rule

This commit is contained in:
Javi Martín
2019-06-23 01:34:22 +02:00
parent 58ba517717
commit 044eabd7ef
8 changed files with 34 additions and 31 deletions

View File

@@ -186,11 +186,11 @@ describe "Notifications" do
let!(:user2) { create(:user) }
let!(:user3) { create(:user) }
let!(:proposal_notification) { create(:proposal_notification) }
let!(:notification1) { create(:notification, notifiable: proposal_notification, user: user1) }
let!(:notification2) { create(:notification, notifiable: proposal_notification, user: user2) }
let!(:notification3) { create(:notification, notifiable: proposal_notification, user: user3) }
before do
create(:notification, notifiable: proposal_notification, user: user1)
create(:notification, notifiable: proposal_notification, user: user2)
create(:notification, notifiable: proposal_notification, user: user3)
reset_mailer
Delayed::Worker.delay_jobs = true
end

View File

@@ -63,12 +63,13 @@ describe "Poll Votation Type" do
let(:poll_current) { create(:poll, :current) }
let(:question) { create(:poll_question_multiple, poll: poll_current) }
let!(:answer1) { create(:poll_question_answer, question: question, title: "answer_1") }
let!(:answer2) { create(:poll_question_answer, question: question, title: "answer_2") }
let!(:answer3) { create(:poll_question_answer, question: question, title: "answer_3") }
let!(:answer4) { create(:poll_question_answer, question: question, title: "answer_4") }
let!(:answer5) { create(:poll_question_answer, question: question, title: "answer_5") }
before do
create(:poll_question_answer, question: question, title: "answer_2")
create(:poll_question_answer, question: question, title: "answer_3")
create(:poll_question_answer, question: question, title: "answer_4")
create(:poll_question_answer, question: question, title: "answer_5")
login_as(user)
end
@@ -152,13 +153,14 @@ describe "Poll Votation Type" do
let(:user) { create(:user, :verified) }
let(:poll_current) { create(:poll, :current) }
let(:question) { create(:poll_question_prioritized, poll: poll_current) }
let!(:answer1) { create(:poll_question_answer, question: question, title: "answer_1") }
let!(:answer2) { create(:poll_question_answer, question: question, title: "answer_2") }
let!(:answer3) { create(:poll_question_answer, question: question, title: "answer_3") }
let!(:answer4) { create(:poll_question_answer, question: question, title: "answer_4") }
let!(:answer5) { create(:poll_question_answer, question: question, title: "answer_5") }
before do
create(:poll_question_answer, question: question, title: "answer_1")
create(:poll_question_answer, question: question, title: "answer_2")
create(:poll_question_answer, question: question, title: "answer_3")
create(:poll_question_answer, question: question, title: "answer_4")
create(:poll_question_answer, question: question, title: "answer_5")
login_as(user)
end
@@ -218,12 +220,13 @@ describe "Poll Votation Type" do
let(:poll_current) { create(:poll, :current) }
let(:question) { create(:poll_question_positive_open, poll: poll_current) }
let!(:answer1) { create(:poll_question_answer, question: question, title: "answer_1") }
let!(:answer2) { create(:poll_question_answer, question: question, title: "answer_2") }
let!(:answer3) { create(:poll_question_answer, question: question, title: "answer_3") }
let!(:answer4) { create(:poll_question_answer, question: question, title: "answer_4") }
let!(:answer5) { create(:poll_question_answer, question: question, title: "answer_5") }
before do
create(:poll_question_answer, question: question, title: "answer_2")
create(:poll_question_answer, question: question, title: "answer_3")
create(:poll_question_answer, question: question, title: "answer_4")
create(:poll_question_answer, question: question, title: "answer_5")
login_as(user)
end
@@ -324,13 +327,14 @@ describe "Poll Votation Type" do
let(:user) { create(:user, :verified) }
let(:poll_current) { create(:poll, :current) }
let(:question) { create(:poll_question_answer_set_open, poll: poll_current) }
let!(:answer1) { create(:poll_question_answer, question: question, title: "answer_1") }
let!(:answer2) { create(:poll_question_answer, question: question, title: "answer_2") }
let!(:answer3) { create(:poll_question_answer, question: question, title: "answer_3") }
let!(:answer4) { create(:poll_question_answer, question: question, title: "answer_4") }
let!(:answer5) { create(:poll_question_answer, question: question, title: "answer_5") }
before do
create(:poll_question_answer, question: question, title: "answer_1")
create(:poll_question_answer, question: question, title: "answer_2")
create(:poll_question_answer, question: question, title: "answer_3")
create(:poll_question_answer, question: question, title: "answer_4")
create(:poll_question_answer, question: question, title: "answer_5")
login_as(user)
end

View File

@@ -83,7 +83,7 @@ describe "Voter" do
end
context "The person has decided not to vote at this time" do
let!(:user) { create(:user, :in_census) }
before { create(:user, :in_census) }
scenario "Show not to vote at this time button" do
login_through_form_as_officer(officer.user)