diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-05-09 23:32:18 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-05-09 23:32:18 +0300 |
commit | d05f0030a3de42ab3ec6d8c8be290b74698bb929 (patch) | |
tree | 38923a9eb972aa6708f51f10d52b3a4fb8f9a009 /spec/support | |
parent | d5d8e76bd79cd9d61c66539a5069104cf46be2bd (diff) | |
download | gitlab-ce-d05f0030a3de42ab3ec6d8c8be290b74698bb929.tar.gz |
Added Docker Registry View tests
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/stub_gitlab_calls.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/support/stub_gitlab_calls.rb b/spec/support/stub_gitlab_calls.rb index eec2e681117..6b3a4010063 100644 --- a/spec/support/stub_gitlab_calls.rb +++ b/spec/support/stub_gitlab_calls.rb @@ -25,6 +25,18 @@ module StubGitlabCalls allow_any_instance_of(Project).to receive(:builds_enabled?).and_return(false) end + def stub_container_registry(*tags) + allow_any_instance_of(ContainerRegistry::Client).to receive(:repository_tags).and_return( + { "tags" => tags } + ) + allow_any_instance_of(ContainerRegistry::Client).to receive(:repository_manifest).and_return( + JSON.load(File.read(Rails.root + 'spec/fixtures/container_registry/tag_manifest.json')) + ) + allow_any_instance_of(ContainerRegistry::Client).to receive(:blob).and_return( + File.read(Rails.root + 'spec/fixtures/container_registry/config_blob.json') + ) + end + private def gitlab_url |