Sha256: b4ae45a11e04e97eaad4d8e302f23e800b781eb53e76da942786c513ccbc53e8

Contents?: true

Size: 761 Bytes

Versions: 5

Compression:

Stored size: 761 Bytes

Contents

require 'spec_helper'

describe 'collections/_form_representative_image.html.erb' do
  let(:file) { build(:generic_file, title: ['birds.jpg']) }
  let(:work) { build(:generic_work, generic_files: [ file ]) }
  let(:collection) { build(:collection, members: [ work ]) }
  let(:form) { ActionView::Helpers::FormBuilder.new(:collection, collection, view, {}) }

  before do
    allow(collection).to receive(:persisted?).and_return(true)
    allow(view).to receive(:curation_concern).and_return(collection)
    allow(view).to receive(:f).and_return(form)
  end

  it "should have a list of the generic files images" do
    render
    expect(rendered).to have_selector "select#collection_representative option[value='#{file.id}']",
      text: 'birds.jpg'
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
worthwhile-0.1.2 spec/views/collections/_form_representative_image.html.erb_spec.rb
worthwhile-0.1.1 spec/views/collections/_form_representative_image.html.erb_spec.rb
worthwhile-0.1.0 spec/views/collections/_form_representative_image.html.erb_spec.rb
worthwhile-0.0.3 spec/views/collections/_form_representative_image.html.erb_spec.rb
worthwhile-0.0.2 spec/views/collections/_form_representative_image.html.erb_spec.rb