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
d1cca892
Commit
d1cca892
authored
Aug 28, 2019
by
Ash McKenzie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use new RailsHelpers module
parent
e6ffb35b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
ee/spec/lib/gitlab/favicon_spec.rb
ee/spec/lib/gitlab/favicon_spec.rb
+3
-1
spec/lib/gitlab/favicon_spec.rb
spec/lib/gitlab/favicon_spec.rb
+5
-3
spec/lib/gitlab_spec.rb
spec/lib/gitlab_spec.rb
+4
-4
No files found.
ee/spec/lib/gitlab/favicon_spec.rb
View file @
d1cca892
...
@@ -3,9 +3,11 @@
...
@@ -3,9 +3,11 @@
require
'rails_helper'
require
'rails_helper'
RSpec
.
describe
Gitlab
::
Favicon
,
:request_store
do
RSpec
.
describe
Gitlab
::
Favicon
,
:request_store
do
include
RailsHelpers
describe
'.main'
do
describe
'.main'
do
it
'has green favicon for development'
do
it
'has green favicon for development'
do
allow
(
Rails
).
to
receive
(
:env
).
and_return
(
ActiveSupport
::
StringInquirer
.
new
(
'development'
)
)
stub_rails_env
(
'development'
)
expect
(
described_class
.
main
).
to
match_asset_path
'favicon-green.png'
expect
(
described_class
.
main
).
to
match_asset_path
'favicon-green.png'
end
end
end
end
...
...
spec/lib/gitlab/favicon_spec.rb
View file @
d1cca892
require
'rails_helper'
require
'rails_helper'
RSpec
.
describe
Gitlab
::
Favicon
,
:request_store
do
RSpec
.
describe
Gitlab
::
Favicon
,
:request_store
do
include
RailsHelpers
describe
'.main'
do
describe
'.main'
do
it
'defaults to favicon.png'
do
it
'defaults to favicon.png'
do
allow
(
Rails
).
to
receive
(
:env
).
and_return
(
ActiveSupport
::
StringInquirer
.
new
(
'production'
)
)
stub_rails_env
(
'production'
)
expect
(
described_class
.
main
).
to
match_asset_path
'/assets/favicon.png'
expect
(
described_class
.
main
).
to
match_asset_path
'/assets/favicon.png'
end
end
it
'has blue favicon for development'
,
unless:
Gitlab
.
ee?
do
it
'has blue favicon for development'
,
unless:
Gitlab
.
ee?
do
allow
(
Rails
).
to
receive
(
:env
).
and_return
(
ActiveSupport
::
StringInquirer
.
new
(
'development'
)
)
stub_rails_env
(
'development'
)
expect
(
described_class
.
main
).
to
match_asset_path
'/assets/favicon-blue.png'
expect
(
described_class
.
main
).
to
match_asset_path
'/assets/favicon-blue.png'
end
end
...
@@ -24,7 +26,7 @@ RSpec.describe Gitlab::Favicon, :request_store do
...
@@ -24,7 +26,7 @@ RSpec.describe Gitlab::Favicon, :request_store do
context
'asset host'
do
context
'asset host'
do
before
do
before
do
allow
(
Rails
).
to
receive
(
:env
).
and_return
(
ActiveSupport
::
StringInquirer
.
new
(
'production'
)
)
stub_rails_env
(
'production'
)
end
end
it
'returns a relative url when the asset host is not configured'
do
it
'returns a relative url when the asset host is not configured'
do
...
...
spec/lib/gitlab_spec.rb
View file @
d1cca892
# frozen_string_literal: true
# frozen_string_literal: true
require
'fast_spec_helper'
require
'spec_helper'
require_dependency
'gitlab'
describe
Gitlab
do
describe
Gitlab
do
include
RailsHelpers
describe
'.root'
do
describe
'.root'
do
it
'returns the root path of the app'
do
it
'returns the root path of the app'
do
expect
(
described_class
.
root
).
to
eq
(
Pathname
.
new
(
File
.
expand_path
(
'../..'
,
__dir__
)))
expect
(
described_class
.
root
).
to
eq
(
Pathname
.
new
(
File
.
expand_path
(
'../..'
,
__dir__
)))
...
@@ -113,7 +113,7 @@ describe Gitlab do
...
@@ -113,7 +113,7 @@ describe Gitlab do
it
'is true when dev env'
do
it
'is true when dev env'
do
allow
(
described_class
).
to
receive_messages
(
com?:
false
,
org?:
false
)
allow
(
described_class
).
to
receive_messages
(
com?:
false
,
org?:
false
)
allow
(
Rails
).
to
receive
(
:env
).
and_return
(
ActiveSupport
::
StringInquirer
.
new
(
'development'
)
)
stub_rails_env
(
'development'
)
expect
(
described_class
.
dev_env_org_or_com?
).
to
eq
true
expect
(
described_class
.
dev_env_org_or_com?
).
to
eq
true
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