Files
bit/test/controllers/users_controller_test.rb
T
Juan Rodriguez 9c7146820c feat: Sessions controller
Sessions helper methods, login and signup modals, load partial views with stimulus

Situmuls usersController, Create and Destroy user sessions
2021-06-14 11:46:25 -05:00

21 lines
524 B
Ruby

# frozen_string_literal: true
require 'test_helper'
class UsersControllerTest < ActionDispatch::IntegrationTest
test 'Should create an user' do
params = { user: { username: 'testing', password: 'testing' } }
post users_url, params: params
assert_redirected_to '/'
end
test 'Should return 422 with existing username' do
user = users(:one)
params = { user: { username: user.username, password: 'testing' } }
post users_url, params: params
assert_response :unprocessable_entity
end
end