Commit 374679c0 authored by Steffen van Bergerem's avatar Steffen van Bergerem Committed by Dennis Schubert
Browse files

Add rspec test for reset_authentication_token without current_user

closes #6707
parent 27a8e0fb
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3,7 +3,8 @@
## Refactor

## 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

+22 −0
Original line number Diff line number Diff line
@@ -47,4 +47,26 @@ describe SessionsController, type: :controller do
      expect(response).to redirect_to root_path
    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