|
|
|
@ -81,9 +81,6 @@ describe 'Query selection', type: :feature do |
|
|
|
|
context 'when a query is selected' do |
|
|
|
|
before do |
|
|
|
|
work_packages_page.select_query query |
|
|
|
|
# ensure the page is loaded before expecting anything |
|
|
|
|
find('.advanced-filters--filters select option', text: /\AStart date\Z/, |
|
|
|
|
visible: false) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it 'shows the saved filters', js: true do |
|
|
|
@ -96,4 +93,20 @@ describe 'Query selection', type: :feature do |
|
|
|
|
expect(find_button('Activate Filter')).to have_text /2$/ |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context 'when the selected query is changed' do |
|
|
|
|
let!(:query2) do |
|
|
|
|
FactoryGirl.create(:query, project: project, is_public: true) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
work_packages_page.select_query query |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it 'updates the page upon query switching', js: true do |
|
|
|
|
work_packages_page.expect_query(query) |
|
|
|
|
work_packages_page.select_query_from_dropdown(query2) |
|
|
|
|
work_packages_page.expect_query(query2) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|