Enables RSpec/ExampleWording and fixes all issues
Both avoiding 'should' and repiting 'it' on the tests description improves reading them and also makes all descriptions consistent. Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWording
This commit is contained in:
@@ -3,21 +3,21 @@ require 'rails_helper'
|
||||
describe ProposalNotification do
|
||||
let(:notification) { build(:proposal_notification) }
|
||||
|
||||
it "should be valid" do
|
||||
it "is valid" do
|
||||
expect(notification).to be_valid
|
||||
end
|
||||
|
||||
it "should not be valid without a title" do
|
||||
it "is not valid without a title" do
|
||||
notification.title = nil
|
||||
expect(notification).to_not be_valid
|
||||
end
|
||||
|
||||
it "should not be valid without a body" do
|
||||
it "is not valid without a body" do
|
||||
notification.body = nil
|
||||
expect(notification).to_not be_valid
|
||||
end
|
||||
|
||||
it "should not be valid without an associated proposal" do
|
||||
it "is not valid without an associated proposal" do
|
||||
notification.proposal = nil
|
||||
expect(notification).to_not be_valid
|
||||
end
|
||||
@@ -50,7 +50,7 @@ describe ProposalNotification do
|
||||
Setting[:proposal_notification_minimum_interval_in_days] = 3
|
||||
end
|
||||
|
||||
it "should not be valid if below minium interval" do
|
||||
it "is not valid if below minium interval" do
|
||||
proposal = create(:proposal)
|
||||
|
||||
notification1 = create(:proposal_notification, proposal: proposal)
|
||||
@@ -60,7 +60,7 @@ describe ProposalNotification do
|
||||
expect(notification2).to_not be_valid
|
||||
end
|
||||
|
||||
it "should be valid if notifications above minium interval" do
|
||||
it "is valid if notifications above minium interval" do
|
||||
proposal = create(:proposal)
|
||||
|
||||
notification1 = create(:proposal_notification, proposal: proposal, created_at: 4.days.ago)
|
||||
@@ -70,7 +70,7 @@ describe ProposalNotification do
|
||||
expect(notification2).to be_valid
|
||||
end
|
||||
|
||||
it "should be valid if no notifications sent" do
|
||||
it "is valid if no notifications sent" do
|
||||
notification1 = build(:proposal_notification)
|
||||
|
||||
expect(notification1).to be_valid
|
||||
|
||||
Reference in New Issue
Block a user