Sha256: 3bb6239215abb3e6948a241fb03f8ac754c92bd174171b8038c0279cca20abfe

Contents?: true

Size: 623 Bytes

Versions: 23

Compression:

Stored size: 623 Bytes

Contents

RSpec.shared_examples_for 'model scoped by a site' do

  let!(:site) { model.site }

  it { expect(model).to respond_to(:site) }

  describe 'touch' do

    let(:date) { Time.zone.local(2015, 4, 1, 12, 0, 0) }

    subject { model.save! }

    it 'updates the updated_at attribute of the site' do
      Timecop.freeze(date) do
        expect { subject }.to change { site.updated_at }.to date
      end
    end

    it 'updates the template_version or content_version attribute of the site' do
      Timecop.freeze(date) do
        expect { subject }.to change { site.send(attribute) }.to date
      end
    end

  end

end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
locomotivecms-3.3.0 spec/support/shared_examples/site_scope_examples.rb
locomotivecms-3.3.0.rc3 spec/support/shared_examples/site_scope_examples.rb
locomotivecms-3.3.0.rc2 spec/support/shared_examples/site_scope_examples.rb
locomotivecms-3.1.2 spec/support/shared_examples/site_scope_examples.rb
locomotivecms-3.2.1 spec/support/shared_examples/site_scope_examples.rb
locomotivecms-3.3.0.rc1 spec/support/shared_examples/site_scope_examples.rb
locomotivecms-3.2.0 spec/support/shared_examples/site_scope_examples.rb
locomotivecms-3.2.0.rc2 spec/support/shared_examples/site_scope_examples.rb
locomotivecms-3.2.0.rc1 spec/support/shared_examples/site_scope_examples.rb
locomotivecms-3.1.1 spec/support/shared_examples/site_scope_examples.rb
locomotivecms-3.1.0 spec/support/shared_examples/site_scope_examples.rb
locomotivecms-3.1.0.rc3 spec/support/shared_examples/site_scope_examples.rb
locomotivecms-3.1.0.rc2 spec/support/shared_examples/site_scope_examples.rb
locomotivecms-3.1.0.rc1 spec/support/shared_examples/site_scope_examples.rb
locomotivecms-3.0.1 spec/support/shared_examples/site_scope_examples.rb
locomotivecms-3.0.0 spec/support/shared_examples/site_scope_examples.rb
locomotivecms-3.0.0.rc7 spec/support/shared_examples/site_scope_examples.rb
locomotivecms-3.0.0.rc6 spec/support/shared_examples/site_scope_examples.rb
locomotivecms-3.0.0.rc5 spec/support/shared_examples/site_scope_examples.rb
locomotivecms-3.0.0.rc4 spec/support/shared_examples/site_scope_examples.rb