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-07-26 12:17:34 +0300
committerStan Hu <stanhu@gmail.com>2015-07-26 13:47:01 +0300
commit562242cb9dc11f0a5957a58eb9f91a484a909b40 (patch)
treea2e84f4464044c9c9286253d04783a1684934e53 /features
parent4a76cbe21907b92e53b168f3085c19d00be11f0b (diff)
Fix commit data retrieval when branch name has single quotes
Closes #1724
Diffstat (limited to 'features')
-rw-r--r--features/project/source/browse_files.feature7
-rw-r--r--features/steps/project/source/browse_files.rb17
2 files changed, 24 insertions, 0 deletions
diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature
index af68cb96ed9..d3a77466a35 100644
--- a/features/project/source/browse_files.feature
+++ b/features/project/source/browse_files.feature
@@ -158,3 +158,10 @@ Feature: Project Source Browse Files
Given I visit project source page for "6d394385cf567f80a8fd85055db1ab4c5295806f"
And I click on ".gitignore" file in repo
Then I don't see the permalink link
+
+ @javascript
+ Scenario: I browse code with single quotes in the ref
+ Given I switch ref to 'test'
+ And I see the ref 'test' has been selected
+ And I visit the 'test' tree
+ Then I see the commit data
diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb
index 95879b9544d..5cb085db207 100644
--- a/features/steps/project/source/browse_files.rb
+++ b/features/steps/project/source/browse_files.rb
@@ -193,6 +193,23 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
FileUtils.rm_f(File.join(@project.repository.path, 'hooks', 'pre-receive'))
end
+ step "I switch ref to 'test'" do
+ select "'test'", from: 'ref'
+ end
+
+ step "I see the ref 'test' has been selected" do
+ expect(page).to have_selector '.select2-chosen', text: "'test'"
+ end
+
+ step "I visit the 'test' tree" do
+ visit namespace_project_tree_path(@project.namespace, @project, "'test'")
+ end
+
+ step 'I see the commit data' do
+ expect(page).to have_css('.tree-commit-link', visible: true)
+ expect(page).not_to have_content('Loading commit data...')
+ end
+
private
def set_new_content