require "test_helper" class UserTest < ActiveSupport::TestCase # Test that User model exists test "should be a class" do assert_kind_of Class, User end # Test Devise modules test "should include devise modules" do user = User.new assert user.respond_to?(:email) assert user.respond_to?(:encrypted_password) end # Test associations test "should have many parties" do association = User.reflect_on_association(:parties) assert_equal :has_many, association.macro assert_equal :destroy, association.options[:dependent] end test "should have many tickets" do association = User.reflect_on_association(:tickets) assert_equal :has_many, association.macro assert_equal :destroy, association.options[:dependent] end end