Skip to content

Commit

Permalink
Add more tests for related indentifier (#130)
Browse files Browse the repository at this point in the history
* Fixed lint errors

* Revert "Fixed lint errors"

This reverts commit e7d3c67.

* Added test for related indentifier

* Added more test cases
  • Loading branch information
ashwinisukale authored Nov 20, 2023
1 parent c8bd5a3 commit 5863be7
Show file tree
Hide file tree
Showing 8 changed files with 668 additions and 149 deletions.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

13 changes: 13 additions & 0 deletions spec/models/crossref_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,21 @@

context "with missing parameters" do
it "queues jobs for the default date range (yesterday to today)" do
# Stub Date.current to return a fixed date
allow(Date).to receive(:current).and_return(Date.new(2023, 1, 2))

# Use a spy on Date.parse
date_spy = spy("Date")
allow(Date).to receive(:parse).and_wrap_original do |original_method, *args|
date_spy.parse(*args)
original_method.call(*args)
end

# Mocking Date.parse
response = Crossref.import

expect(response).to be_a(Integer).and be >= 0

end
end
end
Expand Down
Loading

0 comments on commit 5863be7

Please sign in to comment.