私はレールを初めて使用し、レール 3 チュートリアルを実行しています。統合テストの実行に問題があります。メソッド「visit」(Webrat?) は常に失敗するようです。これは、rspec から得られる種類のエラー メッセージです。
Failure/Error: visit signup_path
Unknown Webrat mode: nil
Please ensure you have a Webrat configuration block that specifies a mode
in your test_helper.rb, spec_helper.rb, or env.rb (for Cucumber).
This configure block supercedes the need to require "webrat/<framework>".
For example:
Webrat.configure do |config|
config.mode = :rails
end
# ./spec/requests/users_spec.rb:27:in `block (5 levels) in <top (required)>'
# ./spec/requests/users_spec.rb:26:in `block (4 levels) in <top (required)>'
上記の Webrat 構成ブロックを spec/spec_helpers.rb に追加しようとしたところ、次のエラーが発生しました。
Failure/Error: visit signup_path
no such file to load -- action_controller/integration
# ./spec/requests/users_spec.rb:27:in `block (5 levels) in <top (required)>'
# ./spec/requests/users_spec.rb:26:in `block (4 levels) in <top (required)>'
この問題に関する他のトピックを読み、「config.mode = :rack」の使用を提案しました。そうすると、次のエラーが発生します。
Failure/Error: visit signup_path
undefined method `last_response' for #<RSpec::Core::ExampleGroup::Nested_5::Nested_1::Nested_2:0xa4b8aac>
# ./spec/requests/users_spec.rb:27:in `block (5 levels) in <top (required)>'
# ./spec/requests/users_spec.rb:26:in `block (4 levels) in <top (required)>'
win7x64でチュートリアルを開始したことに注意することが重要かもしれませんが、同じエラーでubuntuでリポジトリのクローンを作成しようとしました。誰かが見たい場合は、ここにリポジトリがあります:
git://github.com/ender4/sample_app2.git そこにある 2 に注意してください^
私は多くの同様のトピックを読みましたが、ほとんどのソリューションは古いバージョンの rails/rspec/webrat または他のテスト フレームワーク (キュウリなど) 用であるため、それらが適用されるかどうか、またはどのように適用されるかはわかりません。
どんな助けでも大歓迎です。