Generate site profiles with set URLs

This updates the DAST site profile mocks to use pre-defined URLs instead
of the auto-generated ones. We need this because auto-generated URLs
dependened on the entity's ID, which could be different depending on the
environement fixtures are being generated in. This caused some snapshot
failures on master. Making our fixtures more deterministic should
prevent the failure from happening again.
parent 7830241c
......@@ -57,11 +57,50 @@ RSpec.describe 'DAST profiles (GraphQL fixtures)' do
end
# DAST sites
let_it_be(:dast_site_pending) { create(:dast_site, project: project, dast_site_validation: dast_site_validation_pending) }
let_it_be(:dast_site_inprogress) { create(:dast_site, project: project, dast_site_validation: dast_site_validation_inprogress) }
let_it_be(:dast_site_passed) { create(:dast_site, project: project, dast_site_validation: dast_site_validation_passed) }
let_it_be(:dast_site_failed) { create(:dast_site, project: project, dast_site_validation: dast_site_validation_failed) }
let_it_be(:dast_site_none) { create(:dast_site, project: project, dast_site_validation: nil) }
let_it_be(:dast_site_pending) do
create(
:dast_site,
project: project,
url: 'http://pending.test',
dast_site_validation: dast_site_validation_pending
)
end
let_it_be(:dast_site_inprogress) do
create(
:dast_site,
project: project,
url: 'http://inprogress.test',
dast_site_validation: dast_site_validation_inprogress
)
end
let_it_be(:dast_site_passed) do
create(
:dast_site,
project: project,
url: 'http://passed.test',
dast_site_validation: dast_site_validation_passed
)
end
let_it_be(:dast_site_failed) do
create(
:dast_site,
project: project,
url: 'http://failed.test',
dast_site_validation: dast_site_validation_failed
)
end
let_it_be(:dast_site_none) do
create(
:dast_site,
project: project,
url: 'http://none.test',
dast_site_validation: nil
)
end
before do
stub_licensed_features(security_on_demand_scans: true)
......
......@@ -8,7 +8,7 @@ exports[`DastSiteProfileSummary renders properly profile 0 1`] = `
<profile-selector-summary-cell-stub
class=""
label="Target URL"
value="http://example5.test"
value="http://pending.test"
/>
<profile-selector-summary-cell-stub
......@@ -22,7 +22,7 @@ exports[`DastSiteProfileSummary renders properly profile 0 1`] = `
>
<profile-selector-summary-cell-stub
label="Authentication URL"
value="http://example5.test/sign-in"
value="http://pending.test/sign-in"
/>
</div>
......@@ -59,7 +59,7 @@ exports[`DastSiteProfileSummary renders properly profile 0 1`] = `
>
<profile-selector-summary-cell-stub
label="Excluded URLs"
value="http://example5.test/sign-out,http://example5.test/hidden"
value="http://pending.test/sign-out,http://pending.test/hidden"
/>
<profile-selector-summary-cell-stub
......@@ -87,7 +87,7 @@ exports[`DastSiteProfileSummary renders properly profile 1 1`] = `
<profile-selector-summary-cell-stub
class=""
label="Target URL"
value="http://example6.test"
value="http://inprogress.test"
/>
<profile-selector-summary-cell-stub
......@@ -101,7 +101,7 @@ exports[`DastSiteProfileSummary renders properly profile 1 1`] = `
>
<profile-selector-summary-cell-stub
label="Authentication URL"
value="http://example6.test/sign-in"
value="http://inprogress.test/sign-in"
/>
</div>
......@@ -138,7 +138,7 @@ exports[`DastSiteProfileSummary renders properly profile 1 1`] = `
>
<profile-selector-summary-cell-stub
label="Excluded URLs"
value="http://example6.test/sign-out,http://example6.test/hidden"
value="http://inprogress.test/sign-out,http://inprogress.test/hidden"
/>
<profile-selector-summary-cell-stub
......@@ -166,7 +166,7 @@ exports[`DastSiteProfileSummary renders properly profile 2 1`] = `
<profile-selector-summary-cell-stub
class=""
label="Target URL"
value="http://example7.test"
value="http://passed.test"
/>
<profile-selector-summary-cell-stub
......@@ -180,7 +180,7 @@ exports[`DastSiteProfileSummary renders properly profile 2 1`] = `
>
<profile-selector-summary-cell-stub
label="Authentication URL"
value="http://example7.test/sign-in"
value="http://passed.test/sign-in"
/>
</div>
......@@ -217,7 +217,7 @@ exports[`DastSiteProfileSummary renders properly profile 2 1`] = `
>
<profile-selector-summary-cell-stub
label="Excluded URLs"
value="http://example7.test/sign-out,http://example7.test/hidden"
value="http://passed.test/sign-out,http://passed.test/hidden"
/>
<profile-selector-summary-cell-stub
......@@ -245,7 +245,7 @@ exports[`DastSiteProfileSummary renders properly profile 3 1`] = `
<profile-selector-summary-cell-stub
class=""
label="Target URL"
value="http://example8.test"
value="http://failed.test"
/>
<profile-selector-summary-cell-stub
......@@ -259,7 +259,7 @@ exports[`DastSiteProfileSummary renders properly profile 3 1`] = `
>
<profile-selector-summary-cell-stub
label="Authentication URL"
value="http://example8.test/sign-in"
value="http://failed.test/sign-in"
/>
</div>
......@@ -296,7 +296,7 @@ exports[`DastSiteProfileSummary renders properly profile 3 1`] = `
>
<profile-selector-summary-cell-stub
label="Excluded URLs"
value="http://example8.test/sign-out,http://example8.test/hidden"
value="http://failed.test/sign-out,http://failed.test/hidden"
/>
<profile-selector-summary-cell-stub
......@@ -324,7 +324,7 @@ exports[`DastSiteProfileSummary renders properly profile 4 1`] = `
<profile-selector-summary-cell-stub
class=""
label="Target URL"
value="http://example9.test"
value="http://none.test"
/>
<profile-selector-summary-cell-stub
......@@ -338,7 +338,7 @@ exports[`DastSiteProfileSummary renders properly profile 4 1`] = `
>
<profile-selector-summary-cell-stub
label="Authentication URL"
value="http://example9.test/sign-in"
value="http://none.test/sign-in"
/>
</div>
......@@ -375,7 +375,7 @@ exports[`DastSiteProfileSummary renders properly profile 4 1`] = `
>
<profile-selector-summary-cell-stub
label="Excluded URLs"
value="http://example9.test/sign-out,http://example9.test/hidden"
value="http://none.test/sign-out,http://none.test/hidden"
/>
<profile-selector-summary-cell-stub
......
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