Sha256: 4c47b2f739de7caba73ae021a5a41ae3618302ea3038109c213cc2b0cbdc1dec

Contents?: true

Size: 1.25 KB

Versions: 9

Compression:

Stored size: 1.25 KB

Contents

# frozen_string_literal: true

shared_context "with menu hacks params" do
  let(:organization) { create(:organization) }
  let(:context) do
    {
      current_user: create(:user, organization: organization),
      current_organization: organization
    }
  end
  let(:params) do
    {
      raw_label: label,
      url: url,
      position: position,
      target: target,
      visibility: visibility
    }
  end
  let(:attributes) do
    {
      "label" => label,
      "url" => url,
      "position" => position,
      "target" => target,
      "visibility" => visibility
    }
  end
  let(:label) do
    {
      "en" => "Menu english",
      "ca" => "Menu catalan"
    }
  end
  let(:url) { "/some-path" }
  let(:position) { 2 }
  let(:target) { "_blank" }
  let(:visibility) { "hidden" }
  let(:menu_name) { "menu" }

  let(:another_params) do
    {
      allow_images_in_full_editor: true,
      allow_images_in_small_editor: true
    }
  end
  let(:form) do
    Decidim::DecidimAwesome::Admin::MenuForm.from_params(params).with_context(context)
  end
  let(:another_form) do
    Decidim::DecidimAwesome::Admin::ConfigForm.from_params(another_params).with_context(context)
  end
  let(:another_config) { Decidim::DecidimAwesome::Admin::UpdateConfig.new(another_form) }
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
decidim-decidim_awesome-0.10.2 lib/decidim/decidim_awesome/test/shared_examples/menu_hack_contexts.rb
decidim-decidim_awesome-0.10.1 lib/decidim/decidim_awesome/test/shared_examples/menu_hack_contexts.rb
decidim-decidim_awesome-0.10.0 lib/decidim/decidim_awesome/test/shared_examples/menu_hack_contexts.rb
decidim-decidim_awesome-0.9.3 lib/decidim/decidim_awesome/test/shared_examples/menu_hack_contexts.rb
decidim-decidim_awesome-0.9.1 lib/decidim/decidim_awesome/test/shared_examples/menu_hack_contexts.rb
decidim-decidim_awesome-0.8.3 lib/decidim/decidim_awesome/test/shared_examples/menu_hack_contexts.rb
decidim-decidim_awesome-0.8.2 lib/decidim/decidim_awesome/test/shared_examples/menu_hack_contexts.rb
decidim-decidim_awesome-0.8.1 lib/decidim/decidim_awesome/test/shared_examples/menu_hack_contexts.rb
decidim-decidim_awesome-0.8.0 lib/decidim/decidim_awesome/test/shared_examples/menu_hack_contexts.rb