Simplify getting URL to support an investment

We're also changing the method name to `vote_path` in order to be
consistent with the way Rails uses `_path` for relative URLs.
This commit is contained in:
Javi Martín
2021-06-13 01:18:42 +02:00
parent a0c23ec65c
commit d5f4313f59
9 changed files with 19 additions and 27 deletions

View File

@@ -4,9 +4,7 @@ describe Budgets::Investments::VotesComponent, type: :component do
describe "vote link" do
context "when investment shows votes" do
let(:investment) { create(:budget_investment, title: "Renovate sidewalks in Main Street") }
let(:component) do
Budgets::Investments::VotesComponent.new(investment, investment_votes: [], vote_url: "/")
end
let(:component) { Budgets::Investments::VotesComponent.new(investment, investment_votes: []) }
before { allow(investment).to receive(:should_show_votes?).and_return(true) }