summaryrefslogtreecommitdiff
path: root/spec/models/project_ci_cd_setting_spec.rb
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2018-04-12 14:07:44 +0200
committerYorick Peterse <yorickpeterse@gmail.com>2018-04-16 14:05:35 +0200
commit392c411bdc16386ef42c86afaf8c4d8e4cddb955 (patch)
tree4dc69bd81002c4c68885442a201fd17328b40813 /spec/models/project_ci_cd_setting_spec.rb
parent4fcee58636259e523a0e1b85e2090160a3938496 (diff)
downloadgitlab-ce-392c411bdc16386ef42c86afaf8c4d8e4cddb955.tar.gz
Introduce new ProjectCiCdSetting10244-add-project-ci-cd-settings
This model and the corresponding table will be used for storing settings specific to CI/CD, starting with the "group_runners_enabled" boolean. The model is called ProjectCiCdSetting and not ProjectCiCdSettings. The project exporter doesn't like plural model names as it uses "classify" which turns those into singular (so "ProjectCiCdSettings" becomes "ProjectCiCdSetting", producing an error if said class is undefined). The initial work in this commit was done by Dylan Griffith, with most of the migration work being done by Yorick Peterse.
Diffstat (limited to 'spec/models/project_ci_cd_setting_spec.rb')
-rw-r--r--spec/models/project_ci_cd_setting_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/models/project_ci_cd_setting_spec.rb b/spec/models/project_ci_cd_setting_spec.rb
new file mode 100644
index 00000000000..4aa62028169
--- /dev/null
+++ b/spec/models/project_ci_cd_setting_spec.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe ProjectCiCdSetting do
+ describe '.available?' do
+ before do
+ described_class.reset_column_information
+ end
+
+ it 'returns true' do
+ expect(described_class).to be_available
+ end
+
+ it 'memoizes the schema version' do
+ expect(ActiveRecord::Migrator)
+ .to receive(:current_version)
+ .and_call_original
+ .once
+
+ 2.times { described_class.available? }
+ end
+ end
+end