summaryrefslogtreecommitdiff
path: root/spec/models/ability_spec.rb
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2017-04-06 14:09:58 -0700
committerhttp://jneen.net/ <jneen@jneen.net>2017-06-27 12:41:54 -0700
commit963b374dc7ca077aeb97c6a3a79605e2646631d1 (patch)
tree1999ba1c89a8d75c51989c9131ffdc6e7ac9ee50 /spec/models/ability_spec.rb
parent80d6e5bbd4bb4b2a418e3e81b45b59c01ca00b0c (diff)
downloadgitlab-ce-963b374dc7ca077aeb97c6a3a79605e2646631d1.tar.gz
update the specs to not require a set to be returned
Diffstat (limited to 'spec/models/ability_spec.rb')
-rw-r--r--spec/models/ability_spec.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/models/ability_spec.rb b/spec/models/ability_spec.rb
index 090f9e70c50..dc7a0d80752 100644
--- a/spec/models/ability_spec.rb
+++ b/spec/models/ability_spec.rb
@@ -2,8 +2,8 @@ require 'spec_helper'
describe Ability, lib: true do
context 'using a nil subject' do
- it 'is always empty' do
- expect(Ability.allowed(nil, nil).to_set).to be_empty
+ it 'has no permissions' do
+ expect(Ability.policy_for(nil, nil)).to be_banned
end
end
@@ -255,12 +255,15 @@ describe Ability, lib: true do
describe '.project_disabled_features_rules' do
let(:project) { create(:empty_project, :wiki_disabled) }
- subject { described_class.allowed(project.owner, project) }
+ subject { described_class.policy_for(project.owner, project) }
context 'wiki named abilities' do
it 'disables wiki abilities if the project has no wiki' do
expect(project).to receive(:has_external_wiki?).and_return(false)
- expect(subject).not_to include(:read_wiki, :create_wiki, :update_wiki, :admin_wiki)
+ expect(subject).not_to be_allowed(:read_wiki)
+ expect(subject).not_to be_allowed(:create_wiki)
+ expect(subject).not_to be_allowed(:update_wiki)
+ expect(subject).not_to be_allowed(:admin_wiki)
end
end
end