Class: Brut::SpecSupport::Matchers::HaveI18nString

Inherits:
Object
  • Object
show all
Defined in:
lib/brut/spec_support/matchers/have_i18n_string.rb

Overview

Used in component or page specs to check if a Nokogiri node's text contains a specific i18n string, without you having to use t to look it up.

Examples:

result = generate_and_parse(page)
expect(result.e!("h3")).to have_i18n_string(:greeting)

I18n string with parameters

result = generate_and_parse(page)
expect(result.e!("h3")).to have_i18n_string(:user_greeting, email: .email)