diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index c934809..82d7d7f 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -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 diff --git a/spec/requests/alchemy/json_api/pages_spec.rb b/spec/requests/alchemy/json_api/pages_spec.rb index 1d908cf..695d39d 100644 --- a/spec/requests/alchemy/json_api/pages_spec.rb +++ b/spec/requests/alchemy/json_api/pages_spec.rb @@ -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