Sha256: b739f8cf3ce91b553522ecc124db521a86950a228e1616466949056eace0755e

Contents?: true

Size: 580 Bytes

Versions: 54

Compression:

Stored size: 580 Bytes

Contents

require 'spec_helper'

describe Locomotive::Steam::Models::Scope do

  let(:site)    { instance_double('Site', _id: 1) }
  let(:locale)  { :en }
  let(:context) { nil }
  let(:scope)   { described_class.new(site, locale, context) }

  describe '#to_key' do

    subject { scope.to_key }

    it { is_expected.to eq 'site_1' }

    context 'with a content type for instance' do

      let(:content_type) { instance_double('ContentType', _id: 42) }
      let(:context) { { content_type: content_type } }

      it { is_expected.to eq 'site_1_content_type_42' }

    end

  end

end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
locomotivecms_steam-1.8.0.alpha2 spec/unit/models/scope_spec.rb
locomotivecms_steam-1.8.0.alpha1 spec/unit/models/scope_spec.rb
locomotivecms_steam-1.7.1 spec/unit/models/scope_spec.rb
locomotivecms_steam-1.7.0 spec/unit/models/scope_spec.rb
locomotivecms_steam-1.6.1 spec/unit/models/scope_spec.rb
locomotivecms_steam-1.6.0 spec/unit/models/scope_spec.rb
locomotivecms_steam-1.6.0.rc1 spec/unit/models/scope_spec.rb
locomotivecms_steam-1.6.0.beta1 spec/unit/models/scope_spec.rb
locomotivecms_steam-1.5.3 spec/unit/models/scope_spec.rb
locomotivecms_steam-1.5.2 spec/unit/models/scope_spec.rb
locomotivecms_steam-1.5.1 spec/unit/models/scope_spec.rb
locomotivecms_steam-1.5.0 spec/unit/models/scope_spec.rb
locomotivecms_steam-1.5.0.rc1 spec/unit/models/scope_spec.rb
locomotivecms_steam-1.5.0.rc0 spec/unit/models/scope_spec.rb
locomotivecms_steam-1.5.0.beta3 spec/unit/models/scope_spec.rb
locomotivecms_steam-1.5.0.beta2 spec/unit/models/scope_spec.rb
locomotivecms_steam-1.5.0.beta1 spec/unit/models/scope_spec.rb
locomotivecms_steam-1.4.1 spec/unit/models/scope_spec.rb
locomotivecms_steam-1.4.0 spec/unit/models/scope_spec.rb
locomotivecms_steam-1.4.0.rc2 spec/unit/models/scope_spec.rb