diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-07-04 05:58:28 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-07-04 21:56:41 +0800 |
commit | 28553dbc05989b698777ee085aa2a357ffe576d2 (patch) | |
tree | 8005538c73dd33ce949047d201f8d2b55ba2294e /spec/serializers | |
parent | 005870d5ce1a00b3405d0ae3a639d0c4befcb7a2 (diff) | |
download | gitlab-ce-28553dbc05989b698777ee085aa2a357ffe576d2.tar.gz |
Update tests due to permission changes
Diffstat (limited to 'spec/serializers')
-rw-r--r-- | spec/serializers/job_entity_spec.rb | 6 | ||||
-rw-r--r-- | spec/serializers/pipeline_details_entity_spec.rb | 6 | ||||
-rw-r--r-- | spec/serializers/pipeline_entity_spec.rb | 4 |
3 files changed, 10 insertions, 6 deletions
diff --git a/spec/serializers/job_entity_spec.rb b/spec/serializers/job_entity_spec.rb index 5ca7bf2fcaf..ec30816654b 100644 --- a/spec/serializers/job_entity_spec.rb +++ b/spec/serializers/job_entity_spec.rb @@ -8,7 +8,7 @@ describe JobEntity do before do allow(request).to receive(:current_user).and_return(user) - project.add_developer(user) + project.add_master(user) end let(:entity) do @@ -90,6 +90,10 @@ describe JobEntity do end context 'when user is not allowed to trigger action' do + before do + project.team.truncate + end + it 'does not contain path to play action' do expect(subject).not_to include(:play_path) end diff --git a/spec/serializers/pipeline_details_entity_spec.rb b/spec/serializers/pipeline_details_entity_spec.rb index d28dec9592a..e9b24b47900 100644 --- a/spec/serializers/pipeline_details_entity_spec.rb +++ b/spec/serializers/pipeline_details_entity_spec.rb @@ -52,7 +52,7 @@ describe PipelineDetailsEntity do context 'user has ability to retry pipeline' do before do - project.team << [user, :developer] + project.add_master(user) end it 'retryable flag is true' do @@ -80,7 +80,7 @@ describe PipelineDetailsEntity do context 'user has ability to cancel pipeline' do before do - project.add_developer(user) + project.add_master(user) end it 'cancelable flag is true' do @@ -97,7 +97,7 @@ describe PipelineDetailsEntity do context 'when pipeline has commit statuses' do let(:pipeline) { create(:ci_empty_pipeline) } - + before do create(:generic_commit_status, pipeline: pipeline) end diff --git a/spec/serializers/pipeline_entity_spec.rb b/spec/serializers/pipeline_entity_spec.rb index 46650f3a80d..46433867b11 100644 --- a/spec/serializers/pipeline_entity_spec.rb +++ b/spec/serializers/pipeline_entity_spec.rb @@ -52,7 +52,7 @@ describe PipelineEntity do context 'user has ability to retry pipeline' do before do - project.team << [user, :developer] + project.add_master(user) end it 'contains retry path' do @@ -80,7 +80,7 @@ describe PipelineEntity do context 'user has ability to cancel pipeline' do before do - project.add_developer(user) + project.add_master(user) end it 'contains cancel path' do |