Sha256: e53a14effe99772b6948c6d8606cb96cf9284a73671418fbcbcc82932f26a665

Contents?: true

Size: 1.11 KB

Versions: 2

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

2 entries across 2 versions & 1 rubygems

Version Path
lookout-rack-test-3.0.0 spec/model_examples_spec.rb
lookout-rack-test-2.3.1 spec/model_examples_spec.rb