diff options
Diffstat (limited to 'spec/lib/gitlab/ci/status/build/play_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/status/build/play_spec.rb | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/spec/lib/gitlab/ci/status/build/play_spec.rb b/spec/lib/gitlab/ci/status/build/play_spec.rb index abefdbe7c66..f5d0f977768 100644 --- a/spec/lib/gitlab/ci/status/build/play_spec.rb +++ b/spec/lib/gitlab/ci/status/build/play_spec.rb @@ -7,38 +7,28 @@ describe Gitlab::Ci::Status::Build::Play do subject { described_class.new(status) } - context 'when user is allowed to update build' do - context 'when user can push to branch' do - before { build.project.add_master(user) } + describe '#label' do + it 'has a label that says it is a manual action' do + expect(subject.label).to eq 'manual play action' + end + end + + 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) } - describe '#has_action?' do it { is_expected.to have_action } end - describe '#label' do - it 'has a label that says it is a manual action' do - expect(subject.label).to eq 'manual play action' - end - end - end + context 'when user can not push to the branch' do + before { build.project.add_developer(user) } - context 'when user can not push to the branch' do - before { build.project.add_developer(user) } - - describe 'has_action?' do it { is_expected.not_to have_action } end - - describe '#label' do - it 'has a label that says user is not allowed to play it' do - expect(subject.label).to eq 'manual play action (not allowed)' - end - end end - end - context 'when user is not allowed to update build' do - describe '#has_action?' do + context 'when user is not allowed to update build' do it { is_expected.not_to have_action } end end |