On Github wrozka / rails-n-angular-krug-09-07-2013
Pawel Pierzchala @zwrozka
Frontend and backend are independed applications
Through an API
$httpProvider.defaults.xsrfCookieName = 'X-CSRF-Token' $httpProvider.defaults.xsrfHeaderName = 'X-CSRF-Token'
cookies['X-CSRF-Token'] = form_authenticity_token
PREFIX = ")]}',\n" def render_json(data) json = PREFIX + data.as_json render text: text, content_type: "application/json" end
{ userName: 'Joe' } == { :user_name => 'Joe' }
API request specs / unit tests
Unit tests with Karma
In Capybara
end to end (api)
Without any race conditons in pure angular
Almost no problmes with JavaScripts from ngmodules.org
Old Capybara tricks as fallback
Record & Playback
independed applications
stable e2e tests