Sha256: 4e1e8f25195ad36bfe089a8527a9dee0ef3e598e83965500c3ec6b311abe0c31

Contents?: true

Size: 1.61 KB

Versions: 3

Compression:

Stored size: 1.61 KB

Contents

require 'spec_helper'

describe 'collections/_form.html.erb' do
  describe 'when the collection edit form is rendered' do
    let(:collection) { Collection.new({title: 'the title', description: 'the description',
                                       creator: 'the creator'})}

    before do
      controller.request.path_parameters[:id] = 'j12345'
      collection.initialize_fields
      assign(:collection, collection)
    end

    it "should draw the metadata fields for collection" do
      render
      expect(rendered).to have_selector("input#collection_title", count: 1)
      expect(rendered).to have_selector("input#collection_creator", count: 1)
      expect(rendered).to have_selector("textarea#collection_description", count: 1)
      expect(rendered).to have_selector("input#collection_contributor", count: 1)
      expect(rendered).to have_selector("input#collection_tag", count: 1)
      expect(rendered).to have_selector("input#collection_subject", count: 1)
      expect(rendered).to have_selector("input#collection_publisher", count: 1)
      expect(rendered).to have_selector("input#collection_date_created", count: 1)
      expect(rendered).to have_selector("input#collection_language", count: 1)
      expect(rendered).to have_selector("input#collection_identifier", count: 1)
      expect(rendered).to have_selector("input#collection_based_near", count: 1)
      expect(rendered).to have_selector("input#collection_related_url", count: 1)
      expect(rendered).to have_selector("select#collection_rights", count: 1)
      expect(rendered).to have_selector("select#collection_resource_type", count: 1)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sufia-4.0.1 spec/views/collections/_form.html.erb_spec.rb
sufia-4.0.0 spec/views/collections/_form.html.erb_spec.rb
sufia-4.0.0.rc2 spec/views/collections/_form.html.erb_spec.rb