Commit 9a4b4cee authored by Tetiana Chupryna's avatar Tetiana Chupryna

Add case with disabled features

parent 8e6e38fc
......@@ -28,26 +28,36 @@ describe Ci::PipelinePresenter do
describe '#expose_security_dashboard?' do
subject { presenter.expose_security_dashboard? }
before do
stub_licensed_features(dependency_scanning: true, license_management: true)
end
context 'when features are available' do
before do
stub_licensed_features(dependency_scanning: true, license_management: true)
end
context 'when there is an artifact of a right type' do
let!(:build) { create(:ee_ci_build, :dependency_scanning, pipeline: pipeline) }
context 'when there is an artifact of a right type' do
let!(:build) { create(:ee_ci_build, :dependency_scanning, pipeline: pipeline) }
it { is_expected.to be_truthy }
end
it { is_expected.to be_truthy }
end
context 'when there is an artifact of a wrong type' do
let!(:build) { create(:ee_ci_build, :license_scanning, pipeline: pipeline) }
context 'when there is an artifact of a wrong type' do
let!(:build) { create(:ee_ci_build, :license_scanning, pipeline: pipeline) }
it { is_expected.to be_falsey }
it { is_expected.to be_falsey }
end
context 'when there is no found artifact' do
let!(:build) { create(:ee_ci_build, pipeline: pipeline) }
it { is_expected.to be_falsey }
end
end
context 'when there is no found artifact' do
let!(:build) { create(:ee_ci_build, pipeline: pipeline) }
context 'when features are disabled' do
context 'when there is an artifact of a right type' do
let!(:build) { create(:ee_ci_build, :dependency_scanning, pipeline: pipeline) }
it { is_expected.to be_falsey }
it { is_expected.to be_falsey }
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment