Add main link to each phase of the budget
Co-authored-by: decabeza <alberto@decabeza.es>
This commit is contained in:
17
spec/components/budgets/phases_component_spec.rb
Normal file
17
spec/components/budgets/phases_component_spec.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe Budgets::PhasesComponent, type: :component do
|
||||
let(:budget) { create(:budget) }
|
||||
|
||||
it "shows budget current phase main link when defined" do
|
||||
render_inline Budgets::PhasesComponent.new(budget)
|
||||
|
||||
expect(page).not_to have_css(".main-link")
|
||||
|
||||
budget.current_phase.update!(main_link_text: "Phase link!", main_link_url: "https://consulproject.org")
|
||||
render_inline Budgets::PhasesComponent.new(budget)
|
||||
|
||||
expect(page).to have_css(".main-link")
|
||||
expect(page).to have_link("Phase link!", href: "https://consulproject.org")
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user