Files
openfoodnetwork/spec/components/example_component_spec.rb
Jean-Baptiste Bellet 390c8a89da Add (very simple) spec for a ViewComponent component
- Add `ViewComponent::TestHelpers` to get the helper method `render_inline`
 - Use Capybara to expect some assertion
2021-04-22 15:08:54 +02:00

9 lines
254 B
Ruby

require "spec_helper"
describe "ExampleComponent tests", type: :component do
it "displays the h1 with the given parameter" do
render_inline(ExampleComponent.new(title: "Hello")) { }
expect(page).to have_selector "h1", text: "Hello"
end
end