Use proper path helpers

parent a590e0d7
- add_to_breadcrumbs s_('OnDemandScans|On-demand Scans'), namespace_project_on_demand_scans_path(@project.group, @project) - add_to_breadcrumbs s_('OnDemandScans|On-demand Scans'), project_on_demand_scans_path(@project)
- breadcrumb_title s_('DastProfiles|Manage profiles') - breadcrumb_title s_('DastProfiles|Manage profiles')
- page_title s_('DastProfiles|Manage profiles') - page_title s_('DastProfiles|Manage profiles')
......
- add_to_breadcrumbs s_('OnDemandScans|On-demand Scans'), namespace_project_on_demand_scans_path(@project.group, @project) - add_to_breadcrumbs s_('OnDemandScans|On-demand Scans'), project_on_demand_scans_path(@project)
- add_to_breadcrumbs s_('DastProfiles|Manage profiles'), namespace_project_profiles_path(@project.group, @project) - add_to_breadcrumbs s_('DastProfiles|Manage profiles'), project_profiles_path(@project)
- breadcrumb_title s_('DastProfiles|New site profile') - breadcrumb_title s_('DastProfiles|New site profile')
- page_title s_('DastProfiles|New site profile') - page_title s_('DastProfiles|New site profile')
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Projects::DastProfilesController, type: :request do RSpec.describe Projects::DastProfilesController, type: :request do
let(:group) { create(:group) } let(:project) { create(:project) }
let(:project) { create(:project, namespace: group) }
let(:user) { create(:user) } let(:user) { create(:user) }
describe 'GET #index' do describe 'GET #index' do
...@@ -22,7 +21,7 @@ RSpec.describe Projects::DastProfilesController, type: :request do ...@@ -22,7 +21,7 @@ RSpec.describe Projects::DastProfilesController, type: :request do
end end
it 'can access page' do it 'can access page' do
get namespace_project_profiles_path(project.group, project) get project_profiles_path(project)
expect(response).to have_gitlab_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
end end
...@@ -36,7 +35,7 @@ RSpec.describe Projects::DastProfilesController, type: :request do ...@@ -36,7 +35,7 @@ RSpec.describe Projects::DastProfilesController, type: :request do
end end
it 'sees a 404 error' do it 'sees a 404 error' do
get namespace_project_profiles_path(project.group, project) get project_profiles_path(project)
expect(response).to have_gitlab_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
end end
...@@ -54,7 +53,7 @@ RSpec.describe Projects::DastProfilesController, type: :request do ...@@ -54,7 +53,7 @@ RSpec.describe Projects::DastProfilesController, type: :request do
it 'sees a 404 error' do it 'sees a 404 error' do
stub_feature_flags(security_on_demand_scans_feature_flag: false) stub_feature_flags(security_on_demand_scans_feature_flag: false)
stub_licensed_features(security_on_demand_scans: true) stub_licensed_features(security_on_demand_scans: true)
get namespace_project_profiles_path(project.group, project) get project_profiles_path(project)
expect(response).to have_gitlab_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
end end
...@@ -64,7 +63,7 @@ RSpec.describe Projects::DastProfilesController, type: :request do ...@@ -64,7 +63,7 @@ RSpec.describe Projects::DastProfilesController, type: :request do
it 'sees a 404 error' do it 'sees a 404 error' do
stub_feature_flags(security_on_demand_scans_feature_flag: true) stub_feature_flags(security_on_demand_scans_feature_flag: true)
stub_licensed_features(security_on_demand_scans: false) stub_licensed_features(security_on_demand_scans: false)
get namespace_project_profiles_path(project.group, project) get project_profiles_path(project)
expect(response).to have_gitlab_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
end end
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Projects::DastSiteProfilesController, type: :request do RSpec.describe Projects::DastSiteProfilesController, type: :request do
let(:group) { create(:group) } let(:project) { create(:project) }
let(:project) { create(:project, namespace: group) }
let(:user) { create(:user) } let(:user) { create(:user) }
describe 'GET #new' do describe 'GET #new' do
...@@ -22,7 +21,7 @@ RSpec.describe Projects::DastSiteProfilesController, type: :request do ...@@ -22,7 +21,7 @@ RSpec.describe Projects::DastSiteProfilesController, type: :request do
end end
it 'can access page' do it 'can access page' do
get namespace_project_profiles_path(project.group, project) get project_profiles_path(project)
expect(response).to have_gitlab_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
end end
...@@ -36,7 +35,7 @@ RSpec.describe Projects::DastSiteProfilesController, type: :request do ...@@ -36,7 +35,7 @@ RSpec.describe Projects::DastSiteProfilesController, type: :request do
end end
it 'sees a 404 error' do it 'sees a 404 error' do
get namespace_project_profiles_path(project.group, project) get project_profiles_path(project)
expect(response).to have_gitlab_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
end end
...@@ -54,7 +53,7 @@ RSpec.describe Projects::DastSiteProfilesController, type: :request do ...@@ -54,7 +53,7 @@ RSpec.describe Projects::DastSiteProfilesController, type: :request do
it 'sees a 404 error' do it 'sees a 404 error' do
stub_feature_flags(security_on_demand_scans_feature_flag: false) stub_feature_flags(security_on_demand_scans_feature_flag: false)
stub_licensed_features(security_on_demand_scans: true) stub_licensed_features(security_on_demand_scans: true)
get namespace_project_profiles_path(project.group, project) get project_profiles_path(project)
expect(response).to have_gitlab_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
end end
...@@ -64,7 +63,7 @@ RSpec.describe Projects::DastSiteProfilesController, type: :request do ...@@ -64,7 +63,7 @@ RSpec.describe Projects::DastSiteProfilesController, type: :request do
it 'sees a 404 error' do it 'sees a 404 error' do
stub_feature_flags(security_on_demand_scans_feature_flag: true) stub_feature_flags(security_on_demand_scans_feature_flag: true)
stub_licensed_features(security_on_demand_scans: false) stub_licensed_features(security_on_demand_scans: false)
get namespace_project_profiles_path(project.group, project) get project_profiles_path(project)
expect(response).to have_gitlab_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
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