Sha256: 02229b29f5870850bd4830a44f4f2c5e98507eaee606fb1bfac92a172f8548d3

Contents?: true

Size: 835 Bytes

Versions: 11

Compression:

Stored size: 835 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

describe Decidim::Admin::PublishParticipatoryProcess do
  let(:my_process) { create :participatory_process, :unpublished }

  subject { described_class.new(my_process) }

  context "when the process is nil" do
    let(:my_process) { nil }

    it "is not valid" do
      expect { subject.call }.to broadcast(:invalid)
    end
  end

  context "when the process is published" do
    let(:my_process) { create :participatory_process }

    it "is not valid" do
      expect { subject.call }.to broadcast(:invalid)
    end
  end

  context "when the process is not published" do
    it "is valid" do
      expect { subject.call }.to broadcast(:ok)
    end

    it "publishes it" do
      subject.call
      my_process.reload
      expect(my_process).to be_published
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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