Skip to content

Commit

Permalink
Fixed license & bulkrax tests*
Browse files Browse the repository at this point in the history
  • Loading branch information
dolsysmith committed Sep 5, 2024
1 parent c0e90ab commit 399f53a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
6 changes: 1 addition & 5 deletions lib/tasks/ingest_bulkrax_prep.rake
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,7 @@ namespace :gwss do
work_metadata['date_created'] = etd_date_created unless etd_date_created.nil?
work_metadata['committee_member'] = get_committee_members(doc).join(';')
work_metadata['rights_statement'] = 'http://rightsstatements.org/vocab/InC/1.0/'
# Can't currently load this license because this Bulkrax code
# https://github.com/samvera/bulkrax/blob/v8.1.0/app/models/concerns/bulkrax/import_behavior.rb#L145-L146
# will try to match it with http://www.europeana.eu/portal/rights/rr-r.html/ (slash-terminated)
# -- not finding a match, Bulkrax will throw an error.
# work_metadata['license'] = 'http://www.europeana.eu/portal/rights/rr-r.html'
work_metadata['license'] = 'All rights reserved'
work_metadata
end

Expand Down
6 changes: 5 additions & 1 deletion spec/factories/gw_works.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
end
end

after(:create) do |work, _evaluator|
after(:create) do |work, options|
# Add the user's ability to the work -> necessary for enabling access to Edit pages
actor = Hyrax::CurationConcern.actor
actor_environment = Hyrax::Actors::Environment.new(work, Ability.new(options.user), {})
actor.create(actor_environment)
work.save! if work.try(:member_of_collections) && work.member_of_collections.present?
end

Expand Down
4 changes: 2 additions & 2 deletions spec/features/bulkrax_upload_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
csv_rows = CSV.read("#{@temp_dir}/metadata.csv")

headers_arr = csv_rows[0]

print headers_arr
expect(headers_arr).to eq(["model", "title", "creator", "contributor", "language",
"description", "keyword", "degree", "resource_type", "advisor", "gw_affiliation",
"date_created", "committee_member", "rights_statement", "bulkrax_identifier",
"date_created", "committee_member", "rights_statement", "license", "bulkrax_identifier",
"file", "parents", "visibility", "visibility_during_embargo",
"visibility_after_embargo", "embargo_release_date"])

Expand Down
13 changes: 4 additions & 9 deletions spec/features/license_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
let(:solr) { Blacklight.default_index.connection }
let(:admin_set) { FactoryBot.create(:admin_set) }

let(:content_admin_user) { FactoryBot.create(:content_admin_user) }
let(:content_admin_user) { FactoryBot.create(:content_admin) }

let(:work_with_license) { FactoryBot.create(:gw_work,
let(:work_with_license) { FactoryBot.create(:public_work,
admin_set: admin_set,
visibility: "public",
user: content_admin_user) }

let(:another_license_value) { Hyrax::QaSelectService.new('licenses').select_active_options.first.first }
Expand All @@ -35,7 +34,7 @@
expect(page).to have_content(work_with_license.license.first)
end
end
=begin context 'as a content-admin user' do
context 'as a content-admin user' do
before :each do
sign_in_user(content_admin_user)
end
Expand All @@ -44,12 +43,8 @@
visit "/concern/gw_works/#{work_with_license.id}/edit"
page.select another_license_value, :from => "gw_work_license"
page.click_on("Save changes")
end
it 'can see the changes' do
visit "/concern/gw_works/#{work_with_license.id}"
expect(page).to have_content(another_license_value)
end
end
=end

end

0 comments on commit 399f53a

Please sign in to comment.