wickie
September 1, 2010, 2:55pm
1
I’m in the process of updating an app for Rails 3.0 and rspec-rails
2.0.0.beta20. When I’m running my specs (rake spec) I get a large number
of errors caused by two undefined methods
undefined method `has_selector?’ for #String:0x7fdbd0b5b270
undefined method `flunk’ for
#RSpec::Core::ExampleGroup::Nested_15::Nested_1::Nested_2::Nested_2:0x7fdbd0c48fe8
I’ve seen the upgrade notice for beta20 and now include capybara
explicitly in the test group of my Gemfile. The version of capybara on
my system is 0.3.9 and noticeably, it does not define has_selector? (or
have_selector? as webrat does).
Presumably, this is all just a dependency problem, but I have no clear
idea where to look.
Michael
–
Michael S.
mailto:[email protected]
http://www.schuerig.de/michael/
wickie
September 1, 2010, 3:02pm
2
On Sep 1, 2010, at 7:49 AM, Michael S. wrote:
I’m in the process of updating an app for Rails 3.0 and rspec-rails
2.0.0.beta20. When I’m running my specs (rake spec) I get a large number
of errors caused by two undefined methods
undefined method `has_selector?’ for #String:0x7fdbd0b5b270
See Capybara and have_selector · Issue #190 · rspec/rspec-rails · GitHub
undefined method `flunk’ for
#RSpec::Core::ExampleGroup::Nested_15::Nested_1::Nested_2::Nested_2:0x7fdbd0c48fe8
Please report this one to Issues · rspec/rspec-rails · GitHub
including the spec, code, versions, and full backtrace of the error.
Thx,
David
wickie
September 1, 2010, 3:47pm
3
On Wednesday 01 September 2010, David C. wrote:
On Sep 1, 2010, at 7:49 AM, Michael S. wrote:
I’m in the process of updating an app for Rails 3.0 and rspec-rails
2.0.0.beta20. When I’m running my specs (rake spec) I get a large
number of errors caused by two undefined methods
undefined method `has_selector?’ for #String:0x7fdbd0b5b270
See Capybara and have_selector · Issue #190 · rspec/rspec-rails · GitHub
Thanks, I’ve just switched to webrat. Things look much better now.
undefined method `flunk’ for
#<RSpec::Core::ExampleGroup::Nested_15::Nested_1::Nested_2::Nested_
2:0x7fdbd0c48fe8>
Please report this one to Issues · rspec/rspec-rails · GitHub
including the spec, code, versions, and full backtrace of the error.
opened 01:44PM - 01 Sep 10 UTC
closed 11:09AM - 02 Sep 10 UTC
Rails 3.0.0, rspec-rails 2.0.0.beta20, ruby 1.8.7
I can't include the original … code, unfortunately. The exception occurs in a controller spec. The controller correctly redirects_to :back and the spec looks like this
<pre>
describe Admin::FooBarsController do
before do
@bar = mock_bar
request.env["HTTP_REFERER"] = '/somewhere'
end
describe "PUT update" do
before do
Bar.should_receive(:find).with('42').and_return(@bar)
end
it "redirects back" do
response.should redirect_to('http://test.host/somewhere')
end
end
end
</end>
<pre>
Failures:
1) Admin::FooBarsController when signed in as an authorized user PUT update with foo bars redirects back
Failure/Error: response.should redirect_to('http://test.host/somewhere')
undefined method `flunk' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1::Nested_2::Nested_1:0x7f6dbaafc628>
# /var/lib/gems/1.8/gems/rspec-expectations-2.0.0.beta.20/lib/rspec/matchers/method_missing.rb:6:in `method_missing'
# /var/lib/gems/1.8/gems/actionpack-3.0.0/lib/action_dispatch/testing/assertions/routing.rb:177:in `method_missing'
# /var/lib/gems/1.8/gems/actionpack-3.0.0/lib/action_dispatch/testing/assertions/response.rb:72:in `assert_redirected_to'
# /var/lib/gems/1.8/gems/rspec-expectations-2.0.0.beta.20/lib/rspec/matchers/matcher.rb:94:in `send'
# /var/lib/gems/1.8/gems/rspec-expectations-2.0.0.beta.20/lib/rspec/matchers/matcher.rb:94:in `method_missing'
# /var/lib/gems/1.8/gems/rspec-rails-2.0.0.beta.20/lib/rspec/rails/matchers/redirect_to.rb:7
# /var/lib/gems/1.8/gems/rspec-expectations-2.0.0.beta.20/lib/rspec/matchers/matcher.rb:30:in `instance_exec'
# /var/lib/gems/1.8/gems/rspec-expectations-2.0.0.beta.20/lib/rspec/matchers/matcher.rb:30:in `matches?'
# /var/lib/gems/1.8/gems/rspec-expectations-2.0.0.beta.20/lib/rspec/expectations/handler.rb:11:in `handle_matcher'
# /var/lib/gems/1.8/gems/rspec-expectations-2.0.0.beta.20/lib/rspec/expectations/extensions/kernel.rb:27:in `should'
# ./spec/controllers/admin/foo_bars_controller_spec.rb:48
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example.rb:52:in `instance_eval'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example.rb:52:in `run'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example.rb:86:in `call'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example.rb:86:in `with_around_hooks'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example.rb:48:in `run'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example.rb:80:in `call'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example.rb:80:in `with_pending_capture'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example.rb:79:in `catch'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example.rb:79:in `with_pending_capture'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example.rb:47:in `run'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:222:in `run_examples'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:219:in `map'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:219:in `run_examples'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:210:in `run'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:211:in `run'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:211:in `map'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:211:in `run'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:211:in `run'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:211:in `map'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:211:in `run'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:211:in `run'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:211:in `map'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:211:in `run'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/command_line.rb:43:in `run_examples'
# /var/lib/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `inject'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/command_line.rb:43:in `each'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/command_line.rb:43:in `inject'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/command_line.rb:43:in `run_examples'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/command_line.rb:26:in `run'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/reporter.rb:11:in `report'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/command_line.rb:23:in `run'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/runner.rb:46:in `run_in_process'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/runner.rb:37:in `run'
# /var/lib/gems/1.8/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/runner.rb:10:in `autorun'
# /var/lib/gems/1.8/bin/rspec:19
</pre>
Michael
–
Michael S.
mailto:[email protected]
http://www.schuerig.de/michael/