-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36b67da
commit fc9a8d3
Showing
7 changed files
with
40 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM phusion/passenger-full:2.0.1 | ||
FROM phusion/passenger-full:2.5.1 | ||
LABEL maintainer="[email protected]" | ||
|
||
# Set correct environment variables. | ||
|
@@ -11,8 +11,8 @@ RUN usermod -a -G docker_env app | |
# Use baseimage-docker's init process. | ||
CMD ["/sbin/my_init"] | ||
|
||
# Use Ruby 2.6.8 | ||
RUN bash -lc 'rvm --default use ruby-2.6.8' | ||
# Use Ruby 3.1.4 | ||
RUN bash -lc 'rvm --default use ruby-3.1.4' | ||
|
||
# Update installed APT packages | ||
RUN apt-get update && apt-get upgrade -y --allow-unauthenticated -o Dpkg::Options::="--force-confold" && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
require "rails_helper" | ||
|
||
describe "Cacheable", type: :concern do | ||
let(:token) { User.generate_token } | ||
subject { User.new(token) } | ||
|
||
describe "cached_datacite_response" do | ||
before do | ||
Rails.cache.delete("datacite/100") | ||
end | ||
|
||
describe "when the is a cache miss" do | ||
it "will fetch the value using Base.get_datacite_metadata" do | ||
allow(Base).to(receive(:get_datacite_metadata).and_return({message: "from get_datacite_metadata"})) | ||
result = RelatedIdentifier.cached_datacite_response(100) | ||
expect(result).to(eq({message: "from get_datacite_metadata"})) | ||
end | ||
end | ||
|
||
describe "when there is a cache hit" do | ||
it "will fetch the value from cache" do | ||
allow(Rails).to(receive_message_chain(:cache, :fetch).and_return({message: "from cache"})) | ||
allow(Base).to(receive(:get_datacite_metadata).and_return({message: "from get_datacite_metadata"})) | ||
|
||
result = RelatedIdentifier.cached_datacite_response(100) | ||
expect(result).to(eq({message: "from cache"})) | ||
end | ||
end | ||
end | ||
end |