summaryrefslogtreecommitdiff
path: root/spec/lib/bulk_imports/projects/graphql/get_repository_query_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/bulk_imports/projects/graphql/get_repository_query_spec.rb')
-rw-r--r--spec/lib/bulk_imports/projects/graphql/get_repository_query_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/lib/bulk_imports/projects/graphql/get_repository_query_spec.rb b/spec/lib/bulk_imports/projects/graphql/get_repository_query_spec.rb
new file mode 100644
index 00000000000..4dba81dc0d2
--- /dev/null
+++ b/spec/lib/bulk_imports/projects/graphql/get_repository_query_spec.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe BulkImports::Projects::Graphql::GetRepositoryQuery do
+ describe 'query repository based on full_path' do
+ let(:entity) { double(source_full_path: 'test', bulk_import: nil) }
+ let(:tracker) { double(entity: entity) }
+ let(:context) { BulkImports::Pipeline::Context.new(tracker) }
+
+ it 'returns project repository url' do
+ expect(described_class.to_s).to include('httpUrlToRepo')
+ end
+
+ it 'queries project based on source_full_path' do
+ expected = { full_path: entity.source_full_path }
+
+ expect(described_class.variables(context)).to eq(expected)
+ end
+ end
+end