diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-24 21:09:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-24 21:09:05 +0300 |
commit | c2367afbf57ebc65d5b78a743b5d6a91f0aece9f (patch) | |
tree | 165c2c54bf72ab3a3a9417d97f63ece5c9eba9f5 /spec/graphql/resolvers | |
parent | 51a9512965d86e3094968fa514e4ae8a96d38cf3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/graphql/resolvers')
-rw-r--r-- | spec/graphql/resolvers/boards_resolver_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/graphql/resolvers/boards_resolver_spec.rb b/spec/graphql/resolvers/boards_resolver_spec.rb index ab77dfa8fc3..02d6f808118 100644 --- a/spec/graphql/resolvers/boards_resolver_spec.rb +++ b/spec/graphql/resolvers/boards_resolver_spec.rb @@ -45,6 +45,21 @@ describe Resolvers::BoardsResolver do expect(resolve_boards).to eq [board1] end end + + context 'when querying for a single board' do + let(:board1) { create(:board, name: 'One', resource_parent: board_parent) } + + it 'returns specified board' do + expect(resolve_boards(args: { id: global_id_of(board1) })).to eq [board1] + end + + it 'returns nil if board not found' do + outside_parent = create(board_parent.class.underscore.to_sym) + outside_board = create(:board, name: 'outside board', resource_parent: outside_parent) + + expect(resolve_boards(args: { id: global_id_of(outside_board) })).to eq Board.none + end + end end describe '#resolve' do |