|
|
|
@ -60,6 +60,28 @@ describe Query, type: :model do |
|
|
|
|
expect(query.sort_criteria) |
|
|
|
|
.to match_array([['id', 'asc']]) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context 'with global subprojects include', with_settings: { display_subprojects_work_packages: true } do |
|
|
|
|
it 'sets the include subprojects' do |
|
|
|
|
expect(query.include_subprojects).to eq true |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context 'with global subprojects include', with_settings: { display_subprojects_work_packages: false } do |
|
|
|
|
it 'sets the include subprojects' do |
|
|
|
|
expect(query.include_subprojects).to eq false |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe 'include_subprojects' do |
|
|
|
|
let(:query) { Query.new name: 'foo' } |
|
|
|
|
|
|
|
|
|
it 'is required' do |
|
|
|
|
expect(query).not_to be_valid |
|
|
|
|
|
|
|
|
|
expect(query.errors[:include_subprojects]).to include 'is not set to one of the allowed values.' |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe 'hidden' do |
|
|
|
|