<commit_before>require 'spec_helper'
require 'support/shared_examples_helpers'
require 'application_helper'

RSpec.configure do |c|
  c.include SharedExamplesHelpers
  c.include ApplicationHelper
end

shared_examples "a DulHydra object datastreams view" do |object_sym|
  subject { page }
  let(:obj) do
    o = FactoryGirl.create(object_sym)
    o.permissions = [{:access => 'read', :type => 'group', :name => 'public'}]
    o.save!
    o
  end
  before { visit object_datastreams_path(obj) }
  after { obj.delete }
  it "should have links to all datastreams" do
    obj.datastreams.each_key do |dsid|
      expect(subject).to have_link(dsid, :href => object_datastream_path(obj, dsid))
    end
  end
end

shared_examples "a DulHydra object datastream view" do |object_sym|
  subject { page }
  let(:obj) do
    o = FactoryGirl.create(object_sym)
    o.permissions = [{:access => 'read', :type => 'group', :name => 'public'}]
    o.save!<commit_msg>fixed test condition<commit_after>require 'spec_helper'
require 'support/shared_examples_helpers'
require 'application_helper'

RSpec.configure do |c|
  c.include SharedExamplesHelpers
  c.include ApplicationHelper
end

shared_examples "a DulHydra object datastreams view" do |object_sym|
  subject { page }
  let(:obj) do
    o = FactoryGirl.create(object_sym)
    o.permissions = [{:access => 'read', :type => 'group', :name => 'public'}]
    o.save!
    o
  end
  before { visit object_datastreams_path(obj) }
  after { obj.delete }
  it "should have links to all datastreams" do
    obj.datastreams.each do |dsid, ds|
      expect(subject).to have_link(dsid, :href => object_datastream_path(obj, dsid)) unless ds.profile.empty?
    end
  end
end

shared_examples "a DulHydra object datastream view" do |object_sym|
  subject { page }
  let(:obj) do
    o = FactoryGirl.create(object_sym)
    o.permissions = [{:access => 'read', :type => 'group', :name => 'public'}]
    o.save!
{'fraction_non_alphanumeric': 0.12215320910973085, 'fraction_numerical': 0.0, 'mean_word_length': 4.168449197860962, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6535419', 'n_tokens_mistral': 678, 'n_tokens_neox': 655, 'n_words': 172}