gpt4 book ai didi

railstutorial.org - Ruby on Rails 教程 3.2,作者:Michael Hartl 第 9 章。authentication_pages_spec.rb 在utilities.rb 中看不到sign_in 方法

转载 作者:行者123 更新时间:2023-12-02 18:07:46 25 4
gpt4 key购买 nike

这是我在 StackOverflow 上的第一个问题,请耐心等待......

当我在Listing 8.6中使用authentication_pages_spec.rb时我的测试通过了。然后我在'spec/support/utilities.rb'中定义sign_in方法并根据Listing 9.5修改authentication_pages_spec.rb并且,运行时

$ bundle exec rspec spec/requests/authentication_pages_spec.rb -e "Authentication"

我明白了

1) Authentication signin with valid information 
Failure/Error: before { sign_in user }
NoMethodError:
undefined method `sign_in' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_2::Nested_2:0x007fc585a87cd8>
# ./spec/requests/authentication_pages_spec.rb:31:in `block (4 levels) in <top (required)>'

针对“具有有效信息”下的所有六项测试。

规范似乎没有看到 sign_in 函数,需要一些声明,无论如何我找不到在 Github 上的 Michael Hartl 代码中完成此操作的位置。

非常感谢任何帮助。

最佳答案

只需重新启动spork,它就应该可以工作:)

关于railstutorial.org - Ruby on Rails 教程 3.2,作者:Michael Hartl 第 9 章。authentication_pages_spec.rb 在utilities.rb 中看不到sign_in 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13400166/

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