diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-17 12:08:11 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-17 12:08:11 +0000 |
commit | badb9c1deacbea601b02f88811b7e123589d9251 (patch) | |
tree | f4b4f85db49a8c9fc9bd6233ed9f7862c9de8ded /spec/lib | |
parent | 5bd24a54ef4ce3a38a860eb53b66d062c2382971 (diff) | |
download | gitlab-ce-badb9c1deacbea601b02f88811b7e123589d9251.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/database/migration_helpers_spec.rb | 13 | ||||
-rw-r--r-- | spec/lib/gitlab/metrics/dashboard/service_selector_spec.rb | 6 |
2 files changed, 19 insertions, 0 deletions
diff --git a/spec/lib/gitlab/database/migration_helpers_spec.rb b/spec/lib/gitlab/database/migration_helpers_spec.rb index 2ba253f9652..cac6908f4b4 100644 --- a/spec/lib/gitlab/database/migration_helpers_spec.rb +++ b/spec/lib/gitlab/database/migration_helpers_spec.rb @@ -1440,4 +1440,17 @@ describe Gitlab::Database::MigrationHelpers do end end end + + describe '#create_or_update_plan_limit' do + it 'creates or updates plan limits' do + expect(model).to receive(:execute).with <<~SQL + INSERT INTO plan_limits (plan_id, "project_hooks") + VALUES + ((SELECT id FROM plans WHERE name = 'free' LIMIT 1), '10') + ON CONFLICT (plan_id) DO UPDATE SET "project_hooks" = EXCLUDED."project_hooks"; + SQL + + model.create_or_update_plan_limit('project_hooks', 'free', 10) + end + end end diff --git a/spec/lib/gitlab/metrics/dashboard/service_selector_spec.rb b/spec/lib/gitlab/metrics/dashboard/service_selector_spec.rb index 0d4562f78f1..e0c8133994b 100644 --- a/spec/lib/gitlab/metrics/dashboard/service_selector_spec.rb +++ b/spec/lib/gitlab/metrics/dashboard/service_selector_spec.rb @@ -22,6 +22,12 @@ describe Gitlab::Metrics::Dashboard::ServiceSelector do it { is_expected.to be Metrics::Dashboard::SystemDashboardService } end + + context 'when the path is for the pod dashboard' do + let(:arguments) { { dashboard_path: pod_dashboard_path } } + + it { is_expected.to be Metrics::Dashboard::PodDashboardService } + end end context 'when the embedded flag is provided' do |