Sha256: d84f01f9e1045ac4ab48c45a2793372c836e78d3ab5142bde3fe192e6c480388

Contents?: true

Size: 1.27 KB

Versions: 6

Compression:

Stored size: 1.27 KB

Contents

require 'spec_helper'

describe 'curation_concern/base/_form.html.erb' do

  let(:person) { FactoryGirl.create(:person_with_user) }
  let(:user) { person.user }
  let(:contributor_agreement) { double( :contributor_agreement, param_key: :accept_contributor_agreement, acceptance_value: 'accept', param_value: 'accept' ) }
  context 'New Work' do
    let(:work) { FactoryGirl.build(:generic_work, title: 'work 1') }
    before(:each) do
      controller.stub(:current_user).and_return(user)
      assign(:curation_concern, work)
      render partial: 'form', locals: {curation_concern: work, contributor_agreement: contributor_agreement}
    end
    it 'should have Cancel link which takes to root page' do
      expect(rendered).to have_link('Cancel', href: root_path)
    end
  end

  context 'Edit Work' do
    let(:work) {FactoryGirl.build(:generic_work, title: 'work 1') }
    before(:each) do
      work.save
      controller.stub(:current_user).and_return(user)
      assign(:curation_concern, work)
      render partial: 'form', locals: {curation_concern: work, contributor_agreement: contributor_agreement}
    end
    it 'should have Cancel link which takes to show view' do
      expect(rendered).to have_link('Cancel', href: polymorphic_path([:curation_concern, work]))
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
curate-0.6.6 spec/views/curation_concern/base/_form.html.erb_spec.rb
curate-0.6.5 spec/views/curation_concern/base/_form.html.erb_spec.rb
curate-0.6.4 spec/views/curation_concern/base/_form.html.erb_spec.rb
curate-0.6.3 spec/views/curation_concern/base/_form.html.erb_spec.rb
curate-0.6.1 spec/views/curation_concern/base/_form.html.erb_spec.rb
curate-0.6.0 spec/views/curation_concern/base/_form.html.erb_spec.rb