我正在尝试测试我的API
我正在测试的控制器是在api>下进行的。 v1> controller.rb
以下是我使用的rspec测试代码
let(:user) { FactoryGirl.create(:user, email: "test1@test.com") }
describe "with valid token", validToken: true do
before(:each) { authWithUser(user) }
describe "POST #create" do
before(:each) { post :create, {test: "test data" }
it "returns the information for one model" do
expect(json).to have_key('info')
end
end
端
我收到了这个错误
Failure/Error: Unable to find matching line from backtrace
NoMethodError:
undefined method `request=' for #<Model:0x000000070e9988>