Sha256: 0d6d0493c05f6661563cae1aa8b20be273be2c1e7726a38ece6dd7a8834b8217

Contents?: true

Size: 1.24 KB

Versions: 7

Compression:

Stored size: 1.24 KB

Contents

require 'spec_helper'

describe 'catalog/_add_to_collection_gui' do
  let(:document) { FactoryGirl.create(:generic_work) }

  context 'with collections' do
    before do
      assign :collection_options, [document]
      assign :profile_collection_options, []
      render partial: 'add_to_collection_gui', locals: { document: document }
    end

    it 'displays the link to add work to a collection' do
      rendered.should have_link('Add to Collection', add_member_form_collections_path(collectible_id: document.pid))
    end
  end

  context 'with a profile' do
    before do
      assign :collection_options, []
      assign :profile_collection_options, [document]
      render partial: 'add_to_collection_gui', locals: { document: document }
    end

    it 'displays the link to add work to a collection' do
      rendered.should have_link('Add to Collection', add_member_form_collections_path(collectible_id: document.pid))
    end
  end

  context 'with no collections' do
    before do
      assign :collection_options, []
      assign :profile_collection_options, []
      render partial: 'add_to_collection_gui', locals: { document: document }
    end

    it 'displays no link' do
      rendered.should_not have_link('Add to Collection')
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
curate-0.5.6 spec/views/catalog/_add_to_collection_gui.html.erb_spec.rb
curate-0.5.5 spec/views/catalog/_add_to_collection_gui.html.erb_spec.rb
curate-0.5.4 spec/views/catalog/_add_to_collection_gui.html.erb_spec.rb
curate-0.5.2 spec/views/catalog/_add_to_collection_gui.html.erb_spec.rb
curate-0.5.1 spec/views/catalog/_add_to_collection_gui.html.erb_spec.rb
curate-0.5.0 spec/views/catalog/_add_to_collection_gui.html.erb_spec.rb
curate-0.4.2 spec/views/catalog/_add_to_collection_gui.html.erb_spec.rb