2015-06-24 22:07:29 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2015-06-28 20:19:52 +00:00
|
|
|
feature 'Issue filtering by Milestone', feature: true do
|
2015-06-24 22:07:29 +00:00
|
|
|
include Select2Helper
|
|
|
|
|
2015-06-28 20:19:52 +00:00
|
|
|
let(:project) { create(:project) }
|
2015-06-24 22:07:29 +00:00
|
|
|
|
|
|
|
before do
|
|
|
|
login_as(:admin)
|
|
|
|
end
|
|
|
|
|
|
|
|
scenario 'User filters by Issues without a Milestone', js: true do
|
|
|
|
create(:issue, project: project)
|
|
|
|
|
|
|
|
visit_issues
|
2015-06-28 20:12:32 +00:00
|
|
|
filter_by_milestone(Milestone::None.title)
|
2015-06-24 22:07:29 +00:00
|
|
|
|
|
|
|
expect(page).to have_css('.issue-title', count: 1)
|
|
|
|
end
|
|
|
|
|
|
|
|
scenario 'User filters by Issues with a specific Milestone', js: true do
|
|
|
|
milestone = create(:milestone, project: project)
|
|
|
|
create(:issue, project: project, milestone: milestone)
|
|
|
|
|
|
|
|
visit_issues
|
|
|
|
filter_by_milestone(milestone.title)
|
|
|
|
|
|
|
|
expect(page).to have_css('.issue-title', count: 1)
|
|
|
|
end
|
|
|
|
|
|
|
|
def visit_issues
|
|
|
|
visit namespace_project_issues_path(project.namespace, project)
|
|
|
|
end
|
|
|
|
|
|
|
|
def filter_by_milestone(title)
|
|
|
|
select2(title, from: '#milestone_title')
|
|
|
|
end
|
|
|
|
end
|