Sha256: a19c4119f6e1872c636e5c949f6a0ce497873c58c88ccd2e20ed55f918233bc4

Contents?: true

Size: 1.34 KB

Versions: 11

Compression:

Stored size: 1.34 KB

Contents

# frozen_string_literal: true

require "spec_helper"

module Decidim
  module Admin
    describe MenuHelper do
      describe "main_menu" do
        let(:default_main_menu) { helper.main_menu.render }

        let(:current_organization) { create(:organization) }

        before do
          allow(view).to receive(:current_organization).and_return(current_organization)
          allow(view).to receive(:can?).and_return(true)
        end

        it "renders the default main menu" do
          expect(default_main_menu).to \
            have_selector("li", count: 7) &
            have_link("?Dashboard", href: "/admin/") &
            have_link("?Processes", href: "/admin/participatory_processes") &
            have_link("?Process groups", href: "/admin/participatory_process_groups") &
            have_link("?Pages", href: "/admin/static_pages") &
            have_link("?Users", href: "/admin/users") &
            have_link("?Newsletters", href: "/admin/newsletters") &
            have_link("?Settings", href: "/admin/organization/edit")
        end

        it "selects the correct default active option" do
          allow(view).to \
            receive(:params).and_return(controller: "decidim/admin/dashboard", action: "show")

          expect(default_main_menu).to have_selector(".is-active", text: "Dashboard")
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
decidim-0.5.1 decidim-admin/spec/helpers/menu_helper_spec.rb
decidim-0.5.0 decidim-admin/spec/helpers/menu_helper_spec.rb
decidim-0.4.4 decidim-admin/spec/helpers/menu_helper_spec.rb
decidim-0.4.3 decidim-admin/spec/helpers/menu_helper_spec.rb
decidim-0.4.2 decidim-admin/spec/helpers/menu_helper_spec.rb
decidim-0.4.1 decidim-admin/spec/helpers/menu_helper_spec.rb
decidim-0.4.0 decidim-admin/spec/helpers/menu_helper_spec.rb
decidim-0.3.2 decidim-admin/spec/helpers/menu_helper_spec.rb
decidim-0.3.1 decidim-admin/spec/helpers/menu_helper_spec.rb
decidim-0.3.0 decidim-admin/spec/helpers/menu_helper_spec.rb
decidim-0.2.0 decidim-admin/spec/helpers/menu_helper_spec.rb