Permalink
Browse files

Enable & auto-correct Style/EmptyLines cop

  • Loading branch information...
deivid-rodriguez committed May 8, 2017
1 parent 3d10e14 commit d0b93ab4216f7edaebe5ef6f97b6175dc671921a
View
@@ -17,6 +17,9 @@ AllCops:
StyleGuideCopsOnly: false
Style/EmptyLines:
Enabled: true
Style/ExtraSpacing:
Enabled: true
@@ -10,7 +10,6 @@ module Authorization
Auth = Authorization
# Active Admin's default authorization adapter. This adapter returns true
# for all requests to `#authorized?`. It should be the starting point for
# implementing your own authorization adapter.
@@ -19,7 +18,6 @@ module Authorization
class AuthorizationAdapter
attr_reader :resource, :user
# Initialize a new authorization adapter. This happens on each and
# every request to a controller.
#
@@ -54,7 +52,6 @@ def authorized?(action, subject = nil)
true
end
# A hook method for authorization libraries to scope the collection. By
# default, we just return the same collection. The returned scope is used
# as the starting point for all queries to the db in the controller.
@@ -59,7 +59,6 @@ def active_admin_namespace
end
helper_method :active_admin_namespace
ACTIVE_ADMIN_ACTIONS = [:index, :show, :new, :create, :edit, :update, :destroy]
# Determine which layout to use.
@@ -38,7 +38,6 @@ def authorized?(action, subject = nil)
active_admin_authorization.authorized?(action, subject)
end
# Authorize the action and subject. Available in the controller
# as well as all the views. If the action is not allowd, it raises
# an ActiveAdmin::AccessDenied exception.
@@ -41,7 +41,6 @@ def default_input_type(method, options = {})
end
end
# This module is included into the view
module ViewHelper
@@ -70,7 +70,6 @@ def default_settings
end
# Allows you to define child classes that should receive the same
# settings, as well as the same default values.
#
@@ -86,8 +86,6 @@ def find_or_create(menu_name)
@menus[menu_name] ||= ActiveAdmin::Menu.new
end
end
end
@@ -102,7 +102,6 @@ def route_name(resource_path_name, options = {})
route.compact.join('_').to_sym # :admin_category_posts_path
end
# @return params to pass to instance path
def route_instance_params(instance)
if nested?
@@ -45,7 +45,6 @@ def collection
end
end
# Does the actual work of retrieving the current collection from the db.
# This is a great method to override if you would like to perform
# some additional db # work before your controller returns and
@@ -60,7 +59,6 @@ def find_collection(options = {})
collection
end
# Override this method in your controllers to modify the start point
# of our searches and index.
#
@@ -103,7 +101,6 @@ def find_resource
scoped_collection.send method_for_find, params[:id]
end
# Builds, memoize and authorize a new instance of the resource. The
# actual work of building the new instance is delegated to the
# #build_new_resource method.
@@ -180,12 +177,10 @@ def destroy_resource(object)
end
end
#
# Collection Helper Methods
#
# Gives the authorization library a change to pre-scope the collection.
#
# In the case of the CanCan adapter, it calls `#accessible_by` on
@@ -12,7 +12,6 @@ class Scopes < ActiveAdmin::Component
include ActiveAdmin::ScopeChain
include ::ActiveAdmin::Helpers::Collection
def default_class_name
"scopes table_tools_segmented_control"
end
@@ -14,7 +14,6 @@ def build(namespace, menu)
build_utility_navigation
end
def build_site_title
insert_tag view_factory.site_title, @namespace
end
@@ -89,7 +89,6 @@ def title(method = nil, &block)
@title
end
# Setter method for the configuration of the body
#
def body(method = nil, &block)
@@ -23,5 +23,4 @@
end
end
end
@@ -38,7 +38,6 @@ def destroy_all?
true
end
def scope
Pundit.policy_scope!(user, record.class)
end
@@ -75,5 +75,4 @@ def my_subclassed_view
end
end
end
@@ -13,7 +13,6 @@
let(:post_config){ ActiveAdmin.register Post do belongs_to :user end }
let(:belongs_to){ post_config.belongs_to_config }
it "should have an owner" do
expect(belongs_to.owner).to eq post_config
end
View
@@ -1,6 +1,5 @@
require 'rails_helper'
module MockModuleToInclude
def self.included(dsl)
end
@@ -24,7 +23,6 @@ def self.included(dsl)
end
describe '#action_item' do
before do
@default_items_count = resource_config.action_items.size
@@ -128,7 +128,6 @@ module ActiveAdmin
end
end # accessing ancestory
describe "#id" do
it "should be normalized" do
expect(MenuItem.new(id: "Foo Bar").id).to eq "foo_bar"
@@ -61,7 +61,6 @@
end
end
describe "#fetch_menu" do
let(:namespace){ ActiveAdmin::Namespace.new(application, :admin) }
View
@@ -71,7 +71,6 @@ def config(options = {})
expect(config.belongs_to?).to eq false
end
it "should not have any action_items" do
expect(config.action_items?).to eq false
end
@@ -20,7 +20,6 @@ module ActiveAdmin
expect(resource_config.ordering.size).to eq(1)
end
it "should allow to setup custom ordering class" do
MyOrderClause = Class.new(ActiveAdmin::OrderClause)
dsl.run_registration_block do
@@ -217,7 +217,6 @@ def call_after_destroy(obj); end
end
end
describe "performing batch_action" do
let(:batch_action) { ActiveAdmin::BatchAction.new :flag, "Flag", &batch_action_block }
let(:batch_action_block) { proc { } }
@@ -49,7 +49,6 @@ def config(options = {})
end
end
describe "controller name" do
it "should return a namespaced controller name" do
expect(config.controller_name).to eq "Admin::CategoriesController"
@@ -146,7 +145,6 @@ def config(options = {})
end
end
describe "sort order" do
class MockResource
end
@@ -45,7 +45,6 @@
end
RSpec.describe ActiveAdmin::Settings::Inheritance do
subject do
@@ -87,7 +87,6 @@
end
end
describe "#render_or_call_method_or_proc_on" do
@@ -235,7 +235,6 @@
end # describe rendering rows
end # with a collection
context "when using a single Hash" do
let(:table) do
render_arbre_component nil, helpers do
@@ -81,7 +81,6 @@
expect(cols.children.size).to eq 4
end
(0..2).to_a.each do |index|
it "should have column #{index + 1} with width 49% and margin 2%" do
expect(cols.children[index].attr(:style)).to eq "width: 23.5%; margin-right: 2%;"
@@ -93,7 +92,6 @@
end
end
describe "Column Spans" do
let(:cols) do
render_arbre_component do
@@ -73,6 +73,4 @@ def build_title(namespace)
end
end
View
@@ -23,7 +23,6 @@ namespace :spec do
end
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:cucumber) do |t|

0 comments on commit d0b93ab

Please sign in to comment.