【发布时间】:2011-08-23 08:28:13
【问题描述】:
以下 RSpec 2 测试..
describe "GET new" do
describe "gets a report form" do
xhr :get, :new, :post_id => @post
response.should be_success
end
end
给出了这个很好的错误:
undefined method xhr for #<Class:0xb5c72404> (NoMethodError)
知道有什么问题吗?
【问题讨论】:
-
您的测试是否嵌套在
describe controller_name中? -
是的,describe 块应该如何嵌套有特殊规则吗?
-
你需要
spec_helper吗?
标签: ruby-on-rails rspec rspec2