Commit b3b45945 authored by Dylan Griffith's avatar Dylan Griffith

Merge branch '353632-refactor-spec' into 'master'

Refactor work_items/types_resolver_spec. Fix subject

See merge request gitlab-org/gitlab!82424
parents 8e319ab2 55c9b2e5
......@@ -14,16 +14,18 @@ RSpec.describe Resolvers::WorkItems::TypesResolver do
end
shared_examples 'a work item type resolver' do
subject(:result) { resolve(described_class, obj: object) }
let(:args) { {} }
subject(:result) { resolve(described_class, obj: object, args: args) }
it 'returns all default work item types' do
expect(result.to_a).to match(WorkItems::Type.default.order_by_name_asc)
end
context 'when requesting taskable types' do
it 'returns only taskable types' do
result = resolve(described_class, obj: group, args: { taskable: true })
let(:args) { { taskable: true } }
it 'returns only taskable types' do
expect(result.to_a).to contain_exactly(WorkItems::Type.default_by_type(:task))
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment