2019-07-25 05:24:42 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-08-29 07:56:52 +00:00
|
|
|
require 'spec_helper'
|
2016-12-16 22:25:52 +00:00
|
|
|
|
2017-06-29 04:13:10 +00:00
|
|
|
describe 'Dropdown milestone', :js do
|
2017-01-30 22:53:18 +00:00
|
|
|
include FilteredSearchHelpers
|
2016-12-16 22:25:52 +00:00
|
|
|
|
2017-08-02 19:55:11 +00:00
|
|
|
let!(:project) { create(:project) }
|
2016-12-16 22:25:52 +00:00
|
|
|
let!(:user) { create(:user) }
|
|
|
|
let!(:milestone) { create(:milestone, title: 'v1.0', project: project) }
|
|
|
|
let!(:uppercase_milestone) { create(:milestone, title: 'CAP_MILESTONE', project: project) }
|
|
|
|
|
|
|
|
let(:filtered_search) { find('.filtered-search') }
|
2019-12-20 21:08:00 +00:00
|
|
|
let(:filter_dropdown) { find('#js-dropdown-milestone .filter-dropdown') }
|
2016-12-16 22:25:52 +00:00
|
|
|
|
|
|
|
before do
|
2018-07-11 14:36:08 +00:00
|
|
|
project.add_maintainer(user)
|
2017-06-21 23:44:10 +00:00
|
|
|
sign_in(user)
|
2016-12-16 22:25:52 +00:00
|
|
|
create(:issue, project: project)
|
|
|
|
|
2017-07-06 16:20:50 +00:00
|
|
|
visit project_issues_path(project)
|
2016-12-16 22:25:52 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
describe 'behavior' do
|
|
|
|
before do
|
2020-03-04 09:08:20 +00:00
|
|
|
filtered_search.set('milestone:=')
|
2017-03-10 19:01:05 +00:00
|
|
|
end
|
2017-01-23 19:12:02 +00:00
|
|
|
|
2019-12-20 21:08:00 +00:00
|
|
|
it 'loads all the milestones when opened' do
|
|
|
|
expect_filtered_search_dropdown_results(filter_dropdown, 2)
|
2017-01-23 19:12:02 +00:00
|
|
|
end
|
|
|
|
end
|
2016-12-16 22:25:52 +00:00
|
|
|
end
|