Sha256: 5de253d232f903503a1469e0c2b44f417e015a117d402d75f85a75850ef70126

Contents?: true

Size: 1002 Bytes

Versions: 17

Compression:

Stored size: 1002 Bytes

Contents

require 'spec_helper'

module Sipity
  RSpec.describe Entity, type: :model do
    describe 'database configuration', no_clean: true do
      subject { described_class }
      its(:column_names) { is_expected.to include("proxy_for_global_id") }
      its(:column_names) { is_expected.to include("workflow_id") }
      its(:column_names) { is_expected.to include("workflow_state_id") }
    end

    subject { described_class.new }

    describe 'delegations', no_clean: true do
      it { is_expected.to delegate_method(:workflow_state_name).to(:workflow_state).as(:name) }
      it { is_expected.to delegate_method(:workflow_name).to(:workflow).as(:name) }
    end

    describe '#proxy_for' do
      let(:work) { FactoryGirl.create(:generic_work) }
      it 'will retrieve based on a GlobalID of the object' do
        entity = Sipity::Entity.create!(proxy_for_global_id: work.to_global_id, workflow_state_id: 1, workflow_id: 2)
        expect(entity.proxy_for).to eq(work)
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
curation_concerns-1.7.8 spec/models/sipity/entity_spec.rb
hyrax-1.0.1 spec/models/sipity/entity_spec.rb
hyrax-1.0.0.rc2 spec/models/sipity/entity_spec.rb
curation_concerns-1.7.7 spec/models/sipity/entity_spec.rb
curation_concerns-2.0.0 spec/models/sipity/entity_spec.rb
curation_concerns-2.0.0.rc2 spec/models/sipity/entity_spec.rb
hyrax-1.0.0.rc1 spec/models/sipity/entity_spec.rb
curation_concerns-1.7.6 spec/models/sipity/entity_spec.rb
curation_concerns-1.7.5 spec/models/sipity/entity_spec.rb
test_hyrax-0.0.1.alpha spec/models/sipity/entity_spec.rb
curation_concerns-1.7.4 spec/models/sipity/entity_spec.rb
curation_concerns-1.7.3 spec/models/sipity/entity_spec.rb
curation_concerns-1.7.2 spec/models/sipity/entity_spec.rb
curation_concerns-2.0.0.rc1 spec/models/sipity/entity_spec.rb
curation_concerns-1.7.1 spec/models/sipity/entity_spec.rb
curation_concerns-1.7.0 spec/models/sipity/entity_spec.rb
curation_concerns-1.7.0.beta1 spec/models/sipity/entity_spec.rb