gpt4 book ai didi

ruby-on-rails - rspec 突然失败

转载 作者:行者123 更新时间:2023-12-05 01:12:54 25 4
gpt4 key购买 nike

rspecs 开始失败并出现以下错误:

ruby 1.8.7,rails 3.06。

~/.rvm/rubies/ree-1.8.7-2011.03/bin/ruby -S bundle exec rspec spec/controllers/gift_cards_controller_spec.rb:30
No DRb server is running. Running in local process instead ...
Run filtered including {:line_number=>30}
F

Failures:

1) GiftCardsController POST to :create for a logged-in User with valid attributes
Failure/Error: it { should respond_with(:redirect) }
NoMethodError:
undefined method `respond_with' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1::Nested_1::Nested_1:0x11af4324>
# ./spec/controllers/gift_cards_controller_spec.rb:30

Finished in 0.93776 seconds
1 example, 1 failure

最佳答案

#repond_with 不是应该匹配器吗?确保它位于 Gemfile 中的 RSpec 之后:

group :development, :test do
gem 'rspec-rails', '2.4.1'
gem 'shoulda-matchers', '1.0.0.beta1'
end

关于ruby-on-rails - rspec 突然失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6448233/

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