Use new RSpec stub syntax to fix deprecation warnings

This commit is contained in:
Angel Perez
2018-03-13 12:35:59 -04:00
parent 4f2ed27f8c
commit bdda397bf1
2 changed files with 19 additions and 10 deletions

View File

@@ -32,8 +32,8 @@ shared_examples "document validations" do |documentable_factory|
end
end
it "is not valid for attachments larger than documentable max_file_size definition" do
document.stub(:attachment_file_size).and_return(maxfilesize.megabytes + 1.byte)
it 'is not valid for attachments larger than documentable max_file_size definition' do
allow(document).to receive(:attachment_file_size).and_return(maxfilesize.megabytes + 1.byte)
max_size_error_message = "must be in between 0 Bytes and #{maxfilesize} MB"
expect(document).not_to be_valid