Sha256: 24ae72b266e5efba2002b37ed72d4c756939596df8da9458f8c9d68830b8cfc5

Contents?: true

Size: 1.58 KB

Versions: 15

Compression:

Stored size: 1.58 KB

Contents

require 'test_helper'

module Vedeu

  module Repositories

    describe Model do

      let(:described)  { Vedeu::Repositories::ModelTestClass }
      let(:instance)   { described.new(attributes) }
      let(:attributes) {
        {
          name: 'hydrogen'
        }
      }

      describe 'accessors' do
        it { instance.must_respond_to(:repository) }
        it { instance.must_respond_to(:repository=) }
      end

      describe '.build' do
        let(:attributes) {}

        subject { described.build(attributes) { } }

        # @todo Add more tests.
        # it { skip }
      end

      describe '.child' do
        let(:klass) {}

        subject { described.child(klass) }

        it { described.must_respond_to(:member) }
        it { described.must_respond_to(:collection) }

        # @todo Add more tests.
        # it { skip }
      end

      describe '.repository' do
        let(:klass) {}

        subject { described.repository(klass) }

        # @todo Add more tests.
        # it { skip }
      end

      describe '.store' do
        let(:klass) {}

        context 'when a block is given' do
          subject { described.store(klass) }
        end

        context 'when a block is not given' do
          subject { described.store(klass) { :some_proc } }
        end

        # @todo Add more tests.
        # it { skip }
      end

      describe '#store' do
        subject { instance.store }

        it 'returns the model' do
          subject.must_be_instance_of(Vedeu::Repositories::ModelTestClass)
        end
      end

    end # Model

  end # Repositories

end # Vedeu

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
vedeu-0.7.4 test/lib/vedeu/repositories/model_test.rb
vedeu-0.7.3 test/lib/vedeu/repositories/model_test.rb
vedeu-0.7.2 test/lib/vedeu/repositories/model_test.rb
vedeu-0.7.1 test/lib/vedeu/repositories/model_test.rb
vedeu-0.7.0 test/lib/vedeu/repositories/model_test.rb
vedeu-0.6.71 test/lib/vedeu/repositories/model_test.rb
vedeu-0.6.70 test/lib/vedeu/repositories/model_test.rb
vedeu-0.6.69 test/lib/vedeu/repositories/model_test.rb
vedeu-0.6.68 test/lib/vedeu/repositories/model_test.rb
vedeu-0.6.67 test/lib/vedeu/repositories/model_test.rb
vedeu-0.6.66 test/lib/vedeu/repositories/model_test.rb
vedeu-0.6.65 test/lib/vedeu/repositories/model_test.rb
vedeu-0.6.64 test/lib/vedeu/repositories/model_test.rb
vedeu-0.6.63 test/lib/vedeu/repositories/model_test.rb
vedeu-0.6.62 test/lib/vedeu/repositories/model_test.rb