Commit 863b2d18 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'test-for-404-when-dast-scanner-and-site-profiles-dont-exist-249088' into 'master'

Test for 404 when dast scanner and site profiles dont exist

See merge request gitlab-org/gitlab!47643
parents e8824504 3675b43c
...@@ -84,5 +84,15 @@ RSpec.describe Projects::Security::DastScannerProfilesController, type: :request ...@@ -84,5 +84,15 @@ RSpec.describe Projects::Security::DastScannerProfilesController, type: :request
get edit_path get edit_path
expect(assigns(:scanner_profile)).to eq(dast_scanner_profile) expect(assigns(:scanner_profile)).to eq(dast_scanner_profile)
end end
context 'record does not exist' do
let(:dast_scanner_profile) { 0 }
it 'sees a 404 error' do
get edit_path
expect(response).to have_gitlab_http_status(:not_found)
end
end
end end
end end
...@@ -77,5 +77,20 @@ RSpec.describe Projects::Security::DastSiteProfilesController, type: :request do ...@@ -77,5 +77,20 @@ RSpec.describe Projects::Security::DastSiteProfilesController, type: :request do
it_behaves_like 'a GET request' do it_behaves_like 'a GET request' do
let(:path) { edit_path } let(:path) { edit_path }
end end
context 'record does not exist' do
let(:dast_site_profile) { 0 }
before do
with_feature_available
with_user_authorized
end
it 'sees a 404 error' do
get edit_path
expect(response).to have_gitlab_http_status(:not_found)
end
end
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