Skip to content

Commit

Permalink
rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
mccalluc committed Jan 24, 2023
1 parent 73b6e4b commit b446394
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/models/work.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ class << self
def find_by_doi(doi)
prefix = "10.34770/"
doi = "#{prefix}#{doi}" unless doi.start_with?(prefix)
Work.find_by!('metadata @> ?', JSON.dump(doi: doi))
Work.find_by!("metadata @> ?", JSON.dump(doi: doi))
end

def find_by_ark(ark)
prefix = "ark:/"
ark = "#{prefix}#{ark}" unless ark.start_with?(prefix)
Work.find_by!('metadata @> ?', JSON.dump(ark: ark))
Work.find_by!("metadata @> ?", JSON.dump(ark: ark))
end

delegate :resource_type_general_values, to: PDCMetadata::Resource
Expand Down
8 changes: 4 additions & 4 deletions spec/controllers/works_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -829,9 +829,9 @@

it "does not redirect to the Work show view if not exact (missing slash)" do
stub_s3
expect {
expect do
get :resolve_doi, params: { doi: work.doi.gsub("10.34770", "") }
}.to raise_error(ActiveRecord::RecordNotFound)
end.to raise_error(ActiveRecord::RecordNotFound)
end
end
end
Expand Down Expand Up @@ -862,9 +862,9 @@

it "does not redirect to the Work show view if not exact (missing slash)" do
stub_s3
expect {
expect do
get :resolve_ark, params: { ark: work.ark.gsub("ark:", "") }
}.to raise_error(ActiveRecord::RecordNotFound)
end.to raise_error(ActiveRecord::RecordNotFound)
end
end
end
Expand Down

0 comments on commit b446394

Please sign in to comment.