summaryrefslogtreecommitdiff
path: root/spec/graphql/mutations
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-07 12:09:16 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-07 12:09:16 +0000
commit0254867cf0f3341fd63cc6da07290f1da91f99ef (patch)
tree4b3fb556c1cb8cde3459e56d58d5e61eb268d9ec /spec/graphql/mutations
parentc417764f00abaa5d2224a50b8d43a15e40ef8790 (diff)
downloadgitlab-ce-0254867cf0f3341fd63cc6da07290f1da91f99ef.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/graphql/mutations')
-rw-r--r--spec/graphql/mutations/todos/mark_all_done_spec.rb3
-rw-r--r--spec/graphql/mutations/todos/restore_many_spec.rb4
2 files changed, 6 insertions, 1 deletions
diff --git a/spec/graphql/mutations/todos/mark_all_done_spec.rb b/spec/graphql/mutations/todos/mark_all_done_spec.rb
index ed2291c0c35..2f167164050 100644
--- a/spec/graphql/mutations/todos/mark_all_done_spec.rb
+++ b/spec/graphql/mutations/todos/mark_all_done_spec.rb
@@ -21,7 +21,7 @@ RSpec.describe Mutations::Todos::MarkAllDone do
describe '#resolve' do
it 'marks all pending todos as done' do
- updated_todo_ids = mutation_for(current_user).resolve.dig(:updated_ids)
+ updated_todo_ids, todos = mutation_for(current_user).resolve.values_at(:updated_ids, :todos)
expect(todo1.reload.state).to eq('done')
expect(todo2.reload.state).to eq('done')
@@ -29,6 +29,7 @@ RSpec.describe Mutations::Todos::MarkAllDone do
expect(other_user_todo.reload.state).to eq('pending')
expect(updated_todo_ids).to contain_exactly(global_id_of(todo1), global_id_of(todo3))
+ expect(todos).to contain_exactly(todo1, todo3)
end
it 'behaves as expected if there are no todos for the requesting user' do
diff --git a/spec/graphql/mutations/todos/restore_many_spec.rb b/spec/graphql/mutations/todos/restore_many_spec.rb
index 7f9f478085d..b3b3e057745 100644
--- a/spec/graphql/mutations/todos/restore_many_spec.rb
+++ b/spec/graphql/mutations/todos/restore_many_spec.rb
@@ -25,6 +25,8 @@ RSpec.describe Mutations::Todos::RestoreMany do
todo_ids = result[:updated_ids]
expect(todo_ids.size).to eq(1)
expect(todo_ids.first).to eq(todo1.to_global_id.to_s)
+
+ expect(result[:todos]).to contain_exactly(todo1)
end
it 'handles a todo which is already pending as expected' do
@@ -33,6 +35,7 @@ RSpec.describe Mutations::Todos::RestoreMany do
expect_states_were_not_changed
expect(result[:updated_ids]).to eq([])
+ expect(result[:todos]).to be_empty
end
it 'ignores requests for todos which do not belong to the current user' do
@@ -56,6 +59,7 @@ RSpec.describe Mutations::Todos::RestoreMany do
returned_todo_ids = result[:updated_ids]
expect(returned_todo_ids).to contain_exactly(todo1.to_global_id.to_s, todo4.to_global_id.to_s)
+ expect(result[:todos]).to contain_exactly(todo1, todo4)
expect(todo1.reload.state).to eq('pending')
expect(todo2.reload.state).to eq('pending')