Add GuestUser model

This commit is contained in:
Andrew Tomaka 2024-08-16 19:52:01 -04:00
parent 61f3d34653
commit 6d02dc280b
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE
4 changed files with 23 additions and 3 deletions

3
app/models/guest_user.rb Normal file
View file

@ -0,0 +1,3 @@
class GuestUser
def registered? = false
end

View file

@ -1,3 +1,5 @@
class User < ApplicationRecord class User < ApplicationRecord
has_secure_password has_secure_password
def registered? = true
end end

View file

@ -0,0 +1,11 @@
require "test_helper"
class GuestUserTest < ActiveSupport::TestCase
setup do
@user = GuestUser.new
end
def test_registered_false
assert_not @user.registered?
end
end

View file

@ -1,7 +1,11 @@
require "test_helper" require "test_helper"
class UserTest < ActiveSupport::TestCase class UserTest < ActiveSupport::TestCase
# test "the truth" do setup do
# assert true @user = users(:one)
# end end
def test_registered_true
assert @user.registered?
end
end end