diff options
Diffstat (limited to 'spec/lib/file_size_validator_spec.rb')
-rw-r--r-- | spec/lib/file_size_validator_spec.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/spec/lib/file_size_validator_spec.rb b/spec/lib/file_size_validator_spec.rb index 5c89c854714..12ccc051c74 100644 --- a/spec/lib/file_size_validator_spec.rb +++ b/spec/lib/file_size_validator_spec.rb @@ -9,9 +9,9 @@ describe 'Gitlab::FileSizeValidatorSpec' do let(:options) { { maximum: 10, attributes: { attachment: attachment } } } it 'attachment exceeds maximum limit' do - allow(attachment).to receive(:size) { 100 } - validator.validate_each(note, :attachment, attachment) - expect(note.errors).to have_key(:attachment) + allow(attachment).to receive(:size) { 100 } + validator.validate_each(note, :attachment, attachment) + expect(note.errors).to have_key(:attachment) end it 'attachment under maximum limit' do @@ -22,8 +22,13 @@ describe 'Gitlab::FileSizeValidatorSpec' do end describe 'options uses a symbol' do - let(:options) { { maximum: :test, - attributes: { attachment: attachment } } } + let(:options) do + { + maximum: :test, + attributes: { attachment: attachment } + } + end + before do allow(note).to receive(:test) { 10 } end |