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:
authorRobert Schilling <rschilling@student.tugraz.at>2014-07-27 21:56:33 +0400
committerRobert Schilling <rschilling@student.tugraz.at>2014-09-03 15:08:36 +0400
commit392113919adc75ba1537d89a0de8d0641e24d5b8 (patch)
tree79c4e5a802592024b3d6621afe4c052bea77ad4e /features
parent551145bc98e257280b615e305d531a44d7aa4131 (diff)
Validate tag-names and references in WebUI, API
Diffstat (limited to 'features')
-rw-r--r--features/project/commits/branches.feature8
-rw-r--r--features/project/commits/tags.feature20
-rw-r--r--features/steps/project/browse_tags.rb46
3 files changed, 69 insertions, 5 deletions
diff --git a/features/project/commits/branches.feature b/features/project/commits/branches.feature
index 6725a697c21..d124cb7eecd 100644
--- a/features/project/commits/branches.feature
+++ b/features/project/commits/branches.feature
@@ -15,7 +15,7 @@ Feature: Project Browse branches
Scenario: I create a branch
Given I visit project branches page
And I click new branch link
- When I submit new branch form
+ And I submit new branch form
Then I should see new branch created
@javascript
@@ -27,17 +27,17 @@ Feature: Project Browse branches
Scenario: I create a branch with invalid name
Given I visit project branches page
And I click new branch link
- When I submit new branch form with invalid name
+ And I submit new branch form with invalid name
Then I should see new an error that branch is invalid
Scenario: I create a branch with invalid reference
Given I visit project branches page
And I click new branch link
- When I submit new branch form with invalid reference
+ And I submit new branch form with invalid reference
Then I should see new an error that ref is invalid
Scenario: I create a branch that already exists
Given I visit project branches page
And I click new branch link
- When I submit new branch form with branch that already exists
+ And I submit new branch form with branch that already exists
Then I should see new an error that branch already exists
diff --git a/features/project/commits/tags.feature b/features/project/commits/tags.feature
index 1ac0f8bfa45..36c7a6492ff 100644
--- a/features/project/commits/tags.feature
+++ b/features/project/commits/tags.feature
@@ -7,5 +7,25 @@ Feature: Project Browse tags
Scenario: I can see all git tags
Then I should see "Shop" all tags list
+ Scenario: I create a tag
+ And I click new tag link
+ And I submit new tag form
+ Then I should see new tag created
+
+ Scenario: I create a tag with invalid name
+ And I click new tag link
+ And I submit new tag form with invalid name
+ Then I should see new an error that tag is invalid
+
+ Scenario: I create a tag with invalid reference
+ And I click new tag link
+ And I submit new tag form with invalid reference
+ Then I should see new an error that tag ref is invalid
+
+ Scenario: I create a tag that already exists
+ And I click new tag link
+ And I submit new tag form with tag that already exists
+ Then I should see new an error that tag already exists
+
# @wip
# Scenario: I can download project by tag
diff --git a/features/steps/project/browse_tags.rb b/features/steps/project/browse_tags.rb
index 7c679911e00..64c0c284f6c 100644
--- a/features/steps/project/browse_tags.rb
+++ b/features/steps/project/browse_tags.rb
@@ -3,8 +3,52 @@ class ProjectBrowseTags < Spinach::FeatureSteps
include SharedProject
include SharedPaths
- Then 'I should see "Shop" all tags list' do
+ step 'I should see "Shop" all tags list' do
page.should have_content "Tags"
page.should have_content "v1.0.0"
end
+
+ step 'I click new tag link' do
+ click_link 'New tag'
+ end
+
+ step 'I submit new tag form' do
+ fill_in 'tag_name', with: 'v7.0'
+ fill_in 'ref', with: 'master'
+ click_button 'Create tag'
+ end
+
+ step 'I submit new tag form with invalid name' do
+ fill_in 'tag_name', with: 'v 1.0'
+ fill_in 'ref', with: 'master'
+ click_button 'Create tag'
+ end
+
+ step 'I submit new tag form with invalid reference' do
+ fill_in 'tag_name', with: 'foo'
+ fill_in 'ref', with: 'foo'
+ click_button 'Create tag'
+ end
+
+ step 'I submit new tag form with tag that already exists' do
+ fill_in 'tag_name', with: 'v1.0.0'
+ fill_in 'ref', with: 'master'
+ click_button 'Create tag'
+ end
+
+ step 'I should see new tag created' do
+ page.should have_content 'v7.0'
+ end
+
+ step 'I should see new an error that tag is invalid' do
+ page.should have_content 'Tag name invalid'
+ end
+
+ step 'I should see new an error that tag ref is invalid' do
+ page.should have_content 'Invalid reference name'
+ end
+
+ step 'I should see new an error that tag already exists' do
+ page.should have_content 'Tag already exists'
+ end
end