Sha256: c168a27db09e83110df141c1765df484b34d284c7badebee9d2ab97dc42e1ef2

Contents?: true

Size: 1.11 KB

Versions: 11

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper'

describe 'A timestamped model' do
  context 'A model' do
    subject(:model) { double('Mock model') }

    before :each do
      attrs.each do |attr|
        model.stub(attr)
      end
    end

    context 'that is a timestamped model' do
      let(:attrs) { [:id, :created_at, :updated_at, :deleted_at] }

      it_behaves_like 'a timestamped model'
    end

    context 'without an id' do
      let(:attrs) { [:created_at, :updated_at, :deleted_at] }

      it 'should not behave like a timestamped model' do
        pending
      end
    end

    context 'without an created_at' do
      let(:attrs) { [:id, :updated_at, :deleted_at] }

      it 'should not behave like a timestamped model' do
        pending
      end
    end

    context 'without an updated_at' do
      let(:attrs) { [:id, :created_at, :deleted_at] }

      it 'should not behave like a timestamped model' do
        pending
      end
    end

    context 'without an deleted_at' do
      let(:attrs) { [:id, :created_at, :updated_at] }

      it 'should not behave like a timestamped model' do
        pending
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
lookout-rack-test-2.3.0 spec/model_examples_spec.rb
lookout-rack-test-2.2.0 spec/model_examples_spec.rb
lookout-rack-test-2.1.0 spec/model_examples_spec.rb
lookout-rack-test-2.0.2 spec/model_examples_spec.rb
lookout-rack-test-2.0.1 spec/model_examples_spec.rb
lookout-rack-test-2.0.0 spec/model_examples_spec.rb
lookout-rack-test-1.3.0 spec/model_examples_spec.rb
lookout-rack-test-1.2.0 spec/model_examples_spec.rb
lookout-rack-test-1.1.0 spec/model_examples_spec.rb
lookout-rack-test-1.0.1 spec/model_examples_spec.rb
lookout-rack-test-1.0.0 spec/model_examples_spec.rb