diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-11-02 15:34:40 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-11-02 15:34:40 +0300 |
commit | 46fd31594e166b17d1c0ca232b6acdd09c1b1cdb (patch) | |
tree | 28a50ec6870fb9eb977116079efe789a419f4306 /spec/controllers/projects | |
parent | 473262a04b098396c0633436c0e9572561d332c7 (diff) | |
parent | fec21f5542b4b50cb1e49a6c50c8b4d57fa9f62e (diff) |
Merge branch 'top_level_clusters_controller' into 'master'
Top level clusters controller
See merge request gitlab-org/gitlab-ce!22438
Diffstat (limited to 'spec/controllers/projects')
-rw-r--r-- | spec/controllers/projects/clusters/applications_controller_spec.rb | 2 | ||||
-rw-r--r-- | spec/controllers/projects/clusters_controller_spec.rb | 41 |
2 files changed, 28 insertions, 15 deletions
diff --git a/spec/controllers/projects/clusters/applications_controller_spec.rb b/spec/controllers/projects/clusters/applications_controller_spec.rb index 9e17e392d3d..8106453a775 100644 --- a/spec/controllers/projects/clusters/applications_controller_spec.rb +++ b/spec/controllers/projects/clusters/applications_controller_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Projects::Clusters::ApplicationsController do diff --git a/spec/controllers/projects/clusters_controller_spec.rb b/spec/controllers/projects/clusters_controller_spec.rb index 9201332c5c8..64fa787e469 100644 --- a/spec/controllers/projects/clusters_controller_spec.rb +++ b/spec/controllers/projects/clusters_controller_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Projects::ClustersController do @@ -218,9 +220,9 @@ describe Projects::ClustersController do describe 'security' do before do allow_any_instance_of(described_class) - .to receive(:token_in_session).and_return('token') + .to receive(:token_in_session).and_return('token') allow_any_instance_of(described_class) - .to receive(:expires_at_in_session).and_return(1.hour.since.to_i.to_s) + .to receive(:expires_at_in_session).and_return(1.hour.since.to_i.to_s) allow_any_instance_of(GoogleApi::CloudPlatform::Client) .to receive(:projects_zones_clusters_create) do OpenStruct.new( @@ -318,14 +320,15 @@ describe Projects::ClustersController do end end - describe 'GET status' do + describe 'GET cluster_status' do let(:cluster) { create(:cluster, :providing_by_gcp, projects: [project]) } def go - get :status, namespace_id: project.namespace, - project_id: project, - id: cluster, - format: :json + get :cluster_status, + namespace_id: project.namespace.to_param, + project_id: project.to_param, + id: cluster, + format: :json end describe 'functionality' do @@ -359,9 +362,10 @@ describe Projects::ClustersController do let(:cluster) { create(:cluster, :provided_by_gcp, projects: [project]) } def go - get :show, namespace_id: project.namespace, - project_id: project, - id: cluster + get :show, + namespace_id: project.namespace, + project_id: project, + id: cluster end describe 'functionality' do @@ -401,8 +405,8 @@ describe Projects::ClustersController do end def go(format: :html) - put :update, params.merge(namespace_id: project.namespace, - project_id: project, + put :update, params.merge(namespace_id: project.namespace.to_param, + project_id: project.to_param, id: cluster, format: format ) @@ -530,9 +534,10 @@ describe Projects::ClustersController do let!(:cluster) { create(:cluster, :provided_by_gcp, :production_environment, projects: [project]) } def go - delete :destroy, namespace_id: project.namespace, - project_id: project, - id: cluster + delete :destroy, + namespace_id: project.namespace, + project_id: project, + id: cluster end describe 'functionality' do @@ -591,4 +596,10 @@ describe Projects::ClustersController do it { expect { go }.to be_denied_for(:external) } end end + + context 'no project_id param' do + it 'does not respond to any action without project_id param' do + expect { get :index }.to raise_error(ActionController::UrlGenerationError) + end + end end |