]>
cat aescling's git repositories - mastodon.git/blob - spec/controllers/auth/sessions_controller_spec.rb
3 RSpec
.describe Auth
::SessionsController, type
: :controller do
6 request
.env["devise.mapping"] = Devise
.mappings
[:user]
9 it
'returns http success' do
11 expect(response
).to
have_http_status(:success)
15 describe
'POST #create' do
16 let(:user) { Fabricate(:user, email
: 'foo@bar.com', password
: 'abcdefgh') }
19 request
.env["devise.mapping"] = Devise
.mappings
[:user]
20 post
:create, params
: { user
: { email
: user
.email
, password
: user
.password
} }
23 it
'redirects to home page' do
24 expect(response
).to
redirect_to(root_path
)
27 it
'logs the user in' do
28 expect(controller
.current_user
).to eq user
This page took 0.098206 seconds and 5 git commands to generate.