budget/test/controllers/sessions_controller_test.rb
Andrew Tomaka 108959f2b0
Some checks failed
Ruby CI / test (pull_request) Failing after 40s
Require authentication for most actions
2024-09-08 20:53:07 -04:00

28 lines
559 B
Ruby

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
login(users(:one).email)
delete session_url(@session)
assert_redirected_to new_session_url
end
end