From 665964bcbba69829a4ff1e7d7bd936f90d49b3f7 Mon Sep 17 00:00:00 2001 From: elijah Date: Sun, 22 Dec 2013 01:45:41 -0800 Subject: locale prefix support: * set locale based on request header * enforce locale path prefix when current locale is not the default * note: don't use root_path anymore, instead use home_path --- DEVELOP.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'DEVELOP.md') diff --git a/DEVELOP.md b/DEVELOP.md index a35ce06..3603dc5 100644 --- a/DEVELOP.md +++ b/DEVELOP.md @@ -78,4 +78,21 @@ CouchRest Model behaved strangely when using a model without a design block. So From that point on you should be able to use the standart persistance and querying methods such as create, find, destroy and so on. +## Writing Tests ## +### Locale + +The ApplicationController defines a before filter #set_locale that will set +the default_url_options to include the appropriate default {:locale => x} param. + +However, paths generated in tests don't use default_url_options. This can +create failures for certain nested routes unless you explicitly provide +:locale => nil to the path helper. This is not needed for actual path code in +the controllers or views, only when generating paths in tests. + +For example: + + test "robot" do + login_as @user + visit robot_path(@robot, :locale => nil) + end \ No newline at end of file -- cgit v1.2.3