diff options
author | Rémy Coutable <remy@rymai.me> | 2017-07-25 20:09:00 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-07-27 15:31:53 +0300 |
commit | cddc5cacfb833fbd188d2f5982381f66dd3eee3b (patch) | |
tree | de3e7bda37c8b7f0eb5586695d6d871484dc44e2 /spec/models/guest_spec.rb | |
parent | ddccd24c1388dadc057ac3c4c0a49f3fea847292 (diff) |
Use described_class when possible
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/models/guest_spec.rb')
-rw-r--r-- | spec/models/guest_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/models/guest_spec.rb b/spec/models/guest_spec.rb index ac9aaa76550..0e9b94aac97 100644 --- a/spec/models/guest_spec.rb +++ b/spec/models/guest_spec.rb @@ -8,13 +8,13 @@ describe Guest do describe '.can_pull?' do context 'when project is private' do it 'does not allow to pull the repo' do - expect(Guest.can?(:download_code, private_project)).to eq(false) + expect(described_class.can?(:download_code, private_project)).to eq(false) end end context 'when project is internal' do it 'does not allow to pull the repo' do - expect(Guest.can?(:download_code, internal_project)).to eq(false) + expect(described_class.can?(:download_code, internal_project)).to eq(false) end end @@ -23,7 +23,7 @@ describe Guest do it 'does not allow to pull the repo' do public_project.project_feature.update_attribute(:repository_access_level, ProjectFeature::DISABLED) - expect(Guest.can?(:download_code, public_project)).to eq(false) + expect(described_class.can?(:download_code, public_project)).to eq(false) end end @@ -31,13 +31,13 @@ describe Guest do it 'does not allow to pull the repo' do public_project.project_feature.update_attribute(:repository_access_level, ProjectFeature::PRIVATE) - expect(Guest.can?(:download_code, public_project)).to eq(false) + expect(described_class.can?(:download_code, public_project)).to eq(false) end end context 'when repository is enabled' do it 'allows to pull the repo' do - expect(Guest.can?(:download_code, public_project)).to eq(true) + expect(described_class.can?(:download_code, public_project)).to eq(true) end end end |