summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/ci/config/node/artifacts_spec.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-08-08 10:14:21 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-08-08 10:14:21 +0200
commit8ae222092dc63d672dc505358d7bdfbb8478c774 (patch)
tree44082b65f583923ff48fd1315e0ccf44c2293b6e /spec/lib/gitlab/ci/config/node/artifacts_spec.rb
parent1b5e2303debf00784603d6bd9d87d613de3c8091 (diff)
parent91030230545a199a86c2742600a7a2e68ef75c98 (diff)
downloadgitlab-ce-8ae222092dc63d672dc505358d7bdfbb8478c774.tar.gz
Merge branch 'master' into feature/svg-badge-template
* master: (363 commits) Added changelog item for issuable form dropdowns Add 'run tests' docs from GDK Bump gitlab_git to lazy load compare commits Add examples to repository files API (!5465) Ignore URLs starting with // (!5677) Add failing test for #7032 Update timeago to shorter representation Add missing DOWNTIME constant to the AddTimestampsToMembersAgain migration Added guide about migrations and downtime Update CHANGELOG for 8.10.4 Add a data migration to fix some missing timestamps in the members table (again) Move abilities by subject class to a dedicated method Remove unnecessary empty line after css var Set consistency in list text height css Add description to text/plain emails Fix Rename `add_users_into_project` and `projects_ids` fix spec Underscore variable to camelCase using shared path for project import uploads and refactored gitlab remove export worker Structure the development documentation ...
Diffstat (limited to 'spec/lib/gitlab/ci/config/node/artifacts_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/config/node/artifacts_spec.rb45
1 files changed, 45 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/config/node/artifacts_spec.rb b/spec/lib/gitlab/ci/config/node/artifacts_spec.rb
new file mode 100644
index 00000000000..c09a0a9c793
--- /dev/null
+++ b/spec/lib/gitlab/ci/config/node/artifacts_spec.rb
@@ -0,0 +1,45 @@
+require 'spec_helper'
+
+describe Gitlab::Ci::Config::Node::Artifacts do
+ let(:entry) { described_class.new(config) }
+
+ describe 'validation' do
+ context 'when entry config value is correct' do
+ let(:config) { { paths: %w[public/] } }
+
+ describe '#value' do
+ it 'returns artifacs configuration' do
+ expect(entry.value).to eq config
+ end
+ end
+
+ describe '#valid?' do
+ it 'is valid' do
+ expect(entry).to be_valid
+ end
+ end
+ end
+
+ context 'when entry value is not correct' do
+ describe '#errors' do
+ context 'when value of attribute is invalid' do
+ let(:config) { { name: 10 } }
+
+ it 'reports error' do
+ expect(entry.errors)
+ .to include 'artifacts name should be a string'
+ end
+ end
+
+ context 'when there is an unknown key present' do
+ let(:config) { { test: 100 } }
+
+ it 'reports error' do
+ expect(entry.errors)
+ .to include 'artifacts config contains unknown keys: test'
+ end
+ end
+ end
+ end
+ end
+end