From d8416288d360503bd2f208b62d5dae6df83206e8 Mon Sep 17 00:00:00 2001 From: Mark Lapierre Date: Tue, 25 Sep 2018 13:33:48 -0400 Subject: Add support for pushing and viewing files The MR below adds a test for the code owners feature. This adds the part of those changes specific to CE - the ability to add and view files in a project. https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/7368 --- qa/spec/factory/repository/push_spec.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 qa/spec/factory/repository/push_spec.rb (limited to 'qa/spec/factory') diff --git a/qa/spec/factory/repository/push_spec.rb b/qa/spec/factory/repository/push_spec.rb new file mode 100644 index 00000000000..cdf5ada8ae8 --- /dev/null +++ b/qa/spec/factory/repository/push_spec.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +describe QA::Factory::Repository::Push do + describe '.files=' do + let(:files) do + [ + { + name: 'file.txt', + content: 'foo' + } + ] + end + + subject { described_class.new } + + it 'raises an error if files is not an array' do + expect { subject.files = '' }.to raise_error(ArgumentError) + end + + it 'raises an error if files is an empty array' do + expect { subject.files = '[]' }.to raise_error(ArgumentError) + end + + it 'does not raise if files is an array' do + expect { subject.files = files }.not_to raise_error + end + end +end -- cgit v1.2.1