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:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-07-31 15:06:14 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-07-31 15:06:14 +0400
commit0f4748873d927a6650c4056ae846151c33de8936 (patch)
treef229d0579bcac4cb8a8ebb770d6220a9f522bc56 /features
parent3ed2fce208474face31a6df2dbbdc60b49826238 (diff)
Project labels tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'features')
-rw-r--r--features/project/issues/labels.feature17
-rw-r--r--features/steps/project/labels.rb48
-rw-r--r--features/steps/shared/paths.rb4
3 files changed, 66 insertions, 3 deletions
diff --git a/features/project/issues/labels.feature b/features/project/issues/labels.feature
index 3c6a63ced2b..4a37b6dc9fa 100644
--- a/features/project/issues/labels.feature
+++ b/features/project/issues/labels.feature
@@ -5,6 +5,21 @@ Feature: Project Labels
And project "Shop" has labels: "bug", "feature", "enhancement"
Given I visit project "Shop" labels page
- Scenario: I should see active milestones
+ Scenario: I should see labels list
Then I should see label "bug"
And I should see label "feature"
+
+ Scenario: I create new label
+ Given I visit new label page
+ When I submit new label 'support'
+ Then I should see label 'support'
+
+ Scenario: I edit label
+ Given I visit 'bug' label edit page
+ When I change label 'bug' to 'fix'
+ Then I should not see label 'bug'
+ Then I should see label 'fix'
+
+ Scenario: I remove label
+ When I remove label 'bug'
+ Then I should not see label 'bug'
diff --git a/features/steps/project/labels.rb b/features/steps/project/labels.rb
index 6e792e94342..3d9aa29299c 100644
--- a/features/steps/project/labels.rb
+++ b/features/steps/project/labels.rb
@@ -3,15 +3,59 @@ class ProjectLabels < Spinach::FeatureSteps
include SharedProject
include SharedPaths
- Then 'I should see label "bug"' do
+ step 'I should see label "bug"' do
within ".manage-labels-list" do
page.should have_content "bug"
end
end
- And 'I should see label "feature"' do
+ step 'I should see label "feature"' do
within ".manage-labels-list" do
page.should have_content "feature"
end
end
+
+ step 'I visit \'bug\' label edit page' do
+ visit edit_project_label_path(project, bug_label)
+ end
+
+ step 'I remove label \'bug\'' do
+ within "#label_#{bug_label.id}" do
+ click_link 'Remove'
+ end
+ end
+
+ step 'I submit new label \'support\'' do
+ fill_in 'Title', with: 'support'
+ fill_in 'Background Color', with: '#F95610'
+ click_button 'Save'
+ end
+
+ step 'I should not see label \'bug\'' do
+ within '.manage-labels-list' do
+ page.should_not have_content 'bug'
+ end
+ end
+
+ step 'I should see label \'support\'' do
+ within '.manage-labels-list' do
+ page.should have_content 'support'
+ end
+ end
+
+ step 'I change label \'bug\' to \'fix\'' do
+ fill_in 'Title', with: 'fix'
+ fill_in 'Background Color', with: '#F15610'
+ click_button 'Save'
+ end
+
+ step 'I should see label \'fix\'' do
+ within '.manage-labels-list' do
+ page.should have_content 'fix'
+ end
+ end
+
+ def bug_label
+ project.labels.find_or_create_by(title: 'bug')
+ end
end
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb
index ab1ae31ed74..21cc8da6d7c 100644
--- a/features/steps/shared/paths.rb
+++ b/features/steps/shared/paths.rb
@@ -289,6 +289,10 @@ module SharedPaths
visit project_labels_path(project)
end
+ step 'I visit new label page' do
+ visit new_project_label_path(project)
+ end
+
step 'I visit merge request page "Bug NS-04"' do
mr = MergeRequest.find_by(title: "Bug NS-04")
visit project_merge_request_path(mr.target_project, mr)