Sha256: 1cee55a4bf31bbe4587860b8a9986bb0b16a06250c46db4be6ee063118048e0f

Contents?: true

Size: 868 Bytes

Versions: 6

Compression:

Stored size: 868 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(:good_response => true )}
    let(:env)     { mock }
    let(:fake_file)   { mock(:filename => "blub", :url => "glub")}
    let(:mock_fantom) { mock(:cache_key => "1", :html_file => fake_file, :png_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

6 entries across 6 versions & 1 rubygems

Version Path
shutterbug-0.2.5 spec/shutterbug/convert_handler_spec.rb
shutterbug-0.2.1 spec/shutterbug/convert_handler_spec.rb
shutterbug-0.2.0 spec/shutterbug/convert_handler_spec.rb
shutterbug-0.1.2 spec/shutterbug/convert_handler_spec.rb
shutterbug-0.1.1 spec/shutterbug/convert_handler_spec.rb
shutterbug-0.1.0 spec/shutterbug/convert_handler_spec.rb