Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added localization-related test using assert_generates

  • Loading branch information...
commit e5e257ebe1d7dfaaaf48e602c0b99dd9f641c38d 1 parent 8f112fa
GSI2014 authored
View
4 Gemfile
@@ -45,5 +45,5 @@ end
# gem 'debugger', group: [:development, :test]
gem 'devise'
-gem 'rails-translate-routes'
-#gem 'rails-translate-routes', :github => 'bgosavi/rails-translate-routes', :ref => 'eef8a60a28f7a775157fcef298c596f189705916'
+gem 'rails-translate-routes', '~> 0.1.3'
+#gem 'rails-translate-routes', :github => 'bgosavi/rails-translate-routes'
View
8 Gemfile.lock
@@ -35,7 +35,7 @@ GEM
coffee-script (2.2.0)
coffee-script-source
execjs
- coffee-script-source (1.6.3)
+ coffee-script-source (1.7.0)
devise (3.2.2)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.1)
@@ -49,7 +49,7 @@ GEM
jbuilder (1.5.3)
activesupport (>= 3.0.0)
multi_json (>= 1.2.0)
- jquery-rails (3.0.4)
+ jquery-rails (3.1.0)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.8.1)
@@ -107,7 +107,7 @@ GEM
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
- turbolinks (2.2.0)
+ turbolinks (2.2.1)
coffee-rails
tzinfo (0.3.38)
uglifier (2.4.0)
@@ -125,7 +125,7 @@ DEPENDENCIES
jbuilder (~> 1.2)
jquery-rails
rails (= 4.0.2)
- rails-translate-routes
+ rails-translate-routes (~> 0.1.3)
sass-rails (~> 4.0.0)
sdoc
sqlite3
View
2  config/locales/routes.yml
@@ -6,8 +6,10 @@ es:
routes:
new: nuevo
users: usuario
+ sign_out: cerrar
de:
routes:
new: neu
users: benutzer
+ sign_out: abmelden
View
2  config/routes.rb
@@ -1,5 +1,5 @@
RtrError::Application.routes.draw do
- devise_for :users
+ devise_for :users, :sign_out_via => [ :delete, :get ]
resources :users
# NOTE Using any of these lines causes the error to happen:
View
10 test/controllers/users_controller_test.rb
@@ -8,4 +8,14 @@ class UsersControllerTest < ActionController::TestCase
assert_response :success
end
+ test "devise-destroy-route: sign_out closes session in any available language" do
+ assert_generates '/en/users/sign_out',
+ { :locale => 'en', :controller => 'devise/sessions', :action => 'destroy' }
+
+ assert_generates '/de/benutzer/abmelden',
+ { :locale => 'de', :controller => 'devise/sessions', :action => 'destroy' }
+
+ assert_generates '/es/usuario/cerrar',
+ { :locale => 'es', :controller => 'devise/sessions', :action => 'destroy' }
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.