diff options
author | Chris Baumbauer <cab@cabnetworks.net> | 2018-12-16 23:31:38 -0800 |
---|---|---|
committer | Chris Baumbauer <cab@cabnetworks.net> | 2019-01-10 14:13:41 -0800 |
commit | 1102deb0bd04a1bdf550ed74cf381a6bd400a7e0 (patch) | |
tree | d734488f04098bdabbae3ce0621debf0eb6bf918 /spec/finders | |
parent | 71026ffd7e71da726a9b740d42093926f8477c3e (diff) | |
download | gitlab-ce-1102deb0bd04a1bdf550ed74cf381a6bd400a7e0.tar.gz |
Initial Serverless Functions detailed view
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/projects/serverless/functions_finder_spec.rb | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/spec/finders/projects/serverless/functions_finder_spec.rb b/spec/finders/projects/serverless/functions_finder_spec.rb index 60d02b12054..35279906854 100644 --- a/spec/finders/projects/serverless/functions_finder_spec.rb +++ b/spec/finders/projects/serverless/functions_finder_spec.rb @@ -29,15 +29,34 @@ describe Projects::Serverless::FunctionsFinder do context 'has knative installed' do let!(:knative) { create(:clusters_applications_knative, :installed, cluster: cluster) } + let(:finder) { described_class.new(project.clusters) } it 'there are no functions' do - expect(described_class.new(project.clusters).execute).to be_empty + expect(finder.execute).to be_empty end it 'there are functions', :use_clean_rails_memory_store_caching do - stub_reactive_cache(knative, services: kube_knative_services_body(namespace: namespace.namespace, name: cluster.project.name)["items"]) + stub_kubeclient_service_pods + stub_reactive_cache(knative, + { + services: kube_knative_services_body(namespace: namespace.namespace, name: cluster.project.name)["items"], + pods: kube_knative_pods_body(cluster.project.name, namespace.namespace)["items"] + }) - expect(described_class.new(project.clusters).execute).not_to be_empty + expect(finder.execute).not_to be_empty + end + + it 'has a function', :use_clean_rails_memory_store_caching do + stub_kubeclient_service_pods + stub_reactive_cache(knative, + { + services: kube_knative_services_body(namespace: namespace.namespace, name: cluster.project.name)["items"], + pods: kube_knative_pods_body(cluster.project.name, namespace.namespace)["items"] + }) + + result = finder.service(cluster.environment_scope, cluster.project.name) + expect(result).not_to be_empty + expect(result["metadata"]["name"]).to be_eql(cluster.project.name) end end end |