diff options
Diffstat (limited to 'spec/controllers/groups/settings')
3 files changed, 19 insertions, 6 deletions
diff --git a/spec/controllers/groups/settings/ci_cd_controller_spec.rb b/spec/controllers/groups/settings/ci_cd_controller_spec.rb index 880d5fe8951..f225d798886 100644 --- a/spec/controllers/groups/settings/ci_cd_controller_spec.rb +++ b/spec/controllers/groups/settings/ci_cd_controller_spec.rb @@ -32,6 +32,17 @@ RSpec.describe Groups::Settings::CiCdController do expect(response).to render_template(:show) expect(assigns(:group_runners)).to match_array([runner_group, runner_project_1, runner_project_2, runner_project_3]) end + + it 'paginates runners' do + stub_const("Groups::Settings::CiCdController::NUMBER_OF_RUNNERS_PER_PAGE", 1) + + create(:ci_runner) + + get :show, params: { group_id: group } + + expect(response).to have_gitlab_http_status(:ok) + expect(assigns(:group_runners).count).to be(1) + end end context 'when user is not owner' do @@ -128,7 +139,7 @@ RSpec.describe Groups::Settings::CiCdController do end it 'returns a flash alert' do - expect(response).to set_flash[:alert] + expect(controller).to set_flash[:alert] .to eq("There was a problem updating Auto DevOps pipeline: [\"Error 1\"].") end end @@ -137,7 +148,7 @@ RSpec.describe Groups::Settings::CiCdController do it 'returns a flash notice' do subject - expect(response).to set_flash[:notice] + expect(controller).to set_flash[:notice] .to eq('Auto DevOps pipeline was updated for the group') end end @@ -209,7 +220,7 @@ RSpec.describe Groups::Settings::CiCdController do end it 'returns a flash alert' do - expect(response).to set_flash[:alert] + expect(controller).to set_flash[:alert] .to eq("There was a problem updating the pipeline settings: [\"Error 1\"].") end end @@ -218,7 +229,7 @@ RSpec.describe Groups::Settings::CiCdController do it 'returns a flash notice' do subject - expect(response).to set_flash[:notice] + expect(controller).to set_flash[:notice] .to eq('Pipeline settings was updated for the group') end end diff --git a/spec/controllers/groups/settings/integrations_controller_spec.rb b/spec/controllers/groups/settings/integrations_controller_spec.rb index 3233e814184..63d99a1fab1 100644 --- a/spec/controllers/groups/settings/integrations_controller_spec.rb +++ b/spec/controllers/groups/settings/integrations_controller_spec.rb @@ -36,7 +36,7 @@ RSpec.describe Groups::Settings::IntegrationsController do describe '#edit' do context 'when user is not owner' do it 'renders not_found' do - get :edit, params: { group_id: group, id: Service.available_services_names(include_project_specific: false).sample } + get :edit, params: { group_id: group, id: Integration.available_services_names(include_project_specific: false).sample } expect(response).to have_gitlab_http_status(:not_found) end @@ -47,7 +47,7 @@ RSpec.describe Groups::Settings::IntegrationsController do group.add_owner(user) end - Service.available_services_names(include_project_specific: false).each do |integration_name| + Integration.available_services_names(include_project_specific: false).each do |integration_name| context "#{integration_name}" do it 'successfully displays the template' do get :edit, params: { group_id: group, id: integration_name } diff --git a/spec/controllers/groups/settings/repository_controller_spec.rb b/spec/controllers/groups/settings/repository_controller_spec.rb index 14bbdc05282..cbf55218b94 100644 --- a/spec/controllers/groups/settings/repository_controller_spec.rb +++ b/spec/controllers/groups/settings/repository_controller_spec.rb @@ -59,6 +59,8 @@ RSpec.describe Groups::Settings::RepositoryController do 'username' => deploy_token_params[:username], 'expires_at' => Time.zone.parse(deploy_token_params[:expires_at]), 'token' => be_a(String), + 'expired' => false, + 'revoked' => false, 'scopes' => deploy_token_params.inject([]) do |scopes, kv| key, value = kv key.to_s.start_with?('read_') && value.to_i != 0 ? scopes << key.to_s : scopes |