Commit 0615fa68 authored by Brandon Labuschagne's avatar Brandon Labuschagne

Merge branch '342930-on-demand-scans-breadcrumbs' into 'master'

Update on-demand scans breadcrumbs

See merge request gitlab-org/gitlab!78063
parents e478da65 b880dcb1
- add_to_breadcrumbs s_('OnDemandScans|On-demand Scans'), project_on_demand_scans_path(@project, anchor: 'saved')
- breadcrumb_title s_('OnDemandScans|Edit on-demand DAST scan')
- page_title s_('OnDemandScans|Edit on-demand DAST scan')
......
- add_to_breadcrumbs s_('OnDemandScans|On-demand Scans'), project_on_demand_scans_path(@project, anchor: 'saved')
- breadcrumb_title s_('OnDemandScans|New on-demand DAST scan')
- page_title s_('OnDemandScans|New on-demand DAST scan')
......
......@@ -9,6 +9,7 @@ RSpec.describe 'User creates On-demand Scan' do
let_it_be(:dast_scanner_profile) { create(:dast_scanner_profile, project: project) }
let(:on_demand_scans_path) { project_on_demand_scans_path(project) }
let(:new_on_demand_scan_path) { new_project_on_demand_scan_path(project) }
before_all do
project.add_developer(user)
......@@ -21,7 +22,7 @@ RSpec.describe 'User creates On-demand Scan' do
context 'when feature is available' do
before do
stub_licensed_features(security_on_demand_scans: true)
visit(new_project_on_demand_scan_path(project))
visit(new_on_demand_scan_path)
end
it 'shows new scan page', :aggregate_failures, :js do
......@@ -29,6 +30,11 @@ RSpec.describe 'User creates On-demand Scan' do
expect(page).to have_link 'Manage DAST scans'
expect(page).to have_button 'Save and run scan'
expect(page).to have_button 'Save scan'
page.within '.breadcrumbs' do
expect(page).to have_link('On-demand Scans', href: project_on_demand_scans_path(project, anchor: 'saved'))
expect(page).to have_link('New on-demand DAST scan', href: new_on_demand_scan_path)
end
end
it 'on save', :js do
......@@ -48,7 +54,7 @@ RSpec.describe 'User creates On-demand Scan' do
context 'when feature is not available' do
before do
visit(new_project_on_demand_scan_path(project))
visit(new_on_demand_scan_path)
end
it 'renders a 404' do
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'User edits On-demand Scan' do
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, :repository) }
let_it_be(:dast_profile) { create(:dast_profile, project: project) }
let(:on_demand_scans_path) { project_on_demand_scans_path(project) }
let(:edit_on_demand_scan_path) { edit_project_on_demand_scan_path(project, dast_profile) }
before_all do
project.add_developer(user)
end
before do
sign_in(user)
stub_licensed_features(security_on_demand_scans: true)
visit(edit_on_demand_scan_path)
end
it 'shows edit scan page', :aggregate_failures, :js do
expect(page).to have_content 'Edit on-demand DAST scan'
page.within '.breadcrumbs' do
expect(page).to have_link('On-demand Scans', href: project_on_demand_scans_path(project, anchor: 'saved'))
expect(page).to have_link('Edit on-demand DAST scan', href: edit_on_demand_scan_path)
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