2014-10-02 16:42:54 +00:00
|
|
|
class Spinach::Features::ProjectIssuesFilterLabels < Spinach::FeatureSteps
|
2014-02-17 14:54:19 +00:00
|
|
|
include SharedAuthentication
|
|
|
|
include SharedProject
|
|
|
|
include SharedPaths
|
2015-03-27 07:27:51 +00:00
|
|
|
include Select2Helper
|
2014-02-17 14:54:19 +00:00
|
|
|
|
2014-07-30 12:15:39 +00:00
|
|
|
step 'I should see "Bugfix1" in issues list' do
|
2015-06-12 05:36:00 +00:00
|
|
|
page.within ".issues-list" do
|
2015-06-12 04:44:13 +00:00
|
|
|
expect(page).to have_content "Bugfix1"
|
2014-02-17 14:54:19 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-07-30 12:15:39 +00:00
|
|
|
step 'I should see "Bugfix2" in issues list' do
|
2015-06-12 05:36:00 +00:00
|
|
|
page.within ".issues-list" do
|
2015-06-12 04:44:13 +00:00
|
|
|
expect(page).to have_content "Bugfix2"
|
2014-02-17 14:54:19 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-07-30 12:15:39 +00:00
|
|
|
step 'I should not see "Bugfix2" in issues list' do
|
2015-06-12 05:36:00 +00:00
|
|
|
page.within ".issues-list" do
|
2015-06-12 04:44:13 +00:00
|
|
|
expect(page).not_to have_content "Bugfix2"
|
2014-02-17 14:54:19 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-07-30 12:15:39 +00:00
|
|
|
step 'I should not see "Feature1" in issues list' do
|
2015-06-12 05:36:00 +00:00
|
|
|
page.within ".issues-list" do
|
2015-06-12 04:44:13 +00:00
|
|
|
expect(page).not_to have_content "Feature1"
|
2014-02-17 14:54:19 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-07-30 12:15:39 +00:00
|
|
|
step 'I click link "bug"' do
|
2016-04-27 16:24:11 +00:00
|
|
|
page.find('.js-label-select', visible: true).click
|
2016-03-09 13:34:39 +00:00
|
|
|
sleep 0.5
|
|
|
|
execute_script("$('.dropdown-menu-labels li:contains(\"bug\") a').click()")
|
2016-04-14 10:16:24 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I click "dropdown close button"' do
|
|
|
|
page.first('.labels-filter .dropdown-title .dropdown-menu-close-icon').click
|
2016-03-09 13:34:39 +00:00
|
|
|
sleep 2
|
2014-02-17 14:54:19 +00:00
|
|
|
end
|
|
|
|
|
2014-07-30 12:15:39 +00:00
|
|
|
step 'I click link "feature"' do
|
2015-06-12 05:36:00 +00:00
|
|
|
page.within ".labels-filter" do
|
2014-07-30 12:15:39 +00:00
|
|
|
click_link "feature"
|
|
|
|
end
|
2014-02-17 14:54:19 +00:00
|
|
|
end
|
|
|
|
|
2014-07-30 12:15:39 +00:00
|
|
|
step 'project "Shop" has issue "Bugfix1" with labels: "bug", "feature"' do
|
2014-02-17 14:54:19 +00:00
|
|
|
project = Project.find_by(name: "Shop")
|
2014-07-30 12:15:39 +00:00
|
|
|
issue = create(:issue, title: "Bugfix1", project: project)
|
|
|
|
issue.labels << project.labels.find_by(title: 'bug')
|
|
|
|
issue.labels << project.labels.find_by(title: 'feature')
|
2014-02-17 14:54:19 +00:00
|
|
|
end
|
|
|
|
|
2014-07-30 12:15:39 +00:00
|
|
|
step 'project "Shop" has issue "Bugfix2" with labels: "bug", "enhancement"' do
|
2014-02-17 14:54:19 +00:00
|
|
|
project = Project.find_by(name: "Shop")
|
2014-07-30 12:15:39 +00:00
|
|
|
issue = create(:issue, title: "Bugfix2", project: project)
|
|
|
|
issue.labels << project.labels.find_by(title: 'bug')
|
|
|
|
issue.labels << project.labels.find_by(title: 'enhancement')
|
2014-02-17 14:54:19 +00:00
|
|
|
end
|
|
|
|
|
2014-07-30 12:15:39 +00:00
|
|
|
step 'project "Shop" has issue "Feature1" with labels: "feature"' do
|
2014-02-17 14:54:19 +00:00
|
|
|
project = Project.find_by(name: "Shop")
|
2014-07-30 12:15:39 +00:00
|
|
|
issue = create(:issue, title: "Feature1", project: project)
|
|
|
|
issue.labels << project.labels.find_by(title: 'feature')
|
2014-02-17 14:54:19 +00:00
|
|
|
end
|
|
|
|
end
|