Class: Brut::FrontEnd::Components::PageIdentifier
- Inherits:
-
Brut::FrontEnd::Component
- Object
- Phlex::HTML
- Brut::FrontEnd::Component
- Brut::FrontEnd::Components::PageIdentifier
- Defined in:
- lib/brut/front_end/components/page_identifier.rb
Overview
Renders a <meta>
tag (in dev and test) that contains the name of the page. This is useful for end to end tests to assert that they are on a specific page before continuing with the test. It can eliminate a lot of confusion when a test fails.
Instance Method Summary collapse
-
#initialize(page) ⇒ PageIdentifier
constructor
Create the component.
-
#view_template ⇒ Object
Methods inherited from Brut::FrontEnd::Component
#around_template, component_name, #component_name
Methods included from Brut::FrontEnd::Component::Helpers
#entity, #global_component, #inline_svg
Methods included from I18n::ForHTML
Methods included from I18n::BaseMethods
#l, #t, #t_direct, #this_field_value
Methods included from Brut::Framework::Errors
Constructor Details
#initialize(page) ⇒ PageIdentifier
Create the component
6 7 8 |
# File 'lib/brut/front_end/components/page_identifier.rb', line 6 def initialize(page) @page = page end |