Sha256: f9f10ba954634e360b886034ab85a0adf71aaa6e456f8d893479be722efe1513

Contents?: true

Size: 805 Bytes

Versions: 7

Compression:

Stored size: 805 Bytes

Contents

require 'spec_helper'

describe 'generic_files/edit.html.erb' do
  describe 'when the file has two or more resource types' do
    let(:generic_file) {
      content = double('content', versions: [])
      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

7 entries across 7 versions & 1 rubygems

Version Path
sufia-4.0.0.beta2 spec/views/generic_file/edit.html.erb_spec.rb
sufia-4.0.0.beta1 spec/views/generic_file/edit.html.erb_spec.rb
sufia-3.7.2 spec/views/generic_file/edit.html.erb_spec.rb
sufia-3.7.1 spec/views/generic_file/edit.html.erb_spec.rb
sufia-3.7.0 spec/views/generic_file/edit.html.erb_spec.rb
sufia-3.6.1 spec/views/generic_file/edit.html.erb_spec.rb
sufia-3.6.0 spec/views/generic_file/edit.html.erb_spec.rb