Sha256: fad1055b03b9d3ac337528bd06fcc972c182c8f4a6198874d5690cb40928ccd3

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

require_relative '../../../test_helper'

module Troo
  describe Adaptors::Board do
    let(:described_class) { Adaptors::Board }
    let(:resource) do
      OpenStruct.new(
        id:          '526d8e130a14a9d846001d96',
        name:        'My Test Board',
        description: 'A very brief description...',
        closed:      false)
    end

    after { database_cleanup }

    describe '#initialize' do
      subject { described_class.new(resource) }

      it 'assigns the resource to an instance variable' do
        subject.instance_variable_get('@resource')
          .must_equal(resource)
      end
    end

    describe '#adapted' do
      subject { described_class.adapt(resource) }

      it 'returns an adapted resource for local persistence' do
        subject.must_equal(
          external_board_id: '526d8e130a14a9d846001d96',
          name:              'My Test Board',
          description:       'A very brief description...',
          closed:            'false'
        )
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
troo-0.0.8 test/lib/troo/adaptors/board_test.rb