diff options
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) |