diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
commit | ee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch) | |
tree | f8479f94a28f66654c6a4f6fb99bad6b4e86a40e /spec/lib/gitlab/github_import/representation/pull_request_spec.rb | |
parent | 62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff) |
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'spec/lib/gitlab/github_import/representation/pull_request_spec.rb')
-rw-r--r-- | spec/lib/gitlab/github_import/representation/pull_request_spec.rb | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/spec/lib/gitlab/github_import/representation/pull_request_spec.rb b/spec/lib/gitlab/github_import/representation/pull_request_spec.rb index deb9535a845..b8c1c67e07c 100644 --- a/spec/lib/gitlab/github_import/representation/pull_request_spec.rb +++ b/spec/lib/gitlab/github_import/representation/pull_request_spec.rb @@ -93,33 +93,30 @@ RSpec.describe Gitlab::GithubImport::Representation::PullRequest do describe '.from_api_response' do let(:response) do - double( - :response, + { number: 42, title: 'My Pull Request', body: 'This is my pull request', state: 'closed', - head: double( - :head, + head: { sha: '123abc', ref: 'my-feature', - repo: double(:repo, id: 400), - user: double(:user, id: 4, login: 'alice') - ), - base: double( - :base, + repo: { id: 400 }, + user: { id: 4, login: 'alice' } + }, + base: { sha: '456def', ref: 'master', - repo: double(:repo, id: 200) - ), - milestone: double(:milestone, number: 4), - user: double(:user, id: 4, login: 'alice'), - assignee: double(:user, id: 4, login: 'alice'), - merged_by: double(:user, id: 4, login: 'alice'), + repo: { id: 200 } + }, + milestone: { number: 4 }, + user: { id: 4, login: 'alice' }, + assignee: { id: 4, login: 'alice' }, + merged_by: { id: 4, login: 'alice' }, created_at: created_at, updated_at: updated_at, merged_at: merged_at - ) + } end it_behaves_like 'a PullRequest' do @@ -127,9 +124,7 @@ RSpec.describe Gitlab::GithubImport::Representation::PullRequest do end it 'does not set the user if the response did not include a user' do - allow(response) - .to receive(:user) - .and_return(nil) + response[:user] = nil pr = described_class.from_api_response(response) |