Scaffold session controller for relevant methods
This commit is contained in:
parent
76918fff3e
commit
4a01b42b76
9 changed files with 134 additions and 1 deletions
27
test/controllers/sessions_controller_test.rb
Normal file
27
test/controllers/sessions_controller_test.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
require "test_helper"
|
||||
|
||||
class SessionsControllerTest < ActionDispatch::IntegrationTest
|
||||
test "should get new" do
|
||||
get new_session_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create session" do
|
||||
user = users(:one)
|
||||
params = {
|
||||
session: {
|
||||
email: user.email,
|
||||
password: "secret"
|
||||
}
|
||||
}
|
||||
post sessions_url, params: params
|
||||
|
||||
assert_redirected_to root_url
|
||||
end
|
||||
|
||||
test "should destroy session" do
|
||||
delete session_url(@session)
|
||||
|
||||
assert_redirected_to root_url
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue