Skip to content

Commit

Permalink
Merge pull request #79 from AlchemyCMS/fix-specs
Browse files Browse the repository at this point in the history
Fix specs by traveling to the past
  • Loading branch information
tvdeyen authored May 13, 2024
2 parents 3a8a895 + 5de2ef3 commit 7b1d334
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@
config.filter_rails_from_backtrace!
# arbitrary gems may also be filtered via:
# config.filter_gems_from_backtrace("gem name")

config.include ActiveSupport::Testing::TimeHelpers
config.include Alchemy::TestSupport::ConfigStubbing
end
6 changes: 6 additions & 0 deletions spec/requests/alchemy/json_api/pages_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
)
end

around do |example|
travel_to(published_at - 1.week) do
example.run
end
end

let(:published_at) { DateTime.parse("2024-05-04 00:00:00") }

describe "GET /alchemy/json_api/pages/:id" do
Expand Down

0 comments on commit 7b1d334

Please sign in to comment.