Sha256: 0bb06aa53b54b88debb91b24a98dfc2884eac6d45aedc5860ccaab6e441bb1bc

Contents?: true

Size: 869 Bytes

Versions: 11

Compression:

Stored size: 869 Bytes

Contents

require 'shared_examples_for_handlers'

describe Shutterbug::Handlers::ConvertHandler do
  let(:mock_post) do
    mock(:POST => {},
      :referrer => nil,
      :scheme => nil,
      :host_with_port => nil)
  end
  let(:req) { mock_post }

  it_behaves_like "a request handler" do
    let(:req) { mock_post }
  end

  describe "calling phantom" do
    let(:mock_results) { mock }
    let(:rackapp) { mock(:response => true )}
    let(:env)     { mock }
    let(:fake_file)   { mock(:filename => "blub", :url => "glub")}
    let(:mock_fantom) { mock(:cache_key => "1", :html_file => fake_file, :image_file => fake_file) }
    before(:each) do
      Shutterbug::PhantomJob.stub!(:new => mock_fantom)
    end
    it "should invoke phantom" do
      mock_fantom.should_receive(:rasterize).and_return(mock_results)
      subject.handle(rackapp, req, env)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
shutterbug-0.5.9 spec/shutterbug/convert_handler_spec.rb
shutterbug-0.5.8 spec/shutterbug/convert_handler_spec.rb
shutterbug-0.5.7 spec/shutterbug/convert_handler_spec.rb
shutterbug-0.5.6 spec/shutterbug/convert_handler_spec.rb
shutterbug-0.5.5 spec/shutterbug/convert_handler_spec.rb
shutterbug-0.5.4 spec/shutterbug/convert_handler_spec.rb
shutterbug-0.5.3 spec/shutterbug/convert_handler_spec.rb
shutterbug-0.5.2 spec/shutterbug/convert_handler_spec.rb
shutterbug-0.5.1 spec/shutterbug/convert_handler_spec.rb
shutterbug-0.5.0 spec/shutterbug/convert_handler_spec.rb
shutterbug-0.4.3 spec/shutterbug/convert_handler_spec.rb