Files
nairobi/spec/components/budgets/map_component_spec.rb
Javi Martín 69ae2d31ee Extract component to render the budget map
We're going to make a change, and it's easier if we've already got a
component with tests so we don't have to write system tests to check
whether the map is rendered.
2022-05-02 20:25:25 +02:00

24 lines
543 B
Ruby

require "rails_helper"
describe Budgets::MapComponent do
let(:budget) { build(:budget) }
describe "#render?" do
it "is rendered after the informing phase" do
budget.phase = "accepting"
render_inline Budgets::MapComponent.new(budget)
expect(page.first("div.map")).to have_content "located geographically"
end
it "is not rendered during the informing phase" do
budget.phase = "informing"
render_inline Budgets::MapComponent.new(budget)
expect(page).not_to be_rendered
end
end
end