diff options
author | Stan Hu <stanhu@gmail.com> | 2018-08-13 15:36:15 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-08-24 05:34:38 -0700 |
commit | 0377c015cf903a1d22d14086e68d1e07fe3c2643 (patch) | |
tree | d0be528c1d6a1fe44aa937fc3aeb1076aa7e3c7c /spec/lib/gitlab/github_import_spec.rb | |
parent | 842377ab3c5b80a3758ad8c36dc3358bd265bc10 (diff) | |
download | gitlab-ce-0377c015cf903a1d22d14086e68d1e07fe3c2643.tar.gz |
Refactor GitHub Importer database helpers into helper methods
This in preparation for addressing idle-in-transaction timeouts for other importers.
Part of #50021
Diffstat (limited to 'spec/lib/gitlab/github_import_spec.rb')
-rw-r--r-- | spec/lib/gitlab/github_import_spec.rb | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/spec/lib/gitlab/github_import_spec.rb b/spec/lib/gitlab/github_import_spec.rb index 51414800e8c..496244c91bf 100644 --- a/spec/lib/gitlab/github_import_spec.rb +++ b/spec/lib/gitlab/github_import_spec.rb @@ -27,39 +27,6 @@ describe Gitlab::GithubImport do end end - describe '.insert_and_return_id' do - let(:attributes) { { iid: 1, title: 'foo' } } - let(:project) { create(:project) } - - context 'on PostgreSQL' do - it 'returns the ID returned by the query' do - expect(Gitlab::Database) - .to receive(:bulk_insert) - .with(Issue.table_name, [attributes], return_ids: true) - .and_return([10]) - - id = described_class.insert_and_return_id(attributes, project.issues) - - expect(id).to eq(10) - end - end - - context 'on MySQL' do - it 'uses a separate query to retrieve the ID' do - issue = create(:issue, project: project, iid: attributes[:iid]) - - expect(Gitlab::Database) - .to receive(:bulk_insert) - .with(Issue.table_name, [attributes], return_ids: true) - .and_return([]) - - id = described_class.insert_and_return_id(attributes, project.issues) - - expect(id).to eq(issue.id) - end - end - end - describe '.ghost_user_id', :clean_gitlab_redis_cache do it 'returns the ID of the ghost user' do expect(described_class.ghost_user_id).to eq(User.ghost.id) |