diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-05-31 11:11:46 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-05-31 11:11:46 +0200 |
commit | 13f10a96e345535cc8946bf73f85de0063d80739 (patch) | |
tree | 3f48cc9ff8b5c1d549b1dd21c080145728d204af | |
parent | 1984359de3371b5f0c8ddbfad757a32d3013c252 (diff) | |
download | gitlab-ce-13f10a96e345535cc8946bf73f85de0063d80739.tar.gz |
Fix play status specs related to protected actions
-rw-r--r-- | spec/lib/gitlab/ci/status/build/play_spec.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/lib/gitlab/ci/status/build/play_spec.rb b/spec/lib/gitlab/ci/status/build/play_spec.rb index f5d0f977768..0e15a5f3c6b 100644 --- a/spec/lib/gitlab/ci/status/build/play_spec.rb +++ b/spec/lib/gitlab/ci/status/build/play_spec.rb @@ -2,6 +2,7 @@ require 'spec_helper' describe Gitlab::Ci::Status::Build::Play do let(:user) { create(:user) } + let(:project) { build.project } let(:build) { create(:ci_build, :manual) } let(:status) { Gitlab::Ci::Status::Core.new(build, user) } @@ -15,8 +16,13 @@ describe Gitlab::Ci::Status::Build::Play do describe '#has_action?' do context 'when user is allowed to update build' do - context 'when user can push to branch' do - before { build.project.add_master(user) } + context 'when user is allowed to trigger protected action' do + before do + project.add_developer(user) + + create(:protected_branch, :developers_can_merge, + name: build.ref, project: project) + end it { is_expected.to have_action } end |