Zeus fails when testing with Rspec

纵然是瞬间 提交于 2019-12-13 13:01:13

问题


When I run this command: rspec spec/controllers/messages_controller_spec.rb

I get this:

Finished in 0.54446 seconds

2 examples, 0 failures

Randomized with seed 6226

It's good.

However when I run this command:

zeus rspec spec/controllers/messages_controller_spec.rb

I get this:

Finished in 0.5356 seconds

2 examples, 0 failures

Randomized with seed 0

This is not a problem, but then immediately I get also this:

F.

Failures:

1) MessagesController POST #create create a message with an HTTP 200 status code

 Failure/Error: post :create, message: "test message"
 NameError:
   undefined method `post' for #<RSpec::Core::ExampleGroup::Nested_2::Nested_1:0xb0085d8>
 # ./spec/controllers/messages_controller_spec.rb:10:in `block (3 levels) in <top (required)>'
 # -e:1:in `<main>'

Finished in 0.10724 seconds 2 examples, 1 failure Failed examples:

rspec ./spec/controllers/messages_controller_spec.rb:9 # MessagesController POST #create create a message with an HTTP 200 status code


回答1:


Delete a line:

require 'rspec/autorun'

from your spec_helper.rb.



来源:https://stackoverflow.com/questions/16665326/zeus-fails-when-testing-with-rspec

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!