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
Boxiang Sun
gitlab-ce
Commits
d6036f08
Commit
d6036f08
authored
Jan 03, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move activated? method to service
parent
ce84e3f4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
app/models/gitlab_ci_service.rb
app/models/gitlab_ci_service.rb
+0
-4
app/models/service.rb
app/models/service.rb
+4
-0
spec/models/gitlab_ci_service_spec.rb
spec/models/gitlab_ci_service_spec.rb
+4
-0
No files found.
app/models/gitlab_ci_service.rb
View file @
d6036f08
...
...
@@ -23,10 +23,6 @@ class GitlabCiService < Service
after_save
:compose_service_hook
,
if: :activated?
def
activated?
active
end
def
compose_service_hook
hook
=
service_hook
||
build_service_hook
hook
.
url
=
[
project_url
,
"/build"
,
"?token=
#{
token
}
"
].
join
(
""
)
...
...
app/models/service.rb
View file @
d6036f08
...
...
@@ -20,4 +20,8 @@ class Service < ActiveRecord::Base
has_one
:service_hook
validates
:project_id
,
presence:
true
def
activated?
active
end
end
spec/models/gitlab_ci_service_spec.rb
View file @
d6036f08
...
...
@@ -42,5 +42,9 @@ describe GitlabCiService do
describe
:commit_status_path
do
it
{
@service
.
commit_status_path
(
"2ab7834c"
).
should
==
"http://ci.gitlab.org/projects/2/builds/2ab7834c/status.json?token=verySecret"
}
end
describe
:build_page
do
it
{
@service
.
build_page
(
"2ab7834c"
).
should
==
"http://ci.gitlab.org/projects/2/builds/2ab7834c"
}
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