Sha256: 94000d7f0b8d4bf322eadd82d284413d523f2aaa041cff1c082d153af4d19d0c

Contents?: true

Size: 782 Bytes

Versions: 7

Compression:

Stored size: 782 Bytes

Contents

require 'spec_helper'

describe AdminIt::Context do
  let(:context_class) { described_class.create_class(:test, object_resource) }
  subject { context_class.new }

  # DSL methods
  it { expect(context_class.collection?).to be_false }
  it { expect(context_class.single?).to be_false }

  # instance methods
  it { expect(subject.collection?).to be_false }
  it { expect(subject.single?).to be_false }

  it 'sets entity class to Resource entity class' do
    expect(subject.entity_class).to eq object_resource.entity_class
  end

  it 'sets fields to empty array by default' do
    expect(subject.class.fields).to eq []
  end

  it 'extends AdminIt::Object context by default' do
    expect(subject.class.included_modules)
      .to include AdminIt::ObjectData::Context
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
admin_it-1.0.7 spec/lib/context/context_spec.rb
admin_it-1.0.6 spec/lib/context/context_spec.rb
admin_it-1.0.5 spec/lib/context/context_spec.rb
admin_it-1.0.4 spec/lib/context/context_spec.rb
admin_it-1.0.3 spec/lib/context/context_spec.rb
admin_it-1.0.2 spec/lib/context/context_spec.rb
admin_it-1.0.1 spec/lib/context/context_spec.rb