def select_collection(collection)
      first('a.select2-choice').click
      find('.select2-input').set(collection.title.first)
      expect(page).to have_css('div.select2-result-label')
      first('div.select2-result-label').click
      first('[data-behavior~=add-relationship]').click
      within('[data-behavior~=collection-relationships]') do
        within('table.table.table-striped') do
          expect(page).to have_content(collection.title.first)
        end
      end
    end
def select_collection(collection)
      first('a.select2-choice').click
      find('.select2-input').set(collection.title.first)
      expect(page).to have_css('div.select2-result-label')
      first('div.select2-result-label').click
      first('[data-behavior~=add-relationship]').click
      within('[data-behavior~=collection-relationships]') do
        within('table.table.table-striped') do
          expect(page).to have_content(collection.title.first)
        end
      end
    end
For use with javascript collection selector that allows for searching for an existing collection from works relationship tab.
 Adds the collection and validates that the collection is listed in the Collection Relationship table once added.
 @param [Collection] collection to select