Sha256: b84733d7d2c2a11b1436cc4a68e2efa9276e197d5d3a447d05eb82149b9b9dea

Contents?: true

Size: 997 Bytes

Versions: 1

Compression:

Stored size: 997 Bytes

Contents

require 'spec_helper'

describe "associations/index.html.erb" do
  let(:object) { FactoryGirl.create(:item) }
  after { object.delete }
  context "association is a collection" do
    let(:part) { FactoryGirl.create(:part) }
    before { object.parts << part }
    after do
      part.delete
      object.reload
    end
    it "should link to the show view of the association" do
      visit fcrepo_admin.object_associations_path(object)
      page.should have_link("1 object", :href => fcrepo_admin.object_association_path(object, "parts"))
    end
  end
  context "association is not a collection" do
    let(:collection) { FactoryGirl.create(:collection) }
    before { collection.members << object }
    after { collection.delete }
    it "should link to the show view of the target object" do
      pending "Bug in Capybara?"
      visit fcrepo_admin.object_associations_path(object)
      page.should have_link(collection.pid, :href => fcrepo_admin.object_path(collection))
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fcrepo_admin-0.4.0 spec/features/associations/index.html.erb_spec.rb