沒有MINITEST /規格,測試看起來像這樣,和my_engine_customers
夾具被加載(所有的孔):NoMethodError <夾具名稱>在導軌和MINITEST /規格
my_engine/test/models/my_engine/customer_test.rb
是
require 'test_helper'
module MyEngine
class CustomerTest < ActiveSupport::TestCase
test "alex is id 5" do
assert my_engine_customers(:alex).id, 5
end
end
end
require 'test_helper'
describe MyEngine::Customer do
let(:alex) { my_engine_customers(:alex) } # error here (error shown below)
it "alex is id 5" do
assert alex.id, 5
end
end
我得到這樣的:添加require 'minitest/autorun'
到test/test_helper.rb
,然後 將上述試驗後錯誤:
NoMethodError: undefined method `my_engine_customers' for
#<#<Class:0x007fb63e8f09e8>:0x007fb63e81b068>
如何在使用minitest/spec時訪問燈具?