Sha256: 78a6f517392db9aa7d32e322811eb4a09481ff62b56e708cb83d5811dd909c80

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

require 'spec_helper'

describe "datastreams/index.html.erb" do
  before { visit fcrepo_admin.object_datastreams_path(object) }
  after { object.delete }
  let(:object) { FactoryGirl.create(:item) }
  it "should link to all datastreams" do
    object.datastreams.each do |dsid, ds|
      page.should have_link(dsid, :href => fcrepo_admin.object_datastream_path(object, ds))
    end
  end
  context "datastream is not persisted to Fedora" do
    it "should display a 'not used' label" do
      page.should have_xpath("//td[@class = \"#{object.safe_pid}-datastreams-content-not-persisted\" and contains(., \"#{I18n.t('fcrepo_admin.datastream.not_persisted')}\")]")
    end
  end
  context "datastream label is blank" do
    it "should display a 'no label' label" do
      page.should have_xpath("//em[contains(., \"#{I18n.t('fcrepo_admin.datastream.profile.no_label')}\")]")
    end
  end
  context "datastream label is not blank" do
    it "should display the datastream label" do
      page.should have_xpath("//td[@class = \"#{object.safe_pid}-datastreams-RELS-EXT-dsLabel\" and contains(., \"Fedora Object-to-Object Relationship Metadata\")]")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fcrepo_admin-0.6.1 spec/features/datastreams/index.html.erb_spec.rb