diff options
Diffstat (limited to 'spec/lib/gitlab/ci/status/build/stop_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/status/build/stop_spec.rb | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/spec/lib/gitlab/ci/status/build/stop_spec.rb b/spec/lib/gitlab/ci/status/build/stop_spec.rb index bc1939fb493..984cd1e5007 100644 --- a/spec/lib/gitlab/ci/status/build/stop_spec.rb +++ b/spec/lib/gitlab/ci/status/build/stop_spec.rb @@ -20,16 +20,34 @@ describe Gitlab::Ci::Status::Build::Stop do it { expect(subject.icon).to eq 'icon_status_manual' } end - describe '#has_action?' do - end + describe 'action details' do + let(:user) { create(:user) } + let(:build) { create(:ci_build) } + let(:status) { Gitlab::Ci::Status::Core.new(build, user) } - describe '#action_icon' do - end + describe '#has_action?' do + context 'when user is allowed to update build' do + before { build.project.team << [user, :developer] } - describe '#action_path' do - end + it { is_expected.to have_action } + end + + context 'when user is not allowed to update build' do + it { is_expected.not_to have_action } + end + end + + describe '#action_path' do + it { expect(subject.action_path).to include "#{build.id}/play" } + end - describe '#action_title' do + describe '#action_icon' do + it { expect(subject.action_icon).to eq 'stop' } + end + + describe '#action_title' do + it { expect(subject.action_title).to eq 'Stop' } + end end describe '.matches?' do |