Sha256: 7b8abb5bde4acd6659433ff341059286301312e575b4cce7fa38f9aab824e9e2

Contents?: true

Size: 927 Bytes

Versions: 19

Compression:

Stored size: 927 Bytes

Contents

# frozen_string_literal: true

# Helpers that get automatically included in component specs.
module Decidim::ComponentTestHelpers
  def click_submenu_link(text)
    within ".secondary-nav--subnav" do
      click_link text
    end
  end

  def within_user_menu
    within ".topbar__user__logged" do
      find("a", text: user.name).hover
      yield
    end
  end

  def within_language_menu
    within ".topbar__dropmenu.language-choose" do
      find("ul.dropdown.menu").hover
      yield
    end
  end

  def stripped(text)
    text.gsub(/^<p>/, "").gsub(%r{</p>$}, "")
  end

  def within_flash_messages
    within ".flash" do
      yield
    end
  end

  def expect_user_logged
    expect(page).to have_css(".topbar__user__logged")
  end

  def have_admin_callout(text)
    have_selector(".callout--full", text: text)
  end
end

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

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
decidim-dev-0.21.0 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.20.1 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.20.0 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.19.1 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.18.1 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.19.0 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.17.2 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.18.0 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.17.1 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.16.1 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.17.0 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.16.0 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.15.2 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.15.1 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.15.0 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.14.4 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.14.3 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.14.2 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.14.1 lib/decidim/dev/test/rspec_support/helpers.rb