From 1757e6ef65a1cedbfe5d5b5da894d6d0d3d5ef16 Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Thu, 17 Dec 2015 16:59:15 -0200 Subject: Add JS validation for invalid characters in branch name More info about valid ref names: https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.ht ml --- features/project/commits/branches.feature | 1 + features/steps/project/commits/branches.rb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'features') diff --git a/features/project/commits/branches.feature b/features/project/commits/branches.feature index 5103ca12947..2c17d32154a 100644 --- a/features/project/commits/branches.feature +++ b/features/project/commits/branches.feature @@ -25,6 +25,7 @@ Feature: Project Commits Branches And I click branch 'improve/awesome' delete link Then I should not see branch 'improve/awesome' + @javascript Scenario: I create a branch with invalid name Given I visit project branches page And I click new branch link diff --git a/features/steps/project/commits/branches.rb b/features/steps/project/commits/branches.rb index e9312e87637..109d031d446 100644 --- a/features/steps/project/commits/branches.rb +++ b/features/steps/project/commits/branches.rb @@ -61,7 +61,8 @@ class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps end step 'I should see new an error that branch is invalid' do - expect(page).to have_content "Branch name can't contains space, '~', '^', ':', '?', '*', '[', '\', '..', '@{', and consecutive slashes, start with '/' or '.' or end in '/' or '.' or '.lock'" + expect(page).to have_content 'Branch name is invalid' + expect(page).to have_content "can't contains spaces" end step 'I should see new an error that ref is invalid' do -- cgit v1.2.1