Fix all rubocop Rails/PluralizationGrammar issues and remove the file list form rubocop_todo file
This commit is contained in:
@@ -130,15 +130,6 @@ Rails/OutputSafety:
|
||||
- 'app/helpers/users_helper.rb'
|
||||
- 'app/helpers/valuation_helper.rb'
|
||||
|
||||
# Offense count: 6
|
||||
# Cop supports --auto-correct.
|
||||
Rails/PluralizationGrammar:
|
||||
Exclude:
|
||||
- 'spec/features/admin/banners_spec.rb'
|
||||
- 'spec/features/debates_spec.rb'
|
||||
- 'spec/features/proposals_spec.rb'
|
||||
- 'spec/models/residence_spec.rb'
|
||||
|
||||
# Offense count: 11
|
||||
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
||||
# SupportedStyles: strict, flexible
|
||||
|
||||
@@ -4,7 +4,7 @@ describe CommentsController do
|
||||
|
||||
describe 'POST create' do
|
||||
before(:each) do
|
||||
@process = create(:legislation_process, debate_start_date: Date.current - 3.day, debate_end_date: Date.current + 2.days)
|
||||
@process = create(:legislation_process, debate_start_date: Date.current - 3.days, debate_end_date: Date.current + 2.days)
|
||||
@question = create(:legislation_question, process: @process, title: "Question 1")
|
||||
@user = create(:user, :level_two)
|
||||
@unverified_user = create(:user)
|
||||
|
||||
@@ -4,7 +4,7 @@ describe Legislation::AnnotationsController do
|
||||
|
||||
describe 'POST create' do
|
||||
before(:each) do
|
||||
@process = create(:legislation_process, allegations_start_date: Date.current - 3.day, allegations_end_date: Date.current + 2.days)
|
||||
@process = create(:legislation_process, allegations_start_date: Date.current - 3.days, allegations_end_date: Date.current + 2.days)
|
||||
@draft_version = create(:legislation_draft_version, :published, process: @process, title: "Version 1")
|
||||
@final_version = create(:legislation_draft_version, :published, :final_version, process: @process, title: "Final version")
|
||||
@user = create(:user, :level_two)
|
||||
|
||||
@@ -4,7 +4,7 @@ describe Legislation::AnswersController do
|
||||
|
||||
describe 'POST create' do
|
||||
before(:each) do
|
||||
@process = create(:legislation_process, debate_start_date: Date.current - 3.day, debate_end_date: Date.current + 2.days)
|
||||
@process = create(:legislation_process, debate_start_date: Date.current - 3.days, debate_end_date: Date.current + 2.days)
|
||||
@question = create(:legislation_question, process: @process, title: "Question 1")
|
||||
@question_option = create(:legislation_question_option, question: @question, value: "Yes")
|
||||
@user = create(:user, :level_two)
|
||||
|
||||
@@ -632,7 +632,7 @@ FactoryGirl.define do
|
||||
end_date Date.current + 8.days
|
||||
debate_start_date Date.current + 2.days
|
||||
debate_end_date Date.current + 4.days
|
||||
draft_publication_date Date.current + 5.day
|
||||
draft_publication_date Date.current + 5.days
|
||||
allegations_start_date Date.current + 5.days
|
||||
allegations_end_date Date.current + 7.days
|
||||
result_publication_date Date.current + 8.days
|
||||
@@ -643,7 +643,7 @@ FactoryGirl.define do
|
||||
end_date Date.current - 2.days
|
||||
debate_start_date Date.current - 12.days
|
||||
debate_end_date Date.current - 9.days
|
||||
draft_publication_date Date.current - 8.day
|
||||
draft_publication_date Date.current - 8.days
|
||||
allegations_start_date Date.current - 8.days
|
||||
allegations_end_date Date.current - 4.days
|
||||
result_publication_date Date.current - 2.days
|
||||
@@ -653,7 +653,7 @@ FactoryGirl.define do
|
||||
start_date Date.current - 5.days
|
||||
end_date Date.current + 5.days
|
||||
debate_start_date Date.current - 5.days
|
||||
debate_end_date Date.current + 1.days
|
||||
debate_end_date Date.current + 1.day
|
||||
draft_publication_date Date.current + 1.day
|
||||
allegations_start_date Date.current + 2.days
|
||||
allegations_end_date Date.current + 3.days
|
||||
|
||||
@@ -29,7 +29,7 @@ feature 'Admin banners magement' do
|
||||
target_url: "http://www.url.com",
|
||||
style: "banner-style.banner-three",
|
||||
image: "banner-img.banner-three",
|
||||
post_started_at: (Time.current - 1.days),
|
||||
post_started_at: (Time.current - 1.day),
|
||||
post_ended_at: (Time.current + 10.days))
|
||||
|
||||
@banner4 = create(:banner, title: "Banner number four",
|
||||
|
||||
@@ -192,7 +192,7 @@ feature 'Commenting legislation questions' do
|
||||
end
|
||||
|
||||
scenario "Can't create comments if debate phase is not open", :js do
|
||||
process.update_attributes(debate_start_date: Date.current - 2.days, debate_end_date: Date.current - 1.days)
|
||||
process.update_attributes(debate_start_date: Date.current - 2.days, debate_end_date: Date.current - 1.day)
|
||||
login_as(user)
|
||||
|
||||
visit legislation_process_question_path(legislation_question.process, legislation_question)
|
||||
|
||||
@@ -629,7 +629,7 @@ feature 'Debates' do
|
||||
click_link "Advanced search"
|
||||
select "Customized", from: "js-advanced-search-date-min"
|
||||
fill_in "advanced_search_date_min", with: 7.days.ago
|
||||
fill_in "advanced_search_date_max", with: 1.days.ago
|
||||
fill_in "advanced_search_date_max", with: 1.day.ago
|
||||
click_button "Filter"
|
||||
|
||||
within("#debates") do
|
||||
@@ -709,7 +709,7 @@ feature 'Debates' do
|
||||
|
||||
select "Customized", from: "js-advanced-search-date-min"
|
||||
fill_in "advanced_search_date_min", with: 7.days.ago
|
||||
fill_in "advanced_search_date_max", with: 1.days.ago
|
||||
fill_in "advanced_search_date_max", with: 1.day.ago
|
||||
click_button "Filter"
|
||||
|
||||
within "#js-advanced-search" do
|
||||
|
||||
@@ -3,7 +3,7 @@ require 'rails_helper'
|
||||
feature 'Legislation' do
|
||||
context 'process debate page' do
|
||||
before(:each) do
|
||||
@process = create(:legislation_process, debate_start_date: Date.current - 3.day, debate_end_date: Date.current + 2.days)
|
||||
@process = create(:legislation_process, debate_start_date: Date.current - 3.days, debate_end_date: Date.current + 2.days)
|
||||
create(:legislation_question, process: @process, title: "Question 1")
|
||||
create(:legislation_question, process: @process, title: "Question 2")
|
||||
create(:legislation_question, process: @process, title: "Question 3")
|
||||
|
||||
@@ -1025,7 +1025,7 @@ feature 'Proposals' do
|
||||
click_link "Advanced search"
|
||||
select "Customized", from: "js-advanced-search-date-min"
|
||||
fill_in "advanced_search_date_min", with: 7.days.ago
|
||||
fill_in "advanced_search_date_max", with: 1.days.ago
|
||||
fill_in "advanced_search_date_max", with: 1.day.ago
|
||||
click_button "Filter"
|
||||
|
||||
expect(page).to have_content("There are 2 citizen proposals")
|
||||
@@ -1108,7 +1108,7 @@ feature 'Proposals' do
|
||||
|
||||
select "Customized", from: "js-advanced-search-date-min"
|
||||
fill_in "advanced_search_date_min", with: 7.days.ago.to_date
|
||||
fill_in "advanced_search_date_max", with: 1.days.ago.to_date
|
||||
fill_in "advanced_search_date_max", with: 1.day.ago.to_date
|
||||
click_button "Filter"
|
||||
|
||||
expect(page).to have_content("citizen proposals cannot be found")
|
||||
|
||||
@@ -71,7 +71,7 @@ RSpec.describe Legislation::Process, type: :model do
|
||||
describe "filter scopes" do
|
||||
before(:each) do
|
||||
@process_1 = create(:legislation_process, start_date: Date.current - 2.days, end_date: Date.current + 1.day)
|
||||
@process_2 = create(:legislation_process, start_date: Date.current + 1.days, end_date: Date.current + 3.days)
|
||||
@process_2 = create(:legislation_process, start_date: Date.current + 1.day, end_date: Date.current + 3.days)
|
||||
@process_3 = create(:legislation_process, start_date: Date.current - 4.days, end_date: Date.current - 3.days)
|
||||
end
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ describe :officer do
|
||||
|
||||
poll_1 = create(:poll, ends_at: 1.day.ago)
|
||||
poll_2 = create(:poll, ends_at: 10.days.from_now)
|
||||
poll_3 = create(:poll, ends_at: 10.day.ago)
|
||||
poll_3 = create(:poll, ends_at: 10.days.ago)
|
||||
|
||||
[poll_1, poll_2, poll_3].each do |p|
|
||||
create(:poll_officer_assignment, officer: officer, booth_assignment: create(:poll_booth_assignment, poll: p))
|
||||
@@ -108,7 +108,7 @@ describe :officer do
|
||||
|
||||
poll_1 = create(:poll, ends_at: 1.day.ago)
|
||||
poll_2 = create(:poll, ends_at: 10.days.from_now)
|
||||
poll_3 = create(:poll, ends_at: 10.day.ago)
|
||||
poll_3 = create(:poll, ends_at: 10.days.ago)
|
||||
|
||||
[poll_1, poll_2, poll_3].each do |p|
|
||||
create(:poll_officer_assignment, officer: officer, booth_assignment: create(:poll_booth_assignment, poll: p), final: true)
|
||||
|
||||
@@ -25,7 +25,7 @@ describe Verification::Residence do
|
||||
end
|
||||
|
||||
it "should validate user has allowed age" do
|
||||
residence = Verification::Residence.new({"date_of_birth(3i)"=>"1", "date_of_birth(2i)"=>"1", "date_of_birth(1i)"=>"#{5.year.ago.year}"})
|
||||
residence = Verification::Residence.new({"date_of_birth(3i)"=>"1", "date_of_birth(2i)"=>"1", "date_of_birth(1i)"=>"#{5.years.ago.year}"})
|
||||
expect(residence).to_not be_valid
|
||||
expect(residence.errors[:date_of_birth]).to include("You don't have the required age to participate")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user