2012-09-10 12:34:01 +00:00
|
|
|
class ProjectLabels < Spinach::FeatureSteps
|
2012-09-10 15:35:03 +00:00
|
|
|
include SharedAuthentication
|
|
|
|
include SharedProject
|
|
|
|
include SharedPaths
|
|
|
|
|
2014-07-31 11:06:14 +00:00
|
|
|
step 'I should see label "bug"' do
|
2014-07-30 13:05:43 +00:00
|
|
|
within ".manage-labels-list" do
|
2012-09-10 12:34:01 +00:00
|
|
|
page.should have_content "bug"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-07-31 11:06:14 +00:00
|
|
|
step 'I should see label "feature"' do
|
2014-07-30 13:05:43 +00:00
|
|
|
within ".manage-labels-list" do
|
2012-09-10 12:34:01 +00:00
|
|
|
page.should have_content "feature"
|
|
|
|
end
|
|
|
|
end
|
2014-07-31 11:06:14 +00:00
|
|
|
|
|
|
|
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
|
2012-09-10 12:34:01 +00:00
|
|
|
end
|