spec/features/datastreams/index.html.erb_spec.rb in fcrepo_admin-0.6.0 vs spec/features/datastreams/index.html.erb_spec.rb in fcrepo_admin-0.6.1
- old
+ new
@@ -6,7 +6,22 @@
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
+ 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