mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-04 04:04:36 +08:00
adds tests for sign_out_user action on users controller
This commit is contained in:
parent
524e8bffbf
commit
1b03222260
1 changed files with 14 additions and 0 deletions
|
@ -7,6 +7,20 @@ describe ClientApi::Users::UsersController, type: :controller do
|
|||
@user = User.first
|
||||
end
|
||||
|
||||
describe '#sign_out_user' do
|
||||
it 'returns unauthorized response' do
|
||||
sign_out @user
|
||||
get :sign_out_user, format: :json
|
||||
expect(response).to have_http_status(:unauthorized)
|
||||
end
|
||||
|
||||
it 'responds successfully if the user is signed out' do
|
||||
get :sign_out_user, format: :json
|
||||
expect(response).to have_http_status(:ok)
|
||||
expect(subject.current_user).to eq(nil)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'GET current_user_info' do
|
||||
it 'responds successfully' do
|
||||
get :current_user_info, format: :json
|
||||
|
|
Loading…
Add table
Reference in a new issue