Sha256: fd1c15b20f6b28a3ba0f75d2557f8393e2915537f05113268f2d32f147acc52d

Contents?: true

Size: 608 Bytes

Versions: 4

Compression:

Stored size: 608 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

module Decidim
  module Pages
    describe DestroyPage, :db do
      describe "call" do
        let(:feature) { create(:feature, manifest_name: "pages") }
        let!(:page)   { create(:page, feature: feature) }
        let(:command) { described_class.new(feature) }

        it "broadcasts ok" do
          expect { command.call }.to broadcast(:ok)
        end

        it "deletes the page associated to the feature" do
          expect do
            command.call
          end.to change { Page.count }.by(-1)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
decidim-0.3.2 decidim-pages/spec/commands/destroy_page_spec.rb
decidim-0.3.1 decidim-pages/spec/commands/destroy_page_spec.rb
decidim-0.3.0 decidim-pages/spec/commands/destroy_page_spec.rb
decidim-0.2.0 decidim-pages/spec/commands/destroy_page_spec.rb