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:
@@ -1,7 +1,6 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe Admin::Api::StatsController do
|
||||
|
||||
describe "GET index" do
|
||||
let(:user) { create(:administrator).user }
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe ApplicationController do
|
||||
|
||||
describe "#current_budget" do
|
||||
|
||||
it "returns the last budget that is not in draft phase" do
|
||||
create(:budget, :finished, created_at: 2.years.ago, name: "Old")
|
||||
create(:budget, :accepting, created_at: 1.year.ago, name: "Previous")
|
||||
@@ -13,7 +11,5 @@ describe ApplicationController do
|
||||
budget = subject.instance_eval { current_budget }
|
||||
expect(budget.name).to eq("Current")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe Budgets::Ballot::LinesController do
|
||||
|
||||
describe "#load_budget" do
|
||||
|
||||
it "raises an error if budget slug is not found" do
|
||||
controller.params[:budget_id] = "wrong_budget"
|
||||
|
||||
@@ -19,7 +17,5 @@ describe Budgets::Ballot::LinesController do
|
||||
controller.send(:load_budget)
|
||||
end.to raise_error ActiveRecord::RecordNotFound
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe CommentsController do
|
||||
|
||||
describe "POST create" do
|
||||
let(:legal_process) do
|
||||
create(:legislation_process, debate_start_date: Date.current - 3.days,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe HasFilters do
|
||||
|
||||
class FakeController < ActionController::Base; end
|
||||
|
||||
controller(FakeController) do
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe HasOrders do
|
||||
|
||||
class FakeController < ActionController::Base; end
|
||||
|
||||
controller(FakeController) do
|
||||
|
||||
@@ -2,15 +2,12 @@ require "rails_helper"
|
||||
include RemotelyTranslatable
|
||||
|
||||
describe RemotelyTranslatable do
|
||||
|
||||
before do
|
||||
Setting["feature.remote_translations"] = true
|
||||
end
|
||||
|
||||
describe "#detect_remote_translations" do
|
||||
|
||||
describe "Should detect remote_translations" do
|
||||
|
||||
it "When collections and featured_proposals are not defined in current locale" do
|
||||
proposals = create_list(:proposal, 3)
|
||||
featured_proposals = create_featured_proposals
|
||||
@@ -49,7 +46,6 @@ describe RemotelyTranslatable do
|
||||
expect(detect_remote_translations(widget_feeds).count).to eq 9
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
it "When defined in current locale should not detect remote_translations" do
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe DebatesController do
|
||||
|
||||
describe "POST create" do
|
||||
before do
|
||||
InvisibleCaptcha.timestamp_enabled = false
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe InstallationController, type: :request do
|
||||
|
||||
describe "consul.json" do
|
||||
let(:test_feature_settings) do
|
||||
{
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe Legislation::AnnotationsController do
|
||||
|
||||
describe "POST create" do
|
||||
|
||||
let(:legal_process) do
|
||||
create(:legislation_process, allegations_start_date: Date.current - 3.days,
|
||||
allegations_end_date: Date.current + 2.days)
|
||||
@@ -162,6 +160,5 @@ describe Legislation::AnnotationsController do
|
||||
expect(annotation.reload.comments_count).to eq(2)
|
||||
expect(annotation.comments.last.body).to eq("una anotacion")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe Legislation::AnswersController do
|
||||
|
||||
describe "POST create" do
|
||||
|
||||
let(:legal_process) do
|
||||
create(:legislation_process, debate_start_date: Date.current - 3.days,
|
||||
debate_end_date: Date.current + 2.days)
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe Management::BaseController do
|
||||
|
||||
describe "managed_user" do
|
||||
|
||||
it "returns existent user with session document info if present" do
|
||||
session[:document_type] = "1"
|
||||
session[:document_number] = "333333333E"
|
||||
@@ -23,5 +21,4 @@ describe Management::BaseController do
|
||||
expect(managed_user.document_number).to eq "333333333E"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe Management::SessionsController do
|
||||
|
||||
describe "Sign in" do
|
||||
|
||||
it "denies access if wrong manager credentials" do
|
||||
allow_any_instance_of(ManagerAuthenticator).to receive(:auth).and_return(false)
|
||||
get :create, params: { login: "nonexistent", clave_usuario: "wrong" }
|
||||
@@ -66,5 +64,4 @@ describe Management::SessionsController do
|
||||
expect(response).to be_redirect
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe Management::UsersController do
|
||||
|
||||
describe "logout" do
|
||||
it "removes user data from the session" do
|
||||
session[:manager] = { user_key: "31415926", date: "20151031135905", login: "JJB033" }
|
||||
@@ -16,5 +15,4 @@ describe Management::UsersController do
|
||||
expect(response).to be_redirect
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe PagesController do
|
||||
|
||||
describe "Static pages" do
|
||||
it "includes a privacy page" do
|
||||
get :show, params: { id: :privacy }
|
||||
@@ -20,7 +19,6 @@ describe PagesController do
|
||||
end
|
||||
|
||||
describe "More info pages" do
|
||||
|
||||
it "includes a more info page" do
|
||||
get :show, params: { id: "help/index" }
|
||||
expect(response).to be_ok
|
||||
@@ -48,5 +46,4 @@ describe PagesController do
|
||||
expect(response).to be_missing
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe RelatedContentsController do
|
||||
|
||||
describe "#score" do
|
||||
it "raises an error if related content does not exist" do
|
||||
controller.params[:id] = 0
|
||||
@@ -11,5 +10,4 @@ describe RelatedContentsController do
|
||||
end.to raise_error ActiveRecord::RecordNotFound
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe RemoteTranslationsController do
|
||||
|
||||
describe "POST create", :delay_jobs do
|
||||
let(:debate) { create(:debate) }
|
||||
|
||||
@@ -42,6 +41,5 @@ describe RemoteTranslationsController do
|
||||
|
||||
expect(subject).to redirect_to("any_path")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe Users::RegistrationsController do
|
||||
|
||||
describe "POST check_username" do
|
||||
|
||||
before do
|
||||
request.env["devise.mapping"] = Devise.mappings[:user]
|
||||
end
|
||||
@@ -28,7 +26,5 @@ describe Users::RegistrationsController do
|
||||
expect(data[:message]).to eq I18n.t("devise_views.users.registrations.new.username_is_not_available")
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user