Sha256: 40f70f28826a3aed6f10e1fef03da2d13f46646dae536d26529b25592d367258

Contents?: true

Size: 552 Bytes

Versions: 10

Compression:

Stored size: 552 Bytes

Contents

require 'spec_helper'
RSpec.describe Hyrax::Forms::AdminSetForm do
  let(:form) { described_class.new(model) }

  describe "[] accessors" do
    let(:model) { AdminSet.new(description: ['one']) }
    it "cast to scalars" do
      expect(form[:description]).to eq 'one'
    end
  end

  describe "model_attributes" do
    let(:raw_attrs) { ActionController::Parameters.new(title: 'test title') }
    subject { described_class.model_attributes(raw_attrs) }

    it "casts to enums" do
      expect(subject[:title]).to eq ['test title']
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
hyrax-1.1.1 spec/forms/hyrax/forms/admin_set_form_spec.rb
hyrax-1.1.0 spec/forms/hyrax/forms/admin_set_form_spec.rb
hyrax-1.0.5 spec/forms/hyrax/forms/admin_set_form_spec.rb
hyrax-1.0.4 spec/forms/hyrax/forms/admin_set_form_spec.rb
hyrax-1.0.3 spec/forms/hyrax/forms/admin_set_form_spec.rb
hyrax-1.0.2 spec/forms/hyrax/forms/admin_set_form_spec.rb
hyrax-1.0.1 spec/forms/hyrax/forms/admin_set_form_spec.rb
hyrax-1.0.0.rc2 spec/forms/hyrax/forms/admin_set_form_spec.rb
hyrax-1.0.0.rc1 spec/forms/hyrax/forms/admin_set_form_spec.rb
test_hyrax-0.0.1.alpha spec/forms/hyrax/forms/admin_set_form_spec.rb