Sha256: 805f71b552002dc9a2a0148aff02941df2fe1eb12566e052350ec48399593b77

Contents?: true

Size: 978 Bytes

Versions: 16

Compression:

Stored size: 978 Bytes

Contents

require 'spec_helper'

describe 'curation_concerns/base/show_actions' do
  let(:model) { double('model', persisted?: true, to_param: '123', model_name: GenericWork.model_name) }
  let(:presenter) { double("presenter", human_readable_type: 'Image', id: '123', to_model: model, valid_child_concerns: [GenericWork]) }
  before do
    assign(:presenter, presenter)
    render 'curation_concerns/base/show_actions.html.erb', collector: collector, editor: editor
  end

  context "as a collector" do
    let(:editor) { true }
    let(:collector) { true }
    it "shows the add to collection link" do
      expect(rendered).to have_link 'Add to a Collection'
    end
  end
  context "as an editor" do
    let(:editor) { true }
    let(:collector) { true }
    context "when there are valid_child_concerns" do
      it "creates a link" do
        expect(rendered).to have_link 'Attach Generic Work', href: "/concern/parent/#{presenter.id}/generic_works/new"
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
curation_concerns-1.6.0 spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb
curation_concerns-1.5.0 spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb
curation_concerns-1.4.0 spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb
curation_concerns-1.3.3 spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb
curation_concerns-1.3.2 spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb
curation_concerns-1.3.1 spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb
curation_concerns-1.3.0 spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb
curation_concerns-1.2.0 spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb
curation_concerns-1.1.2 spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb
curation_concerns-1.1.1 spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb
curation_concerns-1.1.0 spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb
curation_concerns-1.0.0 spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb
curation_concerns-1.0.0.beta10 spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb
curation_concerns-1.0.0.beta9 spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb
curation_concerns-1.0.0.beta8 spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb
curation_concerns-1.0.0.beta7 spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb