[英]Test a Rails 4 Engine with the dummy app
I want to test a Rails 4 Engine by using the dummy app, but I've no idea how to do that. 我想使用虚拟应用程序测试Rails 4 Engine,但是我不知道该怎么做。
My engine only has one model named Event
. 我的引擎只有一个名为
Event
模型。 At first I decomment the code in the event_test.rb
: 起初我decomment在代码
event_test.rb
:
test "the truth" do
assert true
end
Now I tried to launch the tests from the folder of the dummy application but I don't know which command I have to use. 现在,我尝试从虚拟应用程序的文件夹中启动测试,但是我不知道必须使用哪个命令。 I tried
rake test
(nothing happens) and rake test test/models/<engine-name>/event_test.rb
(Error: rake aborted! Don't know how to build task...). 我尝试了
rake test
(什么都没有发生)和rake test test/models/<engine-name>/event_test.rb
(错误:瑞克中止了!不知道如何构建任务...)。
How can I launch the tests of my engine? 如何启动引擎测试?
Dummy
application only mounted point for you engine
. Dummy
应用程序仅对您的engine
挂载点。 You don't need run test from dummy
dir. 您不需要从
dummy
目录运行测试。 Your (controllers, views, ect.) from engine
should available in dummy
app and (controllers, views, ect.) from dummy
should available in engine
. 你(控制器,视图,等。)从
engine
应在提供dummy
应用程序,并从(控制器,视图,等。) dummy
应在提供engine
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.