Moved 'params[request_forgery_protection_token]' into its own method and...

... improved tests.

Fixes https://github.com/rails/rails/pull/11316 and improves tests, as describes in https://github.com/rails/rails/pull/14933.