Sha256: 80f74093ed0cf015025e5c4007f22457622e38720aa1e65a7627d2096e8b28c8

Contents?: true

Size: 692 Bytes

Versions: 4

Compression:

Stored size: 692 Bytes

Contents

require 'spec_helper'

describe Worthwhile::CollectionsHelper do
  describe "#link_to_remove_from_collection" do
    let(:collection) { double(id: '123') }
    let(:collectible) { double(id: '456') }
    before do
      assign(:collection, collection)
    end
    subject { helper.link_to_remove_from_collection(collectible) }

    it "should have a form that routes to remove the collectible" do
      expect(subject).to have_selector 'a[data-method=put]'
      expect(subject).to have_link 'Remove From Collection',
        href: collections.collection_path('123', collection: { members: 'remove'},
                                          batch_document_ids: [ '456' ])
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
worthwhile-0.1.1 spec/helpers/worthwhile/collections_helper_spec.rb
worthwhile-0.1.0 spec/helpers/worthwhile/collections_helper_spec.rb
worthwhile-0.0.3 spec/helpers/worthwhile/collections_helper_spec.rb
worthwhile-0.0.2 spec/helpers/worthwhile/collections_helper_spec.rb