-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bring tests from jupiter into oaisys with required changes/additions #58
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect that we can setup the tests with a simpler dummy application.
Starting here:
# test/dummy/config/initializers/dummy.rb
Rails.application.config.after_initialize do
Oaisys::Engine.config.oai_dc_model = Item
Oaisys::Engine.config.oai_etdms_model = Thesis
Oaisys::Engine.config.top_level_sets_model = Community
Oaisys::Engine.config.set_model = Collection
end
Then we can use the model generator to create the Item, Thesis, Collection and Community.
For example the Thesis needs all of the things for the OaiEtdms serializer
rails g model Thesis title:string creator:string subject:string description:string contributor:string date:date type:string language:string rights:string publisher:string degree_name:string degree_level:string discipline:string institution:string member_of_paths:json
Then we can move the resulting files into the dummy application and finish setting up the model
class Thesis < ActiveRecord::Base
acts_as_rdfable formats: :oai_etdms
singleton_class.send(:alias_method, :public_items, :all)
end
We might have to setup a couple more details like kaminari for pagination (page
) and uuids for the id.
Keep going with only the minimum for the other models.
@@ -14,7 +14,7 @@ class Oaisys::PMHController < Oaisys::ApplicationController | |||
].freeze | |||
|
|||
def bad_verb | |||
bad_verb = params.permit(:verb).to_h[:verb] | |||
bad_verb = params.permit(:verb, :subdomain).to_h[:verb] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a bug in the current release?
oaisys.gemspec
Outdated
@@ -13,6 +13,7 @@ Gem::Specification.new do |spec| | |||
spec.summary = 'OAI-PMH engine' | |||
spec.description = "Jupiter's engine for Open Archives Initiative Protocol for Metadata Harvesting" | |||
spec.license = 'MIT' | |||
spec.required_ruby_version = '2.6.6' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,107 @@ | |||
require 'test_helper' | |||
|
|||
class OaisysListSetsTest < ActionDispatch::IntegrationTest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it works without any changes to the Dummy application!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect that we can setup the tests with a simpler dummy application.
Starting here:
# test/dummy/config/initializers/dummy.rb Rails.application.config.after_initialize do Oaisys::Engine.config.oai_dc_model = Item Oaisys::Engine.config.oai_etdms_model = Thesis Oaisys::Engine.config.top_level_sets_model = Community Oaisys::Engine.config.set_model = Collection end
Then we can use the model generator to create the Item, Thesis, Collection and Community.
For example the Thesis needs all of the things for the OaiEtdms serializer
rails g model Thesis title:string creator:string subject:string description:string contributor:string date:date type:string language:string rights:string publisher:string degree_name:string degree_level:string discipline:string institution:string member_of_paths:json
Then we can move the resulting files into the dummy application and finish setting up the model
class Thesis < ActiveRecord::Base acts_as_rdfable formats: :oai_etdms singleton_class.send(:alias_method, :public_items, :all) end
We might have to setup a couple more details like kaminari for pagination (
page
) and uuids for the id.Keep going with only the minimum for the other models.
I feel like there might still be some extra stuff in the dummy application. What is important to oaisys about the search exporters, validations, and depositable and doiable behaviours?
@@ -40,6 +46,11 @@ jobs: | |||
id: yarn-cache | |||
run: echo "::set-output name=dir::$(yarn cache dir)" | |||
|
|||
- name: Setup redis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is redis required for?
gem 'aasm' # state-machine management | ||
gem 'paper_trail' # Track object changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these necessary for oaisys?
@@ -0,0 +1,5 @@ | |||
module Digitization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this required?
No description provided.