Sha256: 33bb8d939eff4f84f8f1323fa40c643ff3fcfc57d381c981f607203bb2274473

Contents?: true

Size: 820 Bytes

Versions: 27

Compression:

Stored size: 820 Bytes

Contents

# frozen_string_literal: true

# Helpers that get automatically included in feature specs.
module Decidim::FeatureTestHelpers
  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)
    Nokogiri::HTML(text).text
  end

  def within_flash_messages
    within ".flash" do
      yield
    end
  end

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

RSpec.configure do |config|
  config.include Decidim::FeatureTestHelpers, type: :feature
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
decidim-dev-0.7.4 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.7.3 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.7.2 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.7.1 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.7.0 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.6.8 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-0.6.8 decidim-dev/lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.6.7 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-0.6.7 decidim-dev/lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.6.6 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-0.6.6 decidim-dev/lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.6.5 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-0.6.5 decidim-dev/lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.6.4 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-0.6.4 decidim-dev/lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.6.3 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-0.6.3 decidim-dev/lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.6.2 lib/decidim/dev/test/rspec_support/helpers.rb
decidim-0.6.2 decidim-dev/lib/decidim/dev/test/rspec_support/helpers.rb
decidim-dev-0.6.1 lib/decidim/dev/test/rspec_support/helpers.rb