OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/spec/features/work_packages/table/invalid_query_spec.rb

47 lines
1.2 KiB

require 'spec_helper'
describe 'Invalid query spec', js: true do
let(:user) { FactoryGirl.create :admin }
let(:project) { FactoryGirl.create :project }
let(:wp_table) { ::Pages::WorkPackagesTable.new }
let(:filters) { ::Components::WorkPackages::Filters.new }
let(:member) do
FactoryGirl.create(:member,
user: user,
project: project,
roles: [FactoryGirl.create(:role)])
end
let(:status) do
FactoryGirl.create(:status)
end
let(:query) do
query = FactoryGirl.create(:query,
project: project,
user: user)
query.add_filter('assigned_to_id', '=', [99999])
query.save!(validate: false)
query
end
before do
login_as(user)
status
member
wp_table.visit_query(query)
end
# Regression test for bug #24114 (broken watcher filter)
it 'should load the faulty query' do
expect(page).to have_selector(".notification-box.-error", text: I18n.t('js.work_packages.faulty_query.description'), wait: 10)
filters.open
filters.expect_filter_count 2
expect(page).to have_select('values-assignee', selected: I18n.t('js.placeholders.selection'))
end
end