diff options
author | Stan Hu <stanhu@gmail.com> | 2016-08-20 06:33:53 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2016-08-20 06:53:14 -0700 |
commit | 1954bb17eca49d375c92a4b8fa7f52fa39873a7d (patch) | |
tree | c5ccf8bd6806f024db38299400517ef056b2be7b /spec/models/ability_spec.rb | |
parent | be95e03a5633696d79260ae61bb9e8f4c6755855 (diff) | |
download | gitlab-ce-1954bb17eca49d375c92a4b8fa7f52fa39873a7d.tar.gz |
Make Ability#project_abilities return unique values and fix countsfix-rspec-failures-due-to-cached-permissions
Diffstat (limited to 'spec/models/ability_spec.rb')
-rw-r--r-- | spec/models/ability_spec.rb | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/spec/models/ability_spec.rb b/spec/models/ability_spec.rb index fe32d367176..aa3b2bbf471 100644 --- a/spec/models/ability_spec.rb +++ b/spec/models/ability_spec.rb @@ -191,21 +191,22 @@ describe Ability, lib: true do admin = create(:admin) results = described_class.project_abilities(admin, project) - expect(results.count).to eq(90) + + expect(results.count).to eq(68) end it 'returns permissions for an owner' do results = described_class.project_abilities(project.owner, project) - expect(results.count).to eq(90) + expect(results.count).to eq(68) end - it 'returns permissions for a guest' do - project.team << [user, :guest] + it 'returns permissions for a master' do + project.team << [user, :master] results = described_class.project_abilities(user, project) - expect(results.count).to eq(22) + expect(results.count).to eq(60) end it 'returns permissions for a developer' do @@ -213,15 +214,15 @@ describe Ability, lib: true do results = described_class.project_abilities(user, project) - expect(results.count).to eq(22) + expect(results.count).to eq(44) end - it 'returns permissions for a master' do - project.team << [user, :master] + it 'returns permissions for a guest' do + project.team << [user, :guest] results = described_class.project_abilities(user, project) - expect(results.count).to eq(22) + expect(results.count).to eq(21) end end end |