debian-mirror-gitlab/features/steps/project/issues/labels.rb

101 lines
2.5 KiB
Ruby
Raw Normal View History

2015-04-26 12:48:37 +05:30
class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps
2014-09-02 18:07:02 +05:30
include SharedAuthentication
include SharedProject
include SharedPaths
2015-04-26 12:48:37 +05:30
step 'I visit \'bug\' label edit page' do
2017-09-10 17:25:29 +05:30
visit edit_project_label_path(project, bug_label)
2014-09-02 18:07:02 +05:30
end
2015-04-26 12:48:37 +05:30
step 'I remove label \'bug\'' do
2016-11-03 12:29:30 +05:30
page.within "#project_label_#{bug_label.id}" do
first(:link, 'Delete').click
2014-09-02 18:07:02 +05:30
end
end
2015-04-26 12:48:37 +05:30
step 'I delete all labels' do
2015-09-11 14:41:01 +05:30
page.within '.labels' do
2017-08-17 22:00:37 +05:30
page.all('.remove-row').each do
first('.remove-row').click
2015-04-26 12:48:37 +05:30
end
end
2014-09-02 18:07:02 +05:30
end
2015-04-26 12:48:37 +05:30
step 'I should see labels help message' do
2015-09-11 14:41:01 +05:30
page.within '.labels' do
2017-08-17 22:00:37 +05:30
expect(page).to have_content 'Generate a default set of labels'
expect(page).to have_content 'New label'
2014-09-02 18:07:02 +05:30
end
end
step 'I submit new label \'support\'' do
fill_in 'Title', with: 'support'
2015-12-23 02:04:40 +05:30
fill_in 'Background color', with: '#F95610'
2017-08-17 22:00:37 +05:30
click_button 'Create label'
2014-09-02 18:07:02 +05:30
end
step 'I submit new label \'bug\'' do
fill_in 'Title', with: 'bug'
2015-12-23 02:04:40 +05:30
fill_in 'Background color', with: '#F95610'
2017-08-17 22:00:37 +05:30
click_button 'Create label'
2014-09-02 18:07:02 +05:30
end
step 'I submit new label with invalid color' do
fill_in 'Title', with: 'support'
2015-12-23 02:04:40 +05:30
fill_in 'Background color', with: '#12'
2017-08-17 22:00:37 +05:30
click_button 'Create label'
2014-09-02 18:07:02 +05:30
end
step 'I should see label label exist error message' do
2015-09-11 14:41:01 +05:30
page.within '.label-form' do
expect(page).to have_content 'Title has already been taken'
2014-09-02 18:07:02 +05:30
end
end
step 'I should see label color error message' do
2015-09-11 14:41:01 +05:30
page.within '.label-form' do
2015-12-23 02:04:40 +05:30
expect(page).to have_content 'Color must be a valid color code'
2014-09-02 18:07:02 +05:30
end
end
2015-04-26 12:48:37 +05:30
step 'I should see label \'feature\'' do
page.within '.other-labels .manage-labels-list' do
2015-09-11 14:41:01 +05:30
expect(page).to have_content 'feature'
2015-04-26 12:48:37 +05:30
end
end
2014-09-02 18:07:02 +05:30
step 'I should see label \'bug\'' do
page.within '.other-labels .manage-labels-list' do
2015-09-11 14:41:01 +05:30
expect(page).to have_content 'bug'
2014-09-02 18:07:02 +05:30
end
end
step 'I should not see label \'bug\'' do
page.within '.other-labels .manage-labels-list' do
2015-09-11 14:41:01 +05:30
expect(page).not_to have_content 'bug'
2014-09-02 18:07:02 +05:30
end
end
step 'I should see label \'support\'' do
page.within '.other-labels .manage-labels-list' do
2015-09-11 14:41:01 +05:30
expect(page).to have_content 'support'
2014-09-02 18:07:02 +05:30
end
end
step 'I change label \'bug\' to \'fix\'' do
fill_in 'Title', with: 'fix'
2015-12-23 02:04:40 +05:30
fill_in 'Background color', with: '#F15610'
click_button 'Save changes'
2014-09-02 18:07:02 +05:30
end
step 'I should see label \'fix\'' do
page.within '.other-labels .manage-labels-list' do
2015-09-11 14:41:01 +05:30
expect(page).to have_content 'fix'
2014-09-02 18:07:02 +05:30
end
end
def bug_label
project.labels.find_or_create_by(title: 'bug')
end
end