2019-07-31 22:56:46 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
RSpec.shared_examples 'assignee ID filter' do
|
2019-07-31 22:56:46 +05:30
|
|
|
it 'returns issuables assigned to that user' do
|
|
|
|
expect(issuables).to contain_exactly(*expected_issuables)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
RSpec.shared_examples 'assignee NOT ID filter' do
|
2019-12-04 20:38:33 +05:30
|
|
|
it 'returns issuables not assigned to that user' do
|
|
|
|
expect(issuables).to contain_exactly(*expected_issuables)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
RSpec.shared_examples 'assignee username filter' do
|
2019-07-31 22:56:46 +05:30
|
|
|
it 'returns issuables assigned to those users' do
|
|
|
|
expect(issuables).to contain_exactly(*expected_issuables)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
RSpec.shared_examples 'assignee NOT username filter' do
|
2019-12-04 20:38:33 +05:30
|
|
|
it 'returns issuables not assigned to those users' do
|
|
|
|
expect(issuables).to contain_exactly(*expected_issuables)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-09-04 01:27:46 +05:30
|
|
|
RSpec.shared_examples 'assignee OR filter' do
|
|
|
|
it 'returns issuables assigned to the given users' do
|
|
|
|
expect(issuables).to contain_exactly(*expected_issuables)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
RSpec.shared_examples 'no assignee filter' do
|
2019-07-31 22:56:46 +05:30
|
|
|
let(:params) { { assignee_id: 'None' } }
|
|
|
|
|
|
|
|
it 'returns issuables not assigned to any assignee' do
|
|
|
|
expect(issuables).to contain_exactly(*expected_issuables)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'returns issuables not assigned to any assignee' do
|
|
|
|
params[:assignee_id] = 'none'
|
|
|
|
|
|
|
|
expect(issuables).to contain_exactly(*expected_issuables)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
RSpec.shared_examples 'any assignee filter' do
|
2019-07-31 22:56:46 +05:30
|
|
|
context '' do
|
|
|
|
let(:params) { { assignee_id: 'Any' } }
|
|
|
|
|
|
|
|
it 'returns issuables assigned to any assignee' do
|
|
|
|
expect(issuables).to contain_exactly(*expected_issuables)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'returns issuables assigned to any assignee' do
|
|
|
|
params[:assignee_id] = 'any'
|
|
|
|
|
|
|
|
expect(issuables).to contain_exactly(*expected_issuables)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|