mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use nex hash syntax on tests
This commit is contained in:
parent
3d3730040d
commit
4c1b437ed7
1 changed files with 5 additions and 5 deletions
|
@ -3,22 +3,22 @@ require 'active_support/core_ext/integer/time'
|
|||
require 'active_support/core_ext/numeric/time'
|
||||
|
||||
class ConditionalGetApiController < ActionController::API
|
||||
before_action :handle_last_modified_and_etags, :only => :two
|
||||
before_action :handle_last_modified_and_etags, only: :two
|
||||
|
||||
def one
|
||||
if stale?(:last_modified => Time.now.utc.beginning_of_day, :etag => [:foo, 123])
|
||||
render :text => "Hi!"
|
||||
if stale?(last_modified: Time.now.utc.beginning_of_day, etag: [:foo, 123])
|
||||
render text: "Hi!"
|
||||
end
|
||||
end
|
||||
|
||||
def two
|
||||
render :text => "Hi!"
|
||||
render text: "Hi!"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def handle_last_modified_and_etags
|
||||
fresh_when(:last_modified => Time.now.utc.beginning_of_day, :etag => [ :foo, 123 ])
|
||||
fresh_when(last_modified: Time.now.utc.beginning_of_day, etag: [ :foo, 123 ])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue