Test CSRF in feature test using Capybara

May 16, 2015

Reading time ~1 minute

Rails app disable request forgery protection in test environment by default. So csrf token dose not appear in app using ` <%= csrf_meta_tags %> or form_for`

config/environments/test.rb

# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false

If you want to test or use csrf token you had better use mock to protect_against_forgery in specs.

allow_any_instance_of(ActionController::Base).to receive(:protect_against_forgery?).and_return(true)

add ticket number to git commit automatically

Most of ticket tracker like Github, pivotal tracker have function to connect your commit to ticket(story).But every time when you commit ...… Continue reading

I will build frontend and backend separately

Published on September 28, 2016

order of angular controller's initialisation

Published on October 05, 2015