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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
84290a45
Commit
84290a45
authored
Dec 13, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it possible to mix `Gitlab::Routing` in
parent
00970606
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
lib/gitlab/ci/status/core.rb
lib/gitlab/ci/status/core.rb
+1
-1
lib/gitlab/routing.rb
lib/gitlab/routing.rb
+6
-0
spec/lib/gitlab/routing_spec.rb
spec/lib/gitlab/routing_spec.rb
+23
-0
No files found.
lib/gitlab/ci/status/core.rb
View file @
84290a45
...
...
@@ -4,7 +4,7 @@ module Gitlab
# Base abstract class fore core status
#
class
Core
include
Gitlab
::
Routing
.
url_helpers
include
Gitlab
::
Routing
include
Gitlab
::
Allowable
attr_reader
:subject
,
:user
...
...
lib/gitlab/routing.rb
View file @
84290a45
module
Gitlab
module
Routing
extend
ActiveSupport
::
Concern
included
do
include
Gitlab
::
Routing
.
url_helpers
end
# Returns the URL helpers Module.
#
# This method caches the output as Rails' "url_helpers" method creates an
...
...
spec/lib/gitlab/routing_spec.rb
0 → 100644
View file @
84290a45
require
'spec_helper'
describe
Gitlab
::
Routing
do
context
'when module is included'
do
subject
do
Class
.
new
.
include
(
described_class
).
new
end
it
'makes it possible to access url helpers'
do
expect
(
subject
).
to
respond_to
(
:namespace_project_path
)
end
end
context
'when module is not included'
do
subject
do
Class
.
new
.
include
(
described_class
.
url_helpers
).
new
end
it
'exposes url helpers module through a method'
do
expect
(
subject
).
to
respond_to
(
:namespace_project_path
)
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