diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-06-02 08:10:59 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-06-07 17:34:09 +0300 |
commit | 0c2962eb86c4f6e938ad817372498e6600a19a1c (patch) | |
tree | 6145062a3c736659aab6378b4da05d3291a4ac0b /spec | |
parent | 5360ef2c5bbdd2706361a59310dba84ed11305bb (diff) |
Use subject for more consistent testing style:
Feedback from:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4404#note_12194489
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/user_spec.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 6f7d5a3c14d..d9e65586a8e 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -848,6 +848,7 @@ describe User, models: true do describe '#ci_authorized_runners' do let(:user) { create(:user) } let(:runner) { create(:ci_runner) } + subject { user.ci_authorized_runners } before { project.runners << runner } @@ -855,7 +856,7 @@ describe User, models: true do let(:project) { create(:project) } it 'does not load' do - expect(user.ci_authorized_runners).to eq([]) + is_expected.to eq([]) end end @@ -864,19 +865,19 @@ describe User, models: true do let(:project) { create(:project, namespace: namespace) } it 'loads' do - expect(user.ci_authorized_runners).to eq([runner]) + is_expected.to eq([runner]) end end shared_examples :member do it 'loads when the user is a master' do add_user(Gitlab::Access::MASTER) - expect(user.ci_authorized_runners).to eq([runner]) + is_expected.to eq([runner]) end it 'does not load when the user is a developer' do add_user(Gitlab::Access::DEVELOPER) - expect(user.ci_authorized_runners).to eq([]) + is_expected.to eq([]) end end |