parent
c3fbb70cff
commit
014c15fe4e
@ -0,0 +1,2 @@
|
|||||||
|
class UsersController < ApplicationController
|
||||||
|
end
|
@ -0,0 +1,2 @@
|
|||||||
|
module UsersHelper
|
||||||
|
end
|
@ -0,0 +1,6 @@
|
|||||||
|
class User < ApplicationRecord
|
||||||
|
has_secure_password
|
||||||
|
|
||||||
|
validates :name, presence: true
|
||||||
|
validates :email, presence: true, format: { with: /\S+@\S+/ }, uniqueness: { case_sensitive: false }
|
||||||
|
end
|
@ -0,0 +1,11 @@
|
|||||||
|
class CreateUsers < ActiveRecord::Migration[7.0]
|
||||||
|
def change
|
||||||
|
create_table :users do |t|
|
||||||
|
t.string :name
|
||||||
|
t.string :email
|
||||||
|
t.string :password_digest
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,7 @@
|
|||||||
|
require "test_helper"
|
||||||
|
|
||||||
|
class UsersControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
# test "the truth" do
|
||||||
|
# assert true
|
||||||
|
# end
|
||||||
|
end
|
@ -0,0 +1,11 @@
|
|||||||
|
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||||
|
|
||||||
|
one:
|
||||||
|
name: MyString
|
||||||
|
email: MyString
|
||||||
|
password_digest: <%= BCrypt::Password.create("secret") %>
|
||||||
|
|
||||||
|
two:
|
||||||
|
name: MyString
|
||||||
|
email: MyString
|
||||||
|
password_digest: <%= BCrypt::Password.create("secret") %>
|
@ -0,0 +1,7 @@
|
|||||||
|
require "test_helper"
|
||||||
|
|
||||||
|
class UserTest < ActiveSupport::TestCase
|
||||||
|
# test "the truth" do
|
||||||
|
# assert true
|
||||||
|
# end
|
||||||
|
end
|
Loading…
Reference in new issue