Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1825 from julianvargasalvarez/master

Use 'head :no_content' in sessions_controller#destroy
  • Loading branch information...
commit d376d11d427b83d4a02114bec5e3bf880ffa4398 2 parents 525bcd4 + 6664acd
@josevalim josevalim authored
View
4 app/controllers/devise/sessions_controller.rb
@@ -28,9 +28,7 @@ def destroy
respond_to do |format|
format.any(*navigational_formats) { redirect_to redirect_path }
format.all do
- method = "to_#{request_format}"
- text = {}.respond_to?(method) ? {}.send(method) : ""
- render :text => text, :status => :ok
+ head :no_content
end
end
end
View
4 test/integration/authenticatable_test.rb
@@ -461,14 +461,14 @@ class AuthenticationOthersTest < ActionController::IntegrationTest
test 'sign out with xml format returns ok response' do
sign_in_as_user
get destroy_user_session_path(:format => 'xml')
- assert_response :ok
+ assert_response :no_content
assert_not warden.authenticated?(:user)
end
test 'sign out with json format returns empty json response' do
sign_in_as_user
get destroy_user_session_path(:format => 'json')
- assert_response :ok
+ assert_response :no_content
assert_not warden.authenticated?(:user)
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.