Add and apply rubocop rules for empty lines

We were very inconsistent regarding these rules.

Personally I prefer no empty lines around blocks, clases, etc... as
recommended by the Ruby style guide [1], and they're the default values
in rubocop, so those are the settings I'm applying.

The exception is the `private` access modifier, since we were leaving
empty lines around it most of the time. That's the default rubocop rule
as well. Personally I don't have a strong preference about this one.


[1] https://rubystyle.guide/#empty-lines-around-bodies
This commit is contained in:
Javi Martín
2019-10-24 15:48:37 +02:00
parent b6750e8f17
commit db97f9d08c
585 changed files with 24 additions and 1645 deletions

View File

@@ -1,7 +1,6 @@
require "rails_helper"
describe "DocumentVerifications" do
before do
login_as_manager
end
@@ -17,7 +16,6 @@ describe "DocumentVerifications" do
end
scenario "Verifying a level 2 user displays the verification form" do
user = create(:user, :level_two)
visit management_document_verifications_path
@@ -34,11 +32,8 @@ describe "DocumentVerifications" do
end
describe "Verifying througth Census" do
context "Census API" do
scenario "Verifying a user which does not exist and is not in the census shows an error" do
expect_any_instance_of(Verification::Management::Document).to receive(:in_census?).
and_return(false)
@@ -50,18 +45,15 @@ describe "DocumentVerifications" do
end
scenario "Verifying a user which does exists in the census but not in the db redirects allows sending an email" do
visit management_document_verifications_path
fill_in "document_verification_document_number", with: "12345678Z"
click_button "Check document"
expect(page).to have_content "Please introduce the email used on the account"
end
end
context "Remote Census API" do
before do
Setting["feature.remote_census"] = true
Setting["remote_census.request.date_of_birth"] = "some.value"
@@ -74,7 +66,6 @@ describe "DocumentVerifications" do
end
scenario "Verifying a user which does not exist and is not in the census shows an error" do
expect_any_instance_of(Verification::Management::Document).to receive(:in_census?).
and_return(false)
@@ -88,7 +79,6 @@ describe "DocumentVerifications" do
end
scenario "Verifying a user which does exists in the census but not in the db redirects allows sending an email" do
visit management_document_verifications_path
fill_in "document_verification_document_number", with: "12345678Z"
select_date "31-December-1980", from: "document_verification_date_of_birth"
@@ -97,13 +87,10 @@ describe "DocumentVerifications" do
expect(page).to have_content "Please introduce the email used on the account"
end
end
end
scenario "Document number is format-standarized" do
visit management_document_verifications_path
fill_in "document_verification_document_number", with: "12345 - h"
click_button "Check document"
@@ -120,5 +107,4 @@ describe "DocumentVerifications" do
expect(page).to have_content "You don't have the required age to verify your account."
end
end