Add and apply RSpec/ReceiveMessages rubocop rule
This rule was added in rubocop-rspec 2.23.0. I didn't know this method existed, and it makes the code more readable in some cases.
This commit is contained in:
@@ -2,8 +2,7 @@ require "rails_helper"
|
||||
|
||||
describe Admin::Budgets::IndexComponent, controller: Admin::BudgetsController do
|
||||
before do
|
||||
allow(vc_test_controller).to receive(:valid_filters).and_return(["all"])
|
||||
allow(vc_test_controller).to receive(:current_filter).and_return("all")
|
||||
allow(vc_test_controller).to receive_messages(valid_filters: ["all"], current_filter: "all")
|
||||
end
|
||||
|
||||
describe "#phase_progress_text" do
|
||||
|
||||
@@ -5,8 +5,7 @@ describe Admin::Organizations::TableActionsComponent, controller: Admin::Organiz
|
||||
let(:component) { Admin::Organizations::TableActionsComponent.new(organization) }
|
||||
|
||||
it "renders buttons to verify and reject when it can" do
|
||||
allow(component).to receive(:can_verify?).and_return(true)
|
||||
allow(component).to receive(:can_reject?).and_return(true)
|
||||
allow(component).to receive_messages(can_verify?: true, can_reject?: true)
|
||||
|
||||
render_inline component
|
||||
|
||||
@@ -17,8 +16,7 @@ describe Admin::Organizations::TableActionsComponent, controller: Admin::Organiz
|
||||
end
|
||||
|
||||
it "renders button to verify when it cannot reject" do
|
||||
allow(component).to receive(:can_verify?).and_return(true)
|
||||
allow(component).to receive(:can_reject?).and_return(false)
|
||||
allow(component).to receive_messages(can_verify?: true, can_reject?: false)
|
||||
|
||||
render_inline component
|
||||
|
||||
@@ -27,8 +25,7 @@ describe Admin::Organizations::TableActionsComponent, controller: Admin::Organiz
|
||||
end
|
||||
|
||||
it "renders button to reject when it cannot verify" do
|
||||
allow(component).to receive(:can_verify?).and_return(false)
|
||||
allow(component).to receive(:can_reject?).and_return(true)
|
||||
allow(component).to receive_messages(can_verify?: false, can_reject?: true)
|
||||
|
||||
render_inline component
|
||||
|
||||
@@ -37,8 +34,7 @@ describe Admin::Organizations::TableActionsComponent, controller: Admin::Organiz
|
||||
end
|
||||
|
||||
it "does not render any actions when it cannot verify nor reject" do
|
||||
allow(component).to receive(:can_verify?).and_return(false)
|
||||
allow(component).to receive(:can_reject?).and_return(false)
|
||||
allow(component).to receive_messages(can_verify?: false, can_reject?: false)
|
||||
|
||||
render_inline component
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ require "rails_helper"
|
||||
|
||||
describe SDGManagement::Relations::IndexComponent, controller: SDGManagement::RelationsController do
|
||||
before do
|
||||
allow(vc_test_controller).to receive(:valid_filters)
|
||||
.and_return(SDGManagement::RelationsController::FILTERS)
|
||||
allow(vc_test_controller).to receive(:current_filter)
|
||||
.and_return(SDGManagement::RelationsController::FILTERS.first)
|
||||
allow(vc_test_controller).to receive_messages(
|
||||
valid_filters: SDGManagement::RelationsController::FILTERS,
|
||||
current_filter: SDGManagement::RelationsController::FILTERS.first
|
||||
)
|
||||
end
|
||||
|
||||
it "renders the search form" do
|
||||
|
||||
Reference in New Issue
Block a user