I am new to rails and walk through rails 3 textbooks . I have a problem with integration tests. The “visit” (Webrat?) Method seems to always fail. This is the error message I get from 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
I tried adding the Webrat tuner above to spec / spec_helpers.rb and I get this error:
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)>'
I read other topics about this issue, and they suggested using "config.mode =: rack", if I do this, I will get this error:
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)>'
I think it may be important to note that I started the win7x64 tutorial, but I tried to clone the repository on ubuntu with the same errors. Here is the repository if someone wants to see:
git://github.com/ender4/sample_app2.git
, 2 ^
, rails/rspec/webrat (, ), , / .
.