Sha256: f8cacba570d634808cbdb4a53c48651b3dd125b12384c8e8664f9cd755f9eee3

Contents?: true

Size: 939 Bytes

Versions: 31

Compression:

Stored size: 939 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

shared_examples "present admin log entry" do
  subject(:presenter) { described_class.new(action_log, helper) }

  let(:organization) { create(:organization) }
  let(:user) { create(:user, organization: organization) }
  let(:action) { "create" }
  let(:admin_log_extra_data) { {} }
  let(:action_log) do
    create(
      :action_log,
      user: user,
      action: action,
      resource: admin_log_resource,
      extra_data: admin_log_extra_data
    )
  end

  before do
    helper.extend(Decidim::ApplicationHelper)
    helper.extend(Decidim::TranslationsHelper)
  end

  describe "#present" do
    subject { presenter.present }

    context "when the logged action is one that shows diff and the action log does not have an associated version" do
      it "returns an empty diff" do
        expect(subject).not_to include("class=\"logs__log__diff\"")
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
decidim-core-0.27.9 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb
decidim-core-0.27.8 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb
decidim-core-0.27.7 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb
decidim-core-0.27.6 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb
decidim-core-0.26.10 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb
decidim-core-0.26.9 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb
decidim-core-0.27.5 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb
decidim-core-0.26.8 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb
decidim-core-0.27.4 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb
decidim-core-0.27.3 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb
decidim-core-0.26.7 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb
decidim-core-0.26.5 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb
decidim-core-0.27.2 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb
decidim-core-0.27.1 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb
decidim-core-0.26.4 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb
decidim-core-0.27.0 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb
decidim-core-0.26.3 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb
decidim-core-0.27.0.rc2 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb
decidim-core-0.27.0.rc1 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb
decidim-core-0.26.2 lib/decidim/core/test/shared_examples/admin_log_presenter_examples.rb