Sha256: ef8d3c8b1762bd6d13b0f4cf3245bc84f85af302cc283d0b400c51b91fa61430

Contents?: true

Size: 731 Bytes

Versions: 3

Compression:

Stored size: 731 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Granite::Form::Model::Attributes::Reflections::Dictionary::BuildTypeDefinition do
  def build_type_definition(name = :name, **options)
    @reflection = Granite::Form::Model::Attributes::Reflections::Dictionary.new(name, options)
    described_class.new(owner, @reflection).call
  end

  def have_dictionary_type(type)
    subtype_definition = have_attributes(type: type, reflection: @reflection, owner: owner)
    have_attributes(subtype_definition: subtype_definition)
  end

  before do
    stub_class :owner
    stub_class(:dummy, String)
  end

  let(:owner) { Owner.new }

  it { expect(build_type_definition(type: String)).to have_dictionary_type(String) }
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
granite-form-0.6.0 spec/granite/form/model/attributes/reflections/dictionary/build_type_definition_spec.rb
granite-form-0.5.0 spec/granite/form/model/attributes/reflections/dictionary/build_type_definition_spec.rb
granite-form-0.4.0 spec/granite/form/model/attributes/reflections/dictionary/build_type_definition_spec.rb