Skip to content

Commit

Permalink
update deprecation warning to match ADR
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew Bailey committed Jan 30, 2019
1 parent 01ad4be commit 9ae62e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/stitches/deprecation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def gone!
# end
def deprecated(gone_on:,&block)
response.set_header("Sunset",Date.parse(gone_on).in_time_zone("GMT").midnight.strftime("%a, %e %b %Y %H:%M:%S %Z"))
Rails.logger.info("Deprecated endpoint #{request.method} #{request.fullpath} requested by #{current_user.id}")
Rails.logger.info("DEPRECATED ENDPOINT #{request.method} to #{request.fullpath} requested by #{current_user.id}")
block.()
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/deprecation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
end
it "logs about the request and current API key id" do
fake_controller.deprecated(gone_on: "2018-01-01") {}
expect(logger).to have_received(:info).with(/deprecated.*#{Regexp.escape(request.method)}.*#{Regexp.escape(request.fullpath)}.*#{Regexp.escape(api_client.id.to_s)}/i)
expect(logger).to have_received(:info).with(/DEPRECATED.*#{Regexp.escape(request.method)}.*#{Regexp.escape(request.fullpath)}.*#{Regexp.escape(api_client.id.to_s)}/i)
end
it "executes and returns the block" do
block_executed = false
Expand Down

0 comments on commit 9ae62e7

Please sign in to comment.