summaryrefslogtreecommitdiff
path: root/spec/models/application_setting/term_spec.rb
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-04-24 18:28:04 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2018-05-04 13:52:55 +0200
commit3d6d0a09b65f032bbe1bd5ad4736dd764195bbe1 (patch)
tree72225f4bd77687266020a1391b5604478b67318c /spec/models/application_setting/term_spec.rb
parentcf37bef287d7dd5d2dce3e2276489767b8c0671f (diff)
downloadgitlab-ce-3d6d0a09b65f032bbe1bd5ad4736dd764195bbe1.tar.gz
Store application wide terms
This allows admins to define terms in the application settings. Every time the terms are adjusted, a new version is stored and becomes the 'active' version. This allows tracking which specific version was accepted by a user.
Diffstat (limited to 'spec/models/application_setting/term_spec.rb')
-rw-r--r--spec/models/application_setting/term_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/models/application_setting/term_spec.rb b/spec/models/application_setting/term_spec.rb
new file mode 100644
index 00000000000..1eddf3c56ff
--- /dev/null
+++ b/spec/models/application_setting/term_spec.rb
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+describe ApplicationSetting::Term do
+ describe 'validations' do
+ it { is_expected.to validate_presence_of(:terms) }
+ end
+
+ describe '.latest' do
+ it 'finds the latest terms' do
+ terms = create(:term)
+
+ expect(described_class.latest).to eq(terms)
+ end
+ end
+end