Add and apply rubocop rules for empty lines
We were very inconsistent regarding these rules. Personally I prefer no empty lines around blocks, clases, etc... as recommended by the Ruby style guide [1], and they're the default values in rubocop, so those are the settings I'm applying. The exception is the `private` access modifier, since we were leaving empty lines around it most of the time. That's the default rubocop rule as well. Personally I don't have a strong preference about this one. [1] https://rubystyle.guide/#empty-lines-around-bodies
This commit is contained in:
@@ -43,7 +43,6 @@ describe ProposalNotification do
|
||||
end
|
||||
|
||||
describe "minimum interval between notifications" do
|
||||
|
||||
before do
|
||||
Setting[:proposal_notification_minimum_interval_in_days] = 3
|
||||
end
|
||||
@@ -71,36 +70,29 @@ describe ProposalNotification do
|
||||
|
||||
expect(notification1).to be_valid
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe "notifications in-app" do
|
||||
|
||||
let(:notifiable) { create(model_name(ProposalNotification)) }
|
||||
let(:proposal) { notifiable.proposal }
|
||||
|
||||
describe "#notification_title" do
|
||||
|
||||
it "returns the proposal title" do
|
||||
notification = create(:notification, notifiable: notifiable)
|
||||
|
||||
expect(notification.notifiable_title).to eq notifiable.proposal.title
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe "#notification_action" do
|
||||
|
||||
it "returns the correct action" do
|
||||
notification = create(:notification, notifiable: notifiable)
|
||||
|
||||
expect(notification.notifiable_action).to eq "proposal_notification"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe "notifiable_available?" do
|
||||
|
||||
it "returns true when the proposal is available" do
|
||||
notification = create(:notification, notifiable: notifiable)
|
||||
|
||||
@@ -114,11 +106,9 @@ describe ProposalNotification do
|
||||
|
||||
expect(notification.notifiable_available?).to be(false)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe "check_availability" do
|
||||
|
||||
it "returns true if the resource is present, not hidden, nor retired" do
|
||||
notification = create(:notification, notifiable: notifiable)
|
||||
|
||||
@@ -147,7 +137,6 @@ describe ProposalNotification do
|
||||
retired_reason: "unfeasible")
|
||||
expect(notification.check_availability(proposal)).to be(false)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe "#moderate_system_email" do
|
||||
|
||||
Reference in New Issue
Block a user