Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

Improve by group #9

Merged
merged 8 commits into from
Apr 6, 2018
Merged

Improve by group #9

merged 8 commits into from
Apr 6, 2018

Conversation

mnoack
Copy link
Contributor

@mnoack mnoack commented Mar 28, 2018

Just some cleanups in preparation for breaking changes

models: RightOn::Right.create!(name: 'models', controller: 'models'),
models_index: RightOn::Right.create!(name: 'models#index', controller: 'models', action: 'index'),
models_change: RightOn::Right.create!(name: 'models#change', controller: 'models', action: 'change'),
models_view: RightOn::Right.create!(name: 'models#view', controller: 'models', action: 'view')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Line is too long. [104/80]

users: RightOn::Right.create!(name: 'users', controller: 'users'),
models: RightOn::Right.create!(name: 'models', controller: 'models'),
models_index: RightOn::Right.create!(name: 'models#index', controller: 'models', action: 'index'),
models_change: RightOn::Right.create!(name: 'models#change', controller: 'models', action: 'change'),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Line is too long. [107/80]

{
users: RightOn::Right.create!(name: 'users', controller: 'users'),
models: RightOn::Right.create!(name: 'models', controller: 'models'),
models_index: RightOn::Right.create!(name: 'models#index', controller: 'models', action: 'index'),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Line is too long. [106/80]

RightOn::Right.delete_all
{
users: RightOn::Right.create!(name: 'users', controller: 'users'),
models: RightOn::Right.create!(name: 'models', controller: 'models'),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Line is too long. [89/80]

def self.various_rights_with_actions
RightOn::Right.delete_all
{
users: RightOn::Right.create!(name: 'users', controller: 'users'),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Line is too long. [88/80]

expect(@users.allowed?(:controller => 'users', :action => 'index')).to eq true
expect(@users.allowed?(:controller => 'users', :action => 'edit' )).to eq true
expect(@users.allowed?(:controller => 'users', :action => 'hello')).to eq true
expect(users.allowed?(:controller => 'users', :action => 'index')).to eq true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the new Ruby 1.9 hash syntax.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Line is too long. [81/80]

'admin' => [@users]
)
expect(other.sensible_name).to eq 'Models'
expect(index.sensible_name).to eq 'Models - Index'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

'general' => [@other, @index, @view, @change],
'admin' => [@users]
)
expect(other.sensible_name).to eq 'Models'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

expect(@index.sensible_name).to eq 'Models - Index'
end
expect(other.to_s).to eq 'models'
expect(index.to_s).to eq 'models#index'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

expect(@other.sensible_name).to eq 'Models'
expect(@index.sensible_name).to eq 'Models - Index'
end
expect(other.to_s).to eq 'models'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 91.72% when pulling 62eca49 on improve-by-group into 0beba65 on master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 91.72% when pulling 62eca49 on improve-by-group into 0beba65 on master.

@coveralls
Copy link

coveralls commented Mar 28, 2018

Coverage Status

Coverage increased (+0.1%) to 91.875% when pulling fbad116 on improve-by-group into 7a1749f on master.

* master:
  Release the hounds! (support single quotes)
  Test against newer ruby versions
  Use through to simplify
  Apply same logic for long line above
  Handle long line and add test to ensure this works
  Remove duplicate specs
  Remove rails 4 support due to change
  [TT-3352] Ensure roles currently in use cannot be deleted

# Conflicts:
#	CHANGELOG.md
models: RightOn::Right.create!(name: 'models', controller: 'models'),
models_index: RightOn::Right.create!(name: 'models#index', controller: 'models', action: 'index'),
models_change: RightOn::Right.create!(name: 'models#change', controller: 'models', action: 'change'),
models_view: RightOn::Right.create!(name: 'models#view', controller: 'models', action: 'view')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [104/80]

users: RightOn::Right.create!(name: 'users', controller: 'users'),
models: RightOn::Right.create!(name: 'models', controller: 'models'),
models_index: RightOn::Right.create!(name: 'models#index', controller: 'models', action: 'index'),
models_change: RightOn::Right.create!(name: 'models#change', controller: 'models', action: 'change'),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [107/80]

{
users: RightOn::Right.create!(name: 'users', controller: 'users'),
models: RightOn::Right.create!(name: 'models', controller: 'models'),
models_index: RightOn::Right.create!(name: 'models#index', controller: 'models', action: 'index'),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [106/80]

RightOn::Right.delete_all
{
users: RightOn::Right.create!(name: 'users', controller: 'users'),
models: RightOn::Right.create!(name: 'models', controller: 'models'),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [89/80]

def self.various_rights_with_actions
RightOn::Right.delete_all
{
users: RightOn::Right.create!(name: 'users', controller: 'users'),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [88/80]

expect(@other.allowed?(edit_action )).to eq false # as specific action exists
expect(@other.allowed?(hello_action)).to eq true # as hello isn't defined
expect(other.allowed?(index_action)).to eq false # as specific action exists
expect(other.allowed?(edit_action )).to eq false # as specific action exists

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/SpaceInsideParens: Space inside parentheses detected.

expect(@users.allowed?(:controller => 'users', :action => 'hello')).to eq true
expect(users.allowed?(:controller => 'users', :action => 'index')).to eq true
expect(users.allowed?(:controller => 'users', :action => 'edit' )).to eq true
expect(users.allowed?(:controller => 'users', :action => 'hello')).to eq true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
Metrics/LineLength: Line is too long. [81/80]

expect(@users.allowed?(:controller => 'users', :action => 'edit' )).to eq true
expect(@users.allowed?(:controller => 'users', :action => 'hello')).to eq true
expect(users.allowed?(:controller => 'users', :action => 'index')).to eq true
expect(users.allowed?(:controller => 'users', :action => 'edit' )).to eq true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
Layout/SpaceInsideParens: Space inside parentheses detected.
Metrics/LineLength: Line is too long. [81/80]

expect(@users.allowed?(:controller => 'users', :action => 'index')).to eq true
expect(@users.allowed?(:controller => 'users', :action => 'edit' )).to eq true
expect(@users.allowed?(:controller => 'users', :action => 'hello')).to eq true
expect(users.allowed?(:controller => 'users', :action => 'index')).to eq true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
Metrics/LineLength: Line is too long. [81/80]

@@ -0,0 +1,22 @@
require 'spec_helper'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.

before do
@new_right = RightOn::Right.new(:name => "tickets@destroy", :controller => "tickets", :action => "destroy")
@new_right = RightOn::Right.new(name: 'tickets@destroy', controller: 'tickets', action: 'destroy')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [102/80]

@mnoack mnoack merged commit a9a15e1 into master Apr 6, 2018
@alvinypyim alvinypyim deleted the improve-by-group branch April 10, 2018 00:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants