Sha256: 95e933a8f92c6e95f9afd3afbb56f794bfcb8f53059d0e8f65ef0417e1c1dd73

Contents?: true

Size: 757 Bytes

Versions: 5

Compression:

Stored size: 757 Bytes

Contents

require 'spec_helper'

describe 'generic_files/edit.html.erb', :type => :view do
  describe 'when the file has two or more resource types' do
    let(:generic_file) {
      content = double('content', versions: [], mimeType: 'application/pdf')
      stub_model(GenericFile, noid: '123',
        depositor: 'bob',
        resource_type: ['Book', 'Dataset'],
        content: content)
    }

    before do
      allow(controller).to receive(:current_user).and_return(stub_model(User))
      assign(:generic_file, generic_file)
    end

    it "should only draw one resource_type multiselect" do
      render
      page = Capybara::Node::Simple.new(rendered)
      expect(page).to have_selector("select#generic_file_resource_type", count: 1)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sufia-5.0.0 spec/views/generic_file/edit.html.erb_spec.rb
sufia-5.0.0.rc1 spec/views/generic_file/edit.html.erb_spec.rb
sufia-4.3.1 spec/views/generic_file/edit.html.erb_spec.rb
sufia-4.2.0 spec/views/generic_file/edit.html.erb_spec.rb
sufia-4.1.0 spec/views/generic_file/edit.html.erb_spec.rb