diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/graphql/mutations/todos/restore_many_spec.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) | |
download | gitlab-ce-7e9c479f7de77702622631cff2628a9c8dcbc627.tar.gz |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/graphql/mutations/todos/restore_many_spec.rb')
-rw-r--r-- | spec/graphql/mutations/todos/restore_many_spec.rb | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/spec/graphql/mutations/todos/restore_many_spec.rb b/spec/graphql/mutations/todos/restore_many_spec.rb index 59995e33f2d..dc10355ef22 100644 --- a/spec/graphql/mutations/todos/restore_many_spec.rb +++ b/spec/graphql/mutations/todos/restore_many_spec.rb @@ -24,11 +24,11 @@ RSpec.describe Mutations::Todos::RestoreMany do expect(todo2.reload.state).to eq('pending') expect(other_user_todo.reload.state).to eq('done') - 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) + expect(result).to match( + errors: be_empty, + updated_ids: contain_exactly(todo1.id), + todos: contain_exactly(todo1) + ) end it 'handles a todo which is already pending as expected' do @@ -36,8 +36,11 @@ RSpec.describe Mutations::Todos::RestoreMany do expect_states_were_not_changed - expect(result[:updated_ids]).to eq([]) - expect(result[:todos]).to be_empty + expect(result).to match( + errors: be_empty, + updated_ids: be_empty, + todos: be_empty + ) end it 'ignores requests for todos which do not belong to the current user' do @@ -61,7 +64,7 @@ RSpec.describe Mutations::Todos::RestoreMany do expect(result[:updated_ids].size).to eq(2) 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(returned_todo_ids).to contain_exactly(todo1.id, todo4.id) expect(result[:todos]).to contain_exactly(todo1, todo4) expect(todo1.reload.state).to eq('pending') |