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
70678066
Commit
70678066
authored
Mar 11, 2019
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a few tests for fake applications
parent
364791c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
spec/lib/gitlab/fake_application_settings_spec.rb
spec/lib/gitlab/fake_application_settings_spec.rb
+53
-0
No files found.
spec/lib/gitlab/fake_application_settings_spec.rb
View file @
70678066
...
@@ -29,4 +29,57 @@ describe Gitlab::FakeApplicationSettings do
...
@@ -29,4 +29,57 @@ describe Gitlab::FakeApplicationSettings do
it
'does not override an existing predicate method'
do
it
'does not override an existing predicate method'
do
expect
(
subject
.
test?
).
to
eq
(
123
)
expect
(
subject
.
test?
).
to
eq
(
123
)
end
end
describe
'#commit_email_hostname'
do
context
'when the value is provided'
do
let
(
:defaults
)
{
{
commit_email_hostname:
'localhost'
}
}
it
'returns the provided value'
do
expect
(
subject
.
commit_email_hostname
).
to
eq
(
'localhost'
)
end
end
context
'when the value is not provided'
do
it
'returns the default from the class'
do
expect
(
subject
.
commit_email_hostname
)
.
to
eq
(
described_class
.
default_commit_email_hostname
)
end
end
end
describe
'#usage_ping_enabled'
do
context
'when usage ping can be configured'
do
before
do
allow
(
Settings
.
gitlab
)
.
to
receive
(
:usage_ping_enabled
).
and_return
(
true
)
end
it
'returns the value provided'
do
subject
.
usage_ping_enabled
=
true
expect
(
subject
.
usage_ping_enabled
).
to
eq
(
true
)
subject
.
usage_ping_enabled
=
false
expect
(
subject
.
usage_ping_enabled
).
to
eq
(
false
)
end
end
context
'when usage ping cannot be configured'
do
before
do
allow
(
Settings
.
gitlab
)
.
to
receive
(
:usage_ping_enabled
).
and_return
(
false
)
end
it
'always returns false'
do
subject
.
usage_ping_enabled
=
true
expect
(
subject
.
usage_ping_enabled
).
to
eq
(
false
)
subject
.
usage_ping_enabled
=
false
expect
(
subject
.
usage_ping_enabled
).
to
eq
(
false
)
end
end
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