Hardcode string literals

parent 5b5dedc4
......@@ -5,13 +5,11 @@ require 'spec_helper'
RSpec.describe Projects::OnDemandScansHelper do
describe '#on_demand_scans_data' do
let_it_be(:project) { create(:project) }
let_it_be(:default_branch) { 'default-branch' }
let_it_be(:path_with_namespace) { 'foo/bar' }
let_it_be(:timezones) { [{ identifier: "Europe/Paris" }] }
before do
allow(project).to receive(:default_branch).and_return(default_branch)
allow(project).to receive(:path_with_namespace).and_return(path_with_namespace)
allow(project).to receive(:default_branch).and_return("default-branch")
allow(project).to receive(:path_with_namespace).and_return("foo/bar")
allow(helper).to receive(:timezone_data).with(format: :full).and_return(timezones)
end
......@@ -19,8 +17,8 @@ RSpec.describe Projects::OnDemandScansHelper do
expect(helper.on_demand_scans_data(project)).to match(
'help-page-path' => "/help/user/application_security/dast/index#on-demand-scans",
'empty-state-svg-path' => match_asset_path('/assets/illustrations/empty-state/ondemand-scan-empty.svg'),
'default-branch' => default_branch,
'project-path' => path_with_namespace,
'default-branch' => "default-branch",
'project-path' => "foo/bar",
'profiles-library-path' => "/#{project.full_path}/-/security/configuration/dast_scans",
'scanner-profiles-library-path' => "/#{project.full_path}/-/security/configuration/dast_scans#scanner-profiles",
'site-profiles-library-path' => "/#{project.full_path}/-/security/configuration/dast_scans#site-profiles",
......
......@@ -5,11 +5,10 @@ require 'spec_helper'
RSpec.describe Projects::Security::DastProfilesHelper do
describe '#dast_profiles_list_data' do
let_it_be(:project) { create(:project) }
let_it_be(:path_with_namespace) { 'foo/bar' }
let_it_be(:timezones) { [{ identifier: "Europe/Paris" }] }
before do
allow(project).to receive(:path_with_namespace).and_return(path_with_namespace)
allow(project).to receive(:path_with_namespace).and_return("foo/bar")
allow(helper).to receive(:timezone_data).with(format: :full).and_return(timezones)
end
......@@ -19,7 +18,7 @@ RSpec.describe Projects::Security::DastProfilesHelper do
'new_dast_saved_scan_path' => "/#{project.full_path}/-/on_demand_scans/new",
'new_dast_site_profile_path' => "/#{project.full_path}/-/security/configuration/dast_scans/dast_site_profiles/new",
'new_dast_scanner_profile_path' => "/#{project.full_path}/-/security/configuration/dast_scans/dast_scanner_profiles/new",
'project_full_path' => path_with_namespace,
'project_full_path' => "foo/bar",
'timezones' => timezones.to_json
}
)
......
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