Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/pages_deployment_spec.rb')
-rw-r--r--spec/models/pages_deployment_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/models/pages_deployment_spec.rb b/spec/models/pages_deployment_spec.rb
new file mode 100644
index 00000000000..eafff1ed59a
--- /dev/null
+++ b/spec/models/pages_deployment_spec.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe PagesDeployment do
+ describe 'associations' do
+ it { is_expected.to belong_to(:project).required }
+ it { is_expected.to belong_to(:ci_build).optional }
+ end
+
+ describe 'validations' do
+ it { is_expected.to validate_presence_of(:file) }
+ it { is_expected.to validate_presence_of(:size) }
+ it { is_expected.to validate_numericality_of(:size).only_integer.is_greater_than(0) }
+ it { is_expected.to validate_inclusion_of(:file_store).in_array(ObjectStorage::SUPPORTED_STORES) }
+
+ it 'is valid when created from the factory' do
+ expect(create(:pages_deployment)).to be_valid
+ end
+ end
+end