Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
bcfb40a1
Commit
bcfb40a1
authored
Aug 12, 2020
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test global ID assignment
parent
d243fc6a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
9 deletions
+24
-9
ee/spec/requests/projects/dast_site_profiles_controller_spec.rb
...c/requests/projects/dast_site_profiles_controller_spec.rb
+24
-9
No files found.
ee/spec/requests/projects/dast_site_profiles_controller_spec.rb
View file @
bcfb40a1
...
...
@@ -7,18 +7,25 @@ RSpec.describe Projects::DastSiteProfilesController, type: :request do
let
(
:user
)
{
create
(
:user
)
}
let
(
:dast_site_profile
)
{
create
(
:dast_site_profile
,
project:
project
)
}
def
with_feature_available
stub_feature_flags
(
security_on_demand_scans_feature_flag:
true
)
stub_licensed_features
(
security_on_demand_scans:
true
)
end
def
with_user_authorized
project
.
add_developer
(
user
)
login_as
(
user
)
end
shared_examples
'a GET request'
do
context
'feature available'
do
before
do
stub_feature_flags
(
security_on_demand_scans_feature_flag:
true
)
stub_licensed_features
(
security_on_demand_scans:
true
)
with_feature_available
end
context
'user authorized'
do
before
do
project
.
add_developer
(
user
)
login_as
(
user
)
with_user_authorized
end
it
'can access page'
do
...
...
@@ -45,9 +52,7 @@ RSpec.describe Projects::DastSiteProfilesController, type: :request do
context
'feature not available'
do
before
do
project
.
add_developer
(
user
)
login_as
(
user
)
with_user_authorized
end
context
'feature flag is disabled'
do
...
...
@@ -79,8 +84,18 @@ RSpec.describe Projects::DastSiteProfilesController, type: :request do
end
describe
'GET #edit'
do
let
(
:edit_path
)
{
edit_project_dast_site_profile_path
(
project
,
dast_site_profile
)
}
it_behaves_like
'a GET request'
do
let
(
:path
)
{
edit_project_dast_site_profile_path
(
project
,
dast_site_profile
)
}
let
(
:path
)
{
edit_path
}
end
it
'assigns DAST site profile global ID'
do
with_feature_available
with_user_authorized
get
edit_project_dast_site_profile_path
(
project
,
dast_site_profile
)
expect
(
assigns
(
:site_profile_gid
)).
to
eq
(
dast_site_profile
.
to_global_id
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment