Sha256: 5d22647a6048ab234597104e6c0862c885e5e0d6cfb39c55084c1724987015b6

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::Collection::BuildTypeDefinition do
  def build_type_definition(name = :name, **options)
    @reflection = Granite::Form::Model::Attributes::Reflections::Collection.new(name, options)
    described_class.new(owner, @reflection).call
  end

  def have_collection_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_collection_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/collection/build_type_definition_spec.rb
granite-form-0.5.0 spec/granite/form/model/attributes/reflections/collection/build_type_definition_spec.rb
granite-form-0.4.0 spec/granite/form/model/attributes/reflections/collection/build_type_definition_spec.rb