diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-16 15:09:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-16 15:09:26 +0300 |
commit | b019dc959ec16b15fe42a680dbd729542ff61537 (patch) | |
tree | cde5c3d0582bd7542e1e195d83ad7a50079f4e49 /spec/graphql/resolvers/crm/organizations_resolver_spec.rb | |
parent | b7b44de429911864686599ef1643baf525bf75ec (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/graphql/resolvers/crm/organizations_resolver_spec.rb')
-rw-r--r-- | spec/graphql/resolvers/crm/organizations_resolver_spec.rb | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/spec/graphql/resolvers/crm/organizations_resolver_spec.rb b/spec/graphql/resolvers/crm/organizations_resolver_spec.rb index c80caf91f90..323f134ffc3 100644 --- a/spec/graphql/resolvers/crm/organizations_resolver_spec.rb +++ b/spec/graphql/resolvers/crm/organizations_resolver_spec.rb @@ -35,7 +35,7 @@ RSpec.describe Resolvers::Crm::OrganizationsResolver do end context 'with authorized user' do - it 'does not rise an error and returns all organizations' do + it 'does not rise an error and returns all organizations in the correct order' do group.add_reporter(user) expect { resolve_organizations(group) }.not_to raise_error @@ -55,20 +55,28 @@ RSpec.describe Resolvers::Crm::OrganizationsResolver do end context 'when no filter is provided' do - it 'returns all the organizations' do - expect(resolve_organizations(group)).to match_array([organization_a, organization_b]) + it 'returns all the organizations in the correct order' do + expect(resolve_organizations(group)).to eq([organization_a, organization_b]) end end context 'when search term is provided' do it 'returns the correct organizations' do - expect(resolve_organizations(group, { search: "def" })).to match_array([organization_b]) + expect(resolve_organizations(group, { search: "def" })).to contain_exactly(organization_b) end end context 'when state is provided' do it 'returns the correct organizations' do - expect(resolve_organizations(group, { state: :inactive })).to match_array([organization_a]) + expect(resolve_organizations(group, { state: :inactive })).to contain_exactly(organization_a) + end + end + + context 'when ids are provided' do + it 'returns the correct organizations' do + expect(resolve_organizations(group, { + ids: [organization_b.to_global_id] + })).to contain_exactly(organization_b) end end end |