Files

UbiquoI18n::Extensions::TestCase

Public Instance Methods

set_session_locale(locale = nil) click to toggle source

This method allows functional test to simulate a ubiquo_user login by setting session value

If the attribute is a Symbol, the user is getted from fixture helper ubiquo_users(fixture_name). For example, if :one is passed, a fixture named with ‘one:’ will be used

If the attribute is a UbiquoUser, that user is used.

If the attribute is nil (or none setted) the ‘admin’ named fixture will be used

If the attribute is a number, this number will be used as a ubiquo_user_id, but don’t validates to be a valid id.

    # File vendor/plugins/ubiquo_i18n/lib/ubiquo_i18n/extensions/test_case.rb, line 14
14:       def set_session_locale(locale = nil)
15:         if @request
16:           @request.session[:locale] = locale || Locale.default
17:         end
18:       end

Disabled; run with $DEBUG to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.