Merge branch 'stable' into develop

This commit is contained in:
Dennis Schubert 2016-02-21 04:26:25 +01:00
commit 535057aca4
3 changed files with 25 additions and 2 deletions

View file

@ -127,7 +127,8 @@ Contributions are very welcome, the hard work is done!
## Refactor ## Refactor
## Bug fixes ## Bug fixes
* Fix empty name field when editing aspect names [#6548](https://github.com/diaspora/diaspora/issues/6548) * Fix empty name field when editing aspect names [#6706](https://github.com/diaspora/diaspora/pull/6706)
* Fix internal server error when trying to log out of an expired session [#6707](https://github.com/diaspora/diaspora/pull/6707)
## Features ## Features

View file

@ -7,6 +7,6 @@ class SessionsController < Devise::SessionsController
before_filter :reset_authentication_token, :only => [:destroy] before_filter :reset_authentication_token, :only => [:destroy]
def reset_authentication_token def reset_authentication_token
current_user.reset_authentication_token! current_user.reset_authentication_token! unless current_user.nil?
end end
end end

View file

@ -47,4 +47,26 @@ describe SessionsController, type: :controller do
expect(response).to redirect_to root_path expect(response).to redirect_to root_path
end end
end end
describe "#reset_authentication_token" do
context "for a logged in user" do
before do
sign_in :user, @user
end
it "succeeds" do
expect { @controller.send(:reset_authentication_token) }.to_not raise_error
end
end
context "for a logged out user" do
before do
sign_out :user
end
it "succeeds" do
expect { @controller.send(:reset_authentication_token) }.to_not raise_error
end
end
end
end end