-
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?
Changes from 9 commits
623f50a
63c5a30
fca7196
5ef8628
a3c5cd0
a93f36d
3f5600a
620cde4
090c666
79d22c7
2abd618
69aaca2
a3a3fba
696611a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,12 @@ jobs: | |
- 5432:5432 | ||
env: | ||
POSTGRES_PASSWORD: mysecretpassword | ||
redis: | ||
image: redis:alpine | ||
ports: | ||
- 6379/tcp | ||
volumes: | ||
- redis:/data | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -40,13 +46,22 @@ jobs: | |
id: yarn-cache | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- name: Setup redis | ||
uses: supercharge/[email protected] | ||
with: | ||
redis-version: 4 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.yarn-cache.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
|
||
|
||
|
||
|
||
|
||
- name: Run Tests | ||
env: | ||
RAILS_ENV: test | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,18 @@ gemspec | |
# RDF stuff | ||
gem 'acts_as_rdfable', github: 'ualbertalib/acts_as_rdfable', tag: 'v0.2.4' | ||
gem 'builder_deferred_tagging', github: 'ualbertalib/builder_deferred_tagging', tag: 'v0.01' | ||
|
||
group :development, :test do | ||
gem 'aasm' # state-machine management | ||
gem 'paper_trail' # Track object changes | ||
Comment on lines
+22
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these necessary for oaisys? |
||
gem 'rdf', '~> 3.1.15' | ||
gem 'redis', '~> 4.1' | ||
gem 'rubocop', '~> 1.22.1', require: false | ||
end | ||
|
||
group :test do | ||
gem 'bcrypt', '>= 3.1.13' | ||
gem 'kaminari' # Pagination | ||
gem 'rdf-n3', '~> 3.1.2' | ||
gem 'rdf-vocab', '~> 3.1.14' | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Is this a bug in the current release? |
||
raise Oaisys::BadVerbError.new(bad_verb: bad_verb) | ||
end | ||
|
||
|
@@ -40,8 +40,8 @@ def list_sets | |
|
||
sets.map! do |top_level_sets_id, id, title, description| | ||
top_level_set = top_level_sets.find { |a| a[0] == top_level_sets_id }[1] | ||
full_set_id = top_level_sets_id + ':' + id | ||
full_set_name = top_level_set + ' / ' + title | ||
full_set_id = "#{top_level_sets_id}:#{id}" | ||
full_set_name = "#{top_level_set} / #{title}" | ||
[full_set_id, full_set_name, description] | ||
end | ||
resumption_token = resumption_token_from_params(parameters: parameters) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' | ||
# to allow pushing to a single host or delete this section to allow pushing to any host. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class Announcement < ApplicationRecord | ||
|
||
belongs_to :user | ||
|
||
validates :user, presence: true | ||
validates :message, presence: true, length: { maximum: 500 } | ||
|
||
scope :current, -> { where(removed_at: nil).order(created_at: :desc) } | ||
scope :past, -> { where.not(removed_at: nil).order(removed_at: :desc) } | ||
|
||
end |
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?