-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
* Allows us to split ByGroup later
spec/support/bootstrap.rb
Outdated
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') |
There was a problem hiding this comment.
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]
spec/support/bootstrap.rb
Outdated
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'), |
There was a problem hiding this comment.
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]
spec/support/bootstrap.rb
Outdated
{ | ||
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'), |
There was a problem hiding this comment.
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]
spec/support/bootstrap.rb
Outdated
RightOn::Right.delete_all | ||
{ | ||
users: RightOn::Right.create!(name: 'users', controller: 'users'), | ||
models: RightOn::Right.create!(name: 'models', controller: 'models'), |
There was a problem hiding this comment.
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]
spec/support/bootstrap.rb
Outdated
def self.various_rights_with_actions | ||
RightOn::Right.delete_all | ||
{ | ||
users: RightOn::Right.create!(name: 'users', controller: 'users'), |
There was a problem hiding this comment.
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]
spec/right_on_spec.rb
Outdated
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 |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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.
1 similar comment
* 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
spec/support/bootstrap.rb
Outdated
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') |
There was a problem hiding this comment.
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]
spec/support/bootstrap.rb
Outdated
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'), |
There was a problem hiding this comment.
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]
spec/support/bootstrap.rb
Outdated
{ | ||
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'), |
There was a problem hiding this comment.
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]
spec/support/bootstrap.rb
Outdated
RightOn::Right.delete_all | ||
{ | ||
users: RightOn::Right.create!(name: 'users', controller: 'users'), | ||
models: RightOn::Right.create!(name: 'models', controller: 'models'), |
There was a problem hiding this comment.
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]
spec/support/bootstrap.rb
Outdated
def self.various_rights_with_actions | ||
RightOn::Right.delete_all | ||
{ | ||
users: RightOn::Right.create!(name: 'users', controller: 'users'), |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
spec/right_on_spec.rb
Outdated
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 |
There was a problem hiding this comment.
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]
spec/right_on_spec.rb
Outdated
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 |
There was a problem hiding this comment.
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]
spec/right_on_spec.rb
Outdated
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 |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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]
Just some cleanups in preparation for breaking changes