gpt4 book ai didi

ruby-on-rails - Zeus 在使用 Rspec 进行测试时失败

转载 作者:数据小太阳 更新时间:2023-10-29 06:59:07 27 4
gpt4 key购买 nike

当我运行这个命令时:rspec spec/controllers/messages_controller_spec.rb

我明白了:

Finished in 0.54446 seconds

2 examples, 0 failures

Randomized with seed 6226

很好。

但是当我运行这个命令时:

zeus rspec spec/controllers/messages_controller_spec.rb

我明白了:

Finished in 0.5356 seconds

2 examples, 0 failures

Randomized with seed 0

这不是问题,但我马上也得到了这个:

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

最佳答案

删除一行:

require 'rspec/autorun'

来自您的 spec_helper.rb。

关于ruby-on-rails - Zeus 在使用 Rspec 进行测试时失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16665326/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com