summaryrefslogtreecommitdiff
path: root/spec/requests/api/graphql/current_user/todos_query_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/api/graphql/current_user/todos_query_spec.rb')
-rw-r--r--spec/requests/api/graphql/current_user/todos_query_spec.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/requests/api/graphql/current_user/todos_query_spec.rb b/spec/requests/api/graphql/current_user/todos_query_spec.rb
index 6817e37e64b..82deba0d92c 100644
--- a/spec/requests/api/graphql/current_user/todos_query_spec.rb
+++ b/spec/requests/api/graphql/current_user/todos_query_spec.rb
@@ -13,7 +13,7 @@ describe 'Query current user todos' do
let(:fields) do
<<~QUERY
nodes {
- id
+ #{all_graphql_fields_for('todos'.classify)}
}
QUERY
end
@@ -28,6 +28,8 @@ describe 'Query current user todos' do
post_graphql(query, current_user: current_user)
end
+ it_behaves_like 'a working graphql query'
+
it 'contains the expected ids' do
is_expected.to include(
a_hash_including('id' => commit_todo.to_global_id.to_s),
@@ -35,4 +37,12 @@ describe 'Query current user todos' do
a_hash_including('id' => merge_request_todo.to_global_id.to_s)
)
end
+
+ it 'returns Todos for all target types' do
+ is_expected.to include(
+ a_hash_including('targetType' => 'COMMIT'),
+ a_hash_including('targetType' => 'ISSUE'),
+ a_hash_including('targetType' => 'MERGEREQUEST')
+ )
+ end
end