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
9b25ce58
Commit
9b25ce58
authored
Nov 05, 2021
by
Sri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code review fixups
parent
d1dee969
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
spec/requests/projects/google_cloud_controller_spec.rb
spec/requests/projects/google_cloud_controller_spec.rb
+15
-2
No files found.
spec/requests/projects/google_cloud_controller_spec.rb
View file @
9b25ce58
...
...
@@ -25,6 +25,7 @@ RSpec.describe Projects::GoogleCloudController do
it
'returns not found'
do
project
.
add_guest
(
user
)
sign_in
(
user
)
get
url
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
...
...
@@ -37,6 +38,7 @@ RSpec.describe Projects::GoogleCloudController do
it
'returns not found'
do
project
.
add_developer
(
user
)
sign_in
(
user
)
get
url
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
...
...
@@ -49,6 +51,7 @@ RSpec.describe Projects::GoogleCloudController do
it
'returns successful'
do
project
.
add_maintainer
(
user
)
sign_in
(
user
)
get
url
expect
(
response
).
to
be_successful
...
...
@@ -60,6 +63,7 @@ RSpec.describe Projects::GoogleCloudController do
it
'returns successful'
do
sign_in
(
user
)
get
url
expect
(
response
).
to
be_successful
...
...
@@ -70,12 +74,16 @@ RSpec.describe Projects::GoogleCloudController do
let
(
:user
)
{
project
.
creator
}
context
'but gitlab instance is not configured for google oauth2'
do
it
'returns forbidden'
do
before
do
unconfigured_google_oauth2
=
MockGoogleOAuth2Credentials
.
new
(
''
,
''
)
allow
(
Gitlab
::
Auth
::
OAuth
::
Provider
).
to
receive
(
:config_for
)
.
with
(
'google_oauth2'
)
.
and_return
(
unconfigured_google_oauth2
)
end
it
'returns forbidden'
do
sign_in
(
user
)
get
url
expect
(
response
).
to
have_gitlab_http_status
(
:forbidden
)
...
...
@@ -83,10 +91,15 @@ RSpec.describe Projects::GoogleCloudController do
end
context
'but feature flag is disabled'
do
it
'returns not found'
do
before
do
allow
(
Feature
).
to
receive
(
:enabled?
).
and_return
(
false
)
end
it
'returns not found'
do
sign_in
(
user
)
get
url
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
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