Is it possible to stub methods when using Capybara, particularly capybara-webkit driver?
This does not seem to work:
before do
User.any_instance.stub(:get_tweets)
visit tweets_path
end
I presume it doesn't work because we're stubbing the User object in rspec land, whereas the capybara-webkit driver is executing the Rails app in a separate "thread".
Is there a best practice on mocking/stubbing in feature specs?