Sha256: 8426cc9847599c11096f8b0e79518f91033b33b0544534b027539cdefe92641b

Contents?: true

Size: 777 Bytes

Versions: 19

Compression:

Stored size: 777 Bytes

Contents

# frozen_string_literal: true

shared_examples "editable content for admins" do
  describe "edit link" do
    before do
      relogin_as user
      visit current_path
    end

    context "when I'm an admin user" do
      let(:user) { create(:user, :admin, :confirmed, organization: organization) }

      it "has a link to edit the content at the admin" do
        within ".topbar" do
          expect(page).to have_link("Edit", href: /admin/)
        end
      end
    end

    context "when I'm a regular user" do
      let(:user) { create(:user, :confirmed, organization: organization) }

      it "does not have a link to edit the content at the admin" do
        within ".topbar" do
          expect(page).not_to have_link("Edit")
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

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