Add main link to each phase of the budget

Co-authored-by: decabeza <alberto@decabeza.es>
This commit is contained in:
Julian Herrero
2020-03-16 12:54:00 +01:00
committed by taitus
parent 43ad69bbaf
commit db9ac79e05
16 changed files with 99 additions and 2 deletions

View 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