小编Mal*_*tor的帖子

生成Rails 3插件的测试路由时出错?

我正在尝试为插件"foobar"开发测试,修改一些标准的Rails助手.在vendor/plugins/foobar/test/foobar_test.rb中,我有以下内容:

# create the test model
class Thing < ActiveRecord::Base
end

# create the test controller, which renders the included index template
class ThingsController < ActionController::Base
  def index
    @things = Thing.all
    format.html { render(:file => 'index') }
  end

  def destroy
    @thing = Thing.find(params[:id])
    @thing.destroy
    format.html { render(:file => 'index') }
  end
end

# confirm that the test environment is working correctly
class ThingsTest < ActiveSupport::TestCase
  test "model is loaded correctly" do
    assert_kind_of Thing, Thing.new
  end
end

# confirm that the …
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails-plugins ruby-on-rails-3

8
推荐指数
1
解决办法
505
查看次数