Re: [rspec-users] RSpec 2.6 + Capybara 1.0 incompatibility

2011-06-17 Thread Kai Schlamp
Thank you, David. After removing the Webrat stuff everything runs perfectly again. Regards, Kai ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] RSpec 2.6 + Capybara 1.0 incompatibility

2011-06-17 Thread Kai Schlamp
Here is also the spec helper I use for my integration tests: ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' require 'webrat' require 'capybara/rspec' require "database_cleaner" Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each

[rspec-users] RSpec 2.6 + Capybara 1.0 incompatibility

2011-06-17 Thread Kai Schlamp
Hi. I use RSpec-Rails 2.6.1 together with Capybara 1.0.0. Whenever I start my integration (request) tests I get the following error: Failure/Error: page.execute_script('$ ("div.editable:first").trigger("mouseover");') Selenium::WebDriver::Error::UnexpectedJavascriptError: $ is not de

Re: [rspec-users] stubbing directly vs using stub method

2011-04-02 Thread Kai Schlamp
> hit = mock('hit') > hit.stub(:stored) { 5 } > hit.stored.should eq(5) > > Make sense? Of course :-) Thanks. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] stubbing directly vs using stub method

2011-04-02 Thread Kai Schlamp
I use RSpec mock and stub like this: hit = mock("hit", :stored => 5) This works fine, but when using this instead: hit = mock("hit").stub(:stored) { 5 } then I get undefined method `stored' for # I always thought both were equivalent. Can someone enlighten me? Regards, Kai __

Re: [rspec-users] Stub a controllers helper_method in a view template helper spec

2011-03-21 Thread Kai Schlamp
> In the spec, the method being spec'd should be invoked through the helper: > >   it "does something" do >     helper.method_being_specified >   end > > I did not mean to reference a helper object inside the implementation. > > Make sense? Ah, now I got it ... you meant the template helper method

Re: [rspec-users] Stub a controllers helper_method in a view template helper spec

2011-03-21 Thread Kai Schlamp
> > undefined local variable or method `helper' for #<#: > > 0xb665532c> > > What's the full backtrace? 1) ApplicationHelper order link should create html link Failure/Error: order_link(:name) NoMethodError: undefined method `fetch_param' for #<#: 0xb64a1ef4> # ./app/helper

Re: [rspec-users] Stub a controllers helper_method in a view template helper spec

2011-03-21 Thread Kai Schlamp
> > Failure/Error: order_link(:name) > >     NoMethodError: > >       undefined method `fetch_param' for #<#: > > 0xb63be118> > > That's not the same error message you posted earlier: > > NoMethodError: >       undefined method `sort_direction' for > #" error shows up when using helper.check_param

Re: [rspec-users] Stub a controllers helper_method in a view template helper spec

2011-03-21 Thread Kai Schlamp
> From this error message, it looks like you can just def it inside your > describe block. Thanks Matt, that seems to work. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Stub a controllers helper_method in a view template helper spec

2011-03-21 Thread Kai Schlamp
Ok, the tests now runs fine, but unfortunately the site itself doesn't work anymore. When the view gets rendered I get the following error: undefined local variable or method `helper' for #<#: 0xb665532c> > > module ApplicationHelper > >  def order_link(column, title = nil) > >    fetch_param(:or

Re: [rspec-users] Stub a controllers helper_method in a view template helper spec

2011-03-21 Thread Kai Schlamp
> Change this ^^ to this: > >   helper.fetch_param(:order) I was wrong the test fails also with the same error message: Failure/Error: order_link(:name) NoMethodError: undefined method `fetch_param' for #<#: 0xb63be118> ___ rspec-users maili

Re: [rspec-users] Stub a controllers helper_method in a view template helper spec

2011-03-21 Thread Kai Schlamp
> This error ^^ suggests that sort_direction is being called on the example > itself rather than the helper object. Please post the spec so we can see > what's going on. Sure ... describe ApplicationHelper do describe "order link" do it "should create html link" do # things I tried

[rspec-users] Stub a controllers helper_method in a view template helper spec

2011-03-21 Thread Kai Schlamp
My ApplicationController exposes a method (e.g. sort_direction) to the view templates by using helper_method :sort_direction. I then use this method in another method (e.g. sort_link) in a view helper (application_helper.rb). When testing the sort_link method with RSpec (in application_helper_spec

[rspec-users] response.should have_text leads to undefined method `has_text?'

2010-10-02 Thread Kai Schlamp
A big hello. I would like to test a controller that directly renders some JSON output (by using "render :json => @entity_names"). For that task I tried in my spec file "response.should have_text('["enim", "enita"]')". Unfortunately I always get that error: Failure/Error: response.should have_t