I am using rails 4.2.1 & ruby 2.2.1 in my appliation. So minitest is automatically added which is of version 5.1. There is no database in my application. With database I am able to test the model. How do I test the model without database?
I have created a user model:
class User
include ActiveModel::Model
end
users.yml:
one:
firstName: Avi
email: [email protected]
user_test.rb:
require 'test_helper'
class UserTest < ActiveSupport::TestCase
test "the truth" do
user = users(:one)
assert true
end
end
Here I am getting the error: Undefined methods users
. I am getting proper data if daabase exists.
I even tried adding include ActiveModel::Lint::Tests
still getting the same error.
Can anyone help me on this?
Thanks