summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2015-06-01 14:33:04 +0300
committerValery Sizov <vsv2711@gmail.com>2015-06-03 16:36:54 +0300
commit550bcc8aaab26f94ef6b288c28159be21d11f269 (patch)
tree3958de94cc933bfedbefcf144c37fb9d811169f5 /app/models
parent227ffbc87c0d989c9213e4a4e4b87df0c8d01720 (diff)
downloadgitlab-ci-550bcc8aaab26f94ef6b288c28159be21d11f269.tar.gz
fix specs
Diffstat (limited to 'app/models')
-rw-r--r--app/models/commit.rb4
-rw-r--r--app/models/project_services/hip_chat_message.rb2
2 files changed, 4 insertions, 2 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 14b558f..3bc38b6 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -95,7 +95,7 @@ class Commit < ActiveRecord::Base
filter_param = tag? ? :tags : :branches
config_processor.builds.each do |build_attrs|
if build_attrs[filter_param]
- builds.create!({project: project}.merge(build_attrs.extract!(:name, :commands, :tag_list)))
+ builds.create!({ project: project }.merge(build_attrs.extract!(:name, :commands, :tag_list)))
end
end
end
@@ -116,7 +116,7 @@ class Commit < ActiveRecord::Base
def create_deploy_builds
config_processor.deploy_builds_for_ref(ref).each do |build_attrs|
- builds.create!({project: project}.merge(build_attrs))
+ builds.create!({ project: project }.merge(build_attrs))
end
end
diff --git a/app/models/project_services/hip_chat_message.rb b/app/models/project_services/hip_chat_message.rb
index 3ceed94..db0d58e 100644
--- a/app/models/project_services/hip_chat_message.rb
+++ b/app/models/project_services/hip_chat_message.rb
@@ -8,12 +8,14 @@ class HipChatMessage
def to_s
lines = Array.new
lines.push("<a href=\"#{RoutesHelper.project_url(project)}\">#{project.name}</a> - ")
+
if commit.matrix?
lines.push("<a href=\"#{RoutesHelper.project_ref_commit_url(project, commit.ref, commit.sha)}\">Commit ##{commit.id}</a></br>")
else
first_build = commit.builds_without_retry.first
lines.push("<a href=\"#{RoutesHelper.project_build_url(project, first_build)}\">Build '#{first_build.name}' ##{first_build.id}</a></br>")
end
+
lines.push("#{commit.short_sha} #{commit.git_author_name} - #{commit.git_commit_message}</br>")
lines.push("#{humanized_status(commit_status)} in #{commit.duration} second(s).")
lines.join('')