Re: [rspec-users] how to mock/stub when there are multiple model objects?

2011-06-17 Thread Patrick J. Collins
> but what if my method looks like: > >    user = User.where("...") >    user2 = User.where("...") User.should_receive(:where).with("...").and_return(...) http://apidock.com/rspec/Spec/Mocks Patrick J. Collins http://collinatorstudios.com___ rspec-users

[rspec-users] how to mock/stub when there are multiple model objects?

2011-06-17 Thread S Ahmed
I'm a bit confused how to hook into a particular model object instance and mock/stub it? I understand how to hook into a class level method like: User.should_receive(:where).and_return() but what if my method looks like: def some_thing user = User.where("...") user2 = User.where("

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 David Chelimsky
On Jun 17, 2011, at 2:20 PM, Kai Schlamp wrote: > 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

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