title: How to mock (??) a method called within a feature spec in Capybara/Rspec
body: <p>All the guides to mocking (stubbing/whatever) in Rspec that I can find seem to be written for unit tests.</p>
  
  <p>I have feature tests in Capybara/Rspec that look like this:</p>
  
  <pre><code>  visit page
    click button
    page should contain a png
  </code></pre>
  
  <p>This triggers actions in my controller that look like this:</p>
  
  <pre><code>  load parameters
    Worker.queue_a_lengthy_task_that_generates_a_png
    load page
  </code></pre>
  
  <p>I don't want to skip the lengthy task, but I don't want to run it either in the integration test. (I'll run it separately in a unit test.)</p>
  
  <p>How can I ensure, in this example, that <code>Worker.queue_a_lengthy_task_that_generates_a_png</code> returns a Base64-encoding one-pixel PNG, so my integration tests don't take forever?</p>
  
  <p>Sorry if this has been asked before but all the methods I have found seem to written for unit tests not feature specs.</p>