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
3388a338
Commit
3388a338
authored
Mar 02, 2022
by
Doug Stull
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove test env consideration for simulate com method
- be more explicit during test
parent
eb26e0ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
lib/gitlab.rb
lib/gitlab.rb
+1
-1
spec/lib/gitlab_spec.rb
spec/lib/gitlab_spec.rb
+11
-4
No files found.
lib/gitlab.rb
View file @
3388a338
...
...
@@ -50,7 +50,7 @@ module Gitlab
HTTP_PROXY_ENV_VARS
=
%w(http_proxy https_proxy HTTP_PROXY HTTPS_PROXY)
.
freeze
def
self
.
simulate_com?
return
false
unless
Rails
.
env
.
test?
||
Rails
.
env
.
development?
return
false
unless
Rails
.
env
.
development?
Gitlab
::
Utils
.
to_boolean
(
ENV
[
'GITLAB_SIMULATE_SAAS'
])
end
...
...
spec/lib/gitlab_spec.rb
View file @
3388a338
...
...
@@ -112,11 +112,18 @@ RSpec.describe Gitlab do
expect
(
described_class
.
com?
).
to
eq
false
end
it
'is true when GITLAB_SIMULATE_SAAS is true'
do
it
'is true when GITLAB_SIMULATE_SAAS is true and in development'
do
stub_rails_env
(
'development'
)
stub_env
(
'GITLAB_SIMULATE_SAAS'
,
'1'
)
expect
(
described_class
.
com?
).
to
eq
true
end
it
'is false when GITLAB_SIMULATE_SAAS is true and in test'
do
stub_env
(
'GITLAB_SIMULATE_SAAS'
,
'1'
)
expect
(
described_class
.
com?
).
to
eq
false
end
end
describe
'.com'
do
...
...
@@ -239,8 +246,8 @@ RSpec.describe Gitlab do
stub_env
(
'GITLAB_SIMULATE_SAAS'
,
'1'
)
end
it
'is
tru
e when test env'
do
expect
(
subject
).
to
eq
tru
e
it
'is
fals
e when test env'
do
expect
(
subject
).
to
eq
fals
e
end
it
'is true when dev env'
do
...
...
@@ -249,7 +256,7 @@ RSpec.describe Gitlab do
expect
(
subject
).
to
eq
true
end
it
'is false when env is not dev
or test
'
do
it
'is false when env is not dev'
do
stub_rails_env
(
'production'
)
expect
(
subject
).
to
eq
false
...
...
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