Sha256: 0f5ce86e35bded7f50938d065f777efd81d8fdde84404a620ad6672b22392e09

Contents?: true

Size: 629 Bytes

Versions: 7

Compression:

Stored size: 629 Bytes

Contents

require 'spec_helper'

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

  describe 'DSL methods' do
    subject { context_class }

    it { expect(subject.collection?).to be_false }
    it { expect(subject.single?).to be_true }
  end

  describe 'instance methods' do
    subject { context_class.new }

    it 'sets empty emtity for nil values' do
      subject.entity = nil
      expect(subject.values).to be_kind_of Hash
    end

    it 'sets entity Object' do
      subject.entity = Object.new
      expect(subject.values).to be_kind_of Hash
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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