Sha256: cec45c24c328000243f92b6eba66a81bfad43fa88062ed08db30f67236954960

Contents?: true

Size: 1.12 KB

Versions: 7

Compression:

Stored size: 1.12 KB

Contents

require 'spec_helper'

describe Locomotive::Steam::Site do

  let(:attributes) { {} }
  let(:site) { described_class.new(attributes) }

  describe '#handle' do

    let(:attributes) { { handle: 'acme' } }

    subject { site.handle }
    it { is_expected.to eq 'acme' }

    context 'from a subdomain if the handle property is nil' do

      let(:attributes) { { subdomain: 'acme' } }
      it { is_expected.to eq 'acme' }

    end

  end

  describe '#locales' do

    let(:attributes) { { locales: %w(en fr) } }

    subject { site.locales }
    it { is_expected.to eq [:en, :fr] }

  end

  describe '#default_locale' do

    let(:attributes) { { locales: %w(en fr) } }

    subject { site.default_locale }
    it { is_expected.to eq :en }

  end

  describe '#timezone_name' do

    subject { site.timezone_name }
    it { is_expected.to eq 'UTC' }

    context 'not blank' do

      let(:attributes) { { timezone: 'CDT' } }
      it { is_expected.to eq 'CDT' }

    end

    context 'from the timezone_name attribute itself' do

      let(:attributes) { { timezone_name: 'CDT' } }
      it { is_expected.to eq 'CDT' }

    end

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
locomotivecms_steam-1.0.0.pre.beta.3 spec/unit/entities/site_spec.rb
locomotivecms_steam-1.0.0.pre.beta.2 spec/unit/entities/site_spec.rb
locomotivecms_steam-1.0.0.pre.beta.1 spec/unit/entities/site_spec.rb
locomotivecms_steam-1.0.0.pre.alpha.3 spec/unit/entities/site_spec.rb
locomotivecms_steam-1.0.0.pre.alpha.2 spec/unit/entities/site_spec.rb
locomotivecms_steam-1.0.0.pre.alpha.1 spec/unit/entities/site_spec.rb
locomotivecms_steam-1.0.0.pre.alpha spec/unit/entities/site_spec.rb