简体   繁体   English

使用虚拟应用程序测试Rails 4 Engine

[英]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.

相关问题 Rork引擎测试/假人与Spork,Guard,RSpec? - Rails engine test/dummy with Spork, Guard, RSpec? Rails3.1引擎:无法使SLIM或HAML在测试/虚拟应用程序中工作 - Rails3.1 engine: can't get SLIM or HAML to work in test/dummy app 假想的Rails应用程序中是否存在引擎的所有*规格? - Are *all* specs for an engine expected to live in the dummy Rails app? 如何在现有的 Rails 引擎中生成虚拟应用程序 - How to generate a dummy app inside an already existing rails engine 在编写gem时如何测试虚拟rails应用程序? - How do you test a dummy rails app when writing a gem? Rails 3.1插件gem,虚拟测试应用程序,rspec - Rails 3.1 plugin gem, dummy test app, rspec 在Rails引擎中使用`rails console`时的`test / dummy / config / application(LoadError)` - `test/dummy/config/application (LoadError)` when using `rails console` in a Rails engine 无法在Rails引擎中获取虚拟应用程序以从其他gem中加载资源 - Trouble getting dummy app in a Rails engine to load assets from other gems Rails 引擎:为关系创建虚拟模型? - Rails Engine: Create dummy model for relations? rails:如何使用gem提供模型,以及如何在没有虚拟app的情况下测试rails gem - rails: how to supply a model with gem, and how to test rails gem without dummy app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM