diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-01-29 22:01:31 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-06 16:12:24 -0600 |
commit | 3aa1264dc6c0de3625bb1a2d6a0ee90140a2f519 (patch) | |
tree | 73b450be24d8ea336adedca5dc2ed2edd02474c6 /app | |
parent | 8f85a11d9fcc1f4ccde7c46652f0be00edf46a78 (diff) | |
download | gitlab-ce-3aa1264dc6c0de3625bb1a2d6a0ee90140a2f519.tar.gz |
Add tests
Diffstat (limited to 'app')
-rw-r--r-- | app/models/ci/pipeline.rb | 2 | ||||
-rw-r--r-- | app/models/project.rb | 6 | ||||
-rw-r--r-- | app/models/repository.rb | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 8db53ea56dd..70bb4a224a1 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -283,7 +283,7 @@ module Ci def ci_yaml_file return @ci_yaml_file if defined?(@ci_yaml_file) - @ci_yaml_file ||= project.repository.ci_yaml_file(sha) + @ci_yaml_file ||= project.repository.gitlab_ci_yml_for(sha) end def has_yaml_errors? diff --git a/app/models/project.rb b/app/models/project.rb index 42a79557136..15c6e25e73f 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1342,10 +1342,10 @@ class Project < ActiveRecord::Base end end - def route_map_for_commit(commit_sha) + def route_map_for(commit_sha) @route_maps_by_commit ||= Hash.new do |h, sha| h[sha] = begin - data = repository.route_map_file(sha) + data = repository.route_map_for(sha) next unless data Gitlab::RouteMap.new(data) @@ -1358,7 +1358,7 @@ class Project < ActiveRecord::Base end def public_path_for_source_path(path, commit_sha) - map = route_map_for_commit(commit_sha) + map = route_map_for(commit_sha) return unless map map.public_path_for_source_path(path) diff --git a/app/models/repository.rb b/app/models/repository.rb index 9aa0cc250f0..ba9c038b66d 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -1187,14 +1187,14 @@ class Repository end end - def route_map_file(sha) + def route_map_for(sha) blob = blob_at(sha, ROUTE_MAP_PATH) return unless blob blob.load_all_data!(self) blob.data end - def ci_yaml_file(sha) + def gitlab_ci_yml_for(sha) blob = blob_at(sha, GITLAB_CI_YML_PATH) return unless blob blob.load_all_data!(self) |