diff options
| author | Alexis Reigel <mail@koffeinfrei.org> | 2017-09-06 11:26:55 +0200 |
|---|---|---|
| committer | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2018-04-23 09:06:02 +0200 |
| commit | 14c8dbc66537e59d9a01fe5e8ad64ba559254f14 (patch) | |
| tree | f94b7d5da6fe380c5f7ad046e18d5145f16e8025 | |
| parent | 40b0f5406d97d2fff5019b87a2ab22468053af20 (diff) | |
| download | gitlab-ce-14c8dbc66537e59d9a01fe5e8ad64ba559254f14.tar.gz | |
drop 'scopes' context from specs
| -rw-r--r-- | spec/models/ci/runner_spec.rb | 88 |
1 files changed, 43 insertions, 45 deletions
diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb index 477540fb3b0..5a851a3d559 100644 --- a/spec/models/ci/runner_spec.rb +++ b/spec/models/ci/runner_spec.rb @@ -49,64 +49,62 @@ describe Ci::Runner do end end - describe 'scopes' do - describe 'owned_or_shared' do - it 'returns the specific project runner' do - # own - specific_project = create :project - specific_runner = create :ci_runner, :specific, projects: [specific_project] + describe '.owned_or_shared' do + it 'returns the specific project runner' do + # own + specific_project = create :project + specific_runner = create :ci_runner, :specific, projects: [specific_project] - # other - other_project = create :project - create :ci_runner, :specific, projects: [other_project] + # other + other_project = create :project + create :ci_runner, :specific, projects: [other_project] - expect(described_class.owned_or_shared(specific_project.id)).to eq [specific_runner] - end + expect(described_class.owned_or_shared(specific_project.id)).to eq [specific_runner] + end - it 'returns the shared project runner' do - project = create :project - runner = create :ci_runner, :shared, projects: [project] + it 'returns the shared project runner' do + project = create :project + runner = create :ci_runner, :shared, projects: [project] - expect(described_class.owned_or_shared(0)).to eq [runner] - end + expect(described_class.owned_or_shared(0)).to eq [runner] + end - it 'returns the specific group runner' do - # own - specific_group = create :group - specific_project = create :project, group: specific_group - specific_runner = create :ci_runner, :specific, groups: [specific_group] + it 'returns the specific group runner' do + # own + specific_group = create :group + specific_project = create :project, group: specific_group + specific_runner = create :ci_runner, :specific, groups: [specific_group] - # other - other_group = create :group - create :project, group: other_group - create :ci_runner, :specific, groups: [other_group] + # other + other_group = create :group + create :project, group: other_group + create :ci_runner, :specific, groups: [other_group] - expect(described_class.owned_or_shared(specific_project.id)).to eq [specific_runner] - end + expect(described_class.owned_or_shared(specific_project.id)).to eq [specific_runner] + end - it 'returns the shared group runner' do - group = create :group - runner = create :ci_runner, :shared, groups: [group] + it 'returns the shared group runner' do + group = create :group + runner = create :ci_runner, :shared, groups: [group] - expect(described_class.owned_or_shared(0)).to eq [runner] - end + expect(described_class.owned_or_shared(0)).to eq [runner] + end - it 'returns a globally shared, a project specific and a group specific runner' do - # group specific - group = create :group - project = create :project, group: group - group_runner = create :ci_runner, :specific, groups: [group] + it 'returns a globally shared, a project specific and a group specific runner' do + # group specific + group = create :group + project = create :project, group: group + group_runner = create :ci_runner, :specific, groups: [group] - # project specific - project_runner = create :ci_runner, :specific, projects: [project] + # project specific + project_runner = create :ci_runner, :specific, projects: [project] - # globally shared - shared_runner = create :ci_runner, :shared + # globally shared + shared_runner = create :ci_runner, :shared - expect(described_class.owned_or_shared(project.id)).to match_array [ - group_runner, project_runner, shared_runner - ] - end + expect(described_class.owned_or_shared(project.id)).to match_array [ + group_runner, project_runner, shared_runner + ] end end |
