Sha256: bc8ae7aa869b65b0761c2f6b188a8b96d1bbca0d7b9d5dd96e27779a5eb4c09b

Contents?: true

Size: 562 Bytes

Versions: 13

Compression:

Stored size: 562 Bytes

Contents

# frozen_string_literal: true

module FormsValidationsHelpers
  MESSAGES = {
    text: "Please fill out this field.",
    select: "Please select an item in the list."
  }.freeze

  def expect_blank_field_validation_message(selector, opts = {})
    type = opts.fetch(:type, :text).to_sym
    expected_message = opts.fetch(:message, MESSAGES[type])
    message = page.find(selector).native.attribute("validationMessage")

    expect(message).to eq expected_message
  end
end

RSpec.configure do |config|
  config.include FormsValidationsHelpers, type: :system
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-dev-0.29.1 lib/decidim/dev/test/rspec_support/forms_validations.rb
decidim-dev-0.28.4 lib/decidim/dev/test/rspec_support/forms_validations.rb
decidim-dev-0.29.0 lib/decidim/dev/test/rspec_support/forms_validations.rb
decidim-dev-0.28.3 lib/decidim/dev/test/rspec_support/forms_validations.rb
decidim-dev-0.29.0.rc4 lib/decidim/dev/test/rspec_support/forms_validations.rb
decidim-dev-0.29.0.rc3 lib/decidim/dev/test/rspec_support/forms_validations.rb
decidim-dev-0.29.0.rc2 lib/decidim/dev/test/rspec_support/forms_validations.rb
decidim-dev-0.29.0.rc1 lib/decidim/dev/test/rspec_support/forms_validations.rb
decidim-dev-0.28.2 lib/decidim/dev/test/rspec_support/forms_validations.rb
decidim-dev-0.28.1 lib/decidim/dev/test/rspec_support/forms_validations.rb
decidim-dev-0.28.0 lib/decidim/dev/test/rspec_support/forms_validations.rb
decidim-dev-0.28.0.rc5 lib/decidim/dev/test/rspec_support/forms_validations.rb
decidim-dev-0.28.0.rc4 lib/decidim/dev/test/rspec_support/forms_validations.rb