Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-04-27 07:46:27 +0300
committerStan Hu <stanhu@gmail.com>2015-04-27 09:52:40 +0300
commitef0055b52d85bb9f38c36303d2291ab2a29d0780 (patch)
tree62d36d392c6839c606d611cdb50927129c7bf115 /spec/lib/extracts_path_spec.rb
parent439b9f50af3168d33169a4cd25b59e45ea46dc62 (diff)
Fix bug where commit data would not appear in some subdirectories
The upgrade from Rails v4.1.2 to v4.1.9 (76aad9b76ed) caused slashes in a tree to be escaped automatically. Using wildcard globs prevents this behavior. Closes #1478, #1459
Diffstat (limited to 'spec/lib/extracts_path_spec.rb')
-rw-r--r--spec/lib/extracts_path_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/extracts_path_spec.rb b/spec/lib/extracts_path_spec.rb
index ac602eac154..05bcebaa3a2 100644
--- a/spec/lib/extracts_path_spec.rb
+++ b/spec/lib/extracts_path_spec.rb
@@ -2,6 +2,8 @@ require 'spec_helper'
describe ExtractsPath do
include ExtractsPath
+ include RepoHelpers
+ include Rails.application.routes.url_helpers
let(:project) { double('project') }
@@ -11,6 +13,20 @@ describe ExtractsPath do
project.stub(path_with_namespace: 'gitlab/gitlab-ci')
end
+ describe '#assign_ref' do
+ let(:ref) { sample_commit[:id] }
+ let(:params) { {path: sample_commit[:line_code_path], ref: ref} }
+
+ before do
+ @project = create(:project)
+ end
+
+ it "log tree path should have no escape sequences" do
+ assign_ref_vars
+ expect(@logs_path).to eq("/#{@project.path_with_namespace}/refs/#{ref}/logs_tree/files/ruby/popen.rb")
+ end
+ end
+
describe '#extract_ref' do
it "returns an empty pair when no @project is set" do
@project = nil