Sha256: 91d9850b7c96bb0d6b3c272205636763f745a287a1e283e53df32635e4c07d43

Contents?: true

Size: 843 Bytes

Versions: 12

Compression:

Stored size: 843 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

module Decidim
  module System
    describe CreateDefaultPages do
      let(:organization) { create(:organization) }
      subject { described_class.new(organization).call }

      it "creates all the default pages for an organization" do
        expect do
          subject
        end.to change { organization.static_pages.count }.by(Decidim::StaticPage::DEFAULT_PAGES.length)
      end

      it "sets the content with each locale" do
        allow(Decidim).to receive(:available_locales).and_return [:en, :ca]

        subject

        organization.static_pages.each do |page|
          expect(page.title["en"]).to be
          expect(page.title["ca"]).to be
          expect(page.content["en"]).to be
          expect(page.content["ca"]).to be
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
decidim-0.6.8 decidim-system/spec/commands/decidim/system/create_default_pages_spec.rb
decidim-0.6.7 decidim-system/spec/commands/decidim/system/create_default_pages_spec.rb
decidim-0.6.6 decidim-system/spec/commands/decidim/system/create_default_pages_spec.rb
decidim-0.6.5 decidim-system/spec/commands/decidim/system/create_default_pages_spec.rb
decidim-0.6.4 decidim-system/spec/commands/decidim/system/create_default_pages_spec.rb
decidim-0.6.3 decidim-system/spec/commands/decidim/system/create_default_pages_spec.rb
decidim-0.6.2 decidim-system/spec/commands/decidim/system/create_default_pages_spec.rb
decidim-0.6.1 decidim-system/spec/commands/decidim/system/create_default_pages_spec.rb
decidim-0.6.0 decidim-system/spec/commands/decidim/system/create_default_pages_spec.rb
decidim-0.5.1 decidim-system/spec/commands/decidim/system/create_default_pages_spec.rb
decidim-0.5.0 decidim-system/spec/commands/decidim/system/create_default_pages_spec.rb
decidim-0.4.4 decidim-system/spec/commands/decidim/system/create_default_pages_spec.rb