aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/request_forgery_protection_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller/request_forgery_protection_test.rb')
-rw-r--r--actionpack/test/controller/request_forgery_protection_test.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/actionpack/test/controller/request_forgery_protection_test.rb b/actionpack/test/controller/request_forgery_protection_test.rb
index 7ce8dfa8df..a0e92c1a4a 100644
--- a/actionpack/test/controller/request_forgery_protection_test.rb
+++ b/actionpack/test/controller/request_forgery_protection_test.rb
@@ -4,11 +4,11 @@ require "active_support/log_subscriber/test_helper"
# common controller actions
module RequestForgeryProtectionActions
def index
- render :inline => "<%= form_tag('/') {} %>"
+ render inline: "<%= form_tag('/') {} %>"
end
def show_button
- render :inline => "<%= button_to('New', '/') %>"
+ render inline: "<%= button_to('New', '/') %>"
end
def unsafe
@@ -16,23 +16,23 @@ module RequestForgeryProtectionActions
end
def meta
- render :inline => "<%= csrf_meta_tags %>"
+ render inline: "<%= csrf_meta_tags %>"
end
def form_for_remote
- render :inline => "<%= form_for(:some_resource, :remote => true ) {} %>"
+ render inline: "<%= form_for(:some_resource, :remote => true ) {} %>"
end
def form_for_remote_with_token
- render :inline => "<%= form_for(:some_resource, :remote => true, :authenticity_token => true ) {} %>"
+ render inline: "<%= form_for(:some_resource, :remote => true, :authenticity_token => true ) {} %>"
end
def form_for_with_token
- render :inline => "<%= form_for(:some_resource, :authenticity_token => true ) {} %>"
+ render inline: "<%= form_for(:some_resource, :authenticity_token => true ) {} %>"
end
def form_for_remote_with_external_token
- render :inline => "<%= form_for(:some_resource, :remote => true, :authenticity_token => 'external_token') {} %>"
+ render inline: "<%= form_for(:some_resource, :remote => true, :authenticity_token => 'external_token') {} %>"
end
def same_origin_js
@@ -58,16 +58,16 @@ end
# sample controllers
class RequestForgeryProtectionControllerUsingResetSession < ActionController::Base
include RequestForgeryProtectionActions
- protect_from_forgery :only => %w(index meta same_origin_js negotiate_same_origin), :with => :reset_session
+ protect_from_forgery only: %w(index meta same_origin_js negotiate_same_origin), with: :reset_session
end
class RequestForgeryProtectionControllerUsingException < ActionController::Base
include RequestForgeryProtectionActions
- protect_from_forgery :only => %w(index meta same_origin_js negotiate_same_origin), :with => :exception
+ protect_from_forgery only: %w(index meta same_origin_js negotiate_same_origin), with: :exception
end
class RequestForgeryProtectionControllerUsingNullSession < ActionController::Base
- protect_from_forgery :with => :null_session
+ protect_from_forgery with: :null_session
def signed
cookies.signed[:foo] = "bar"
@@ -114,11 +114,11 @@ class FreeCookieController < RequestForgeryProtectionControllerUsingResetSession
self.allow_forgery_protection = false
def index
- render :inline => "<%= form_tag('/') {} %>"
+ render inline: "<%= form_tag('/') {} %>"
end
def show_button
- render :inline => "<%= button_to('New', '/') %>"
+ render inline: "<%= button_to('New', '/') %>"
end
end
@@ -129,7 +129,7 @@ class CustomAuthenticityParamController < RequestForgeryProtectionControllerUsin
end
class PerFormTokensController < ActionController::Base
- protect_from_forgery :with => :exception
+ protect_from_forgery with: :exception
self.per_form_csrf_tokens = true
def index