Enable RSpec/NotToNot cop and fix all issues
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NotToNot
This commit is contained in:
@@ -14,13 +14,13 @@ shared_examples "document validations" do |documentable_factory|
|
||||
it "is not valid without a title" do
|
||||
document.title = nil
|
||||
|
||||
expect(document).to_not be_valid
|
||||
expect(document).not_to be_valid
|
||||
end
|
||||
|
||||
it "is not valid without an attachment" do
|
||||
document.attachment = nil
|
||||
|
||||
expect(document).to_not be_valid
|
||||
expect(document).not_to be_valid
|
||||
end
|
||||
|
||||
it "is valid for all accepted content types" do
|
||||
@@ -35,28 +35,28 @@ shared_examples "document validations" do |documentable_factory|
|
||||
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)
|
||||
|
||||
expect(document).to_not be_valid
|
||||
expect(document).not_to be_valid
|
||||
expect(document.errors[:attachment]).to include "must be in between 0 Bytes and #{maxfilesize} MB"
|
||||
end
|
||||
|
||||
it "is not valid without a user_id" do
|
||||
document.user_id = nil
|
||||
|
||||
expect(document).to_not be_valid
|
||||
expect(document).not_to be_valid
|
||||
end
|
||||
|
||||
it "is not valid without a documentable_id" do
|
||||
document.save
|
||||
document.documentable_id = nil
|
||||
|
||||
expect(document).to_not be_valid
|
||||
expect(document).not_to be_valid
|
||||
end
|
||||
|
||||
it "is not valid without a documentable_type" do
|
||||
document.save
|
||||
document.documentable_type = nil
|
||||
|
||||
expect(document).to_not be_valid
|
||||
expect(document).not_to be_valid
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user