Sha256: 95af9e7d5f2e02b03bc22b43443656cdab921af6d37db84ca3ad0d37777242d4

Contents?: true

Size: 841 Bytes

Versions: 1

Compression:

Stored size: 841 Bytes

Contents

require 'spec_helper'

describe "getting rack response directly" do

  before(:each) do
    @app = test_app.configure do
      generator :test do |content|
        content.update("bunheads")
      end
    end
  end

  it "should give a rack response" do
    response = @app.generate(:test).to_response
    response.should be_a(Array)
    response.length.should == 3
    response[0].should == 200
    response[1]['content-type'].should == 'application/octet-stream'
    response[2].data.should == 'bunheads'
  end

  it "should allow passing in the env" do
    response = @app.generate(:test).to_response('REQUEST_METHOD' => 'POST')
    response.should be_a(Array)
    response.length.should == 3
    response[0].should == 405
    response[1]['content-type'].should == 'text/plain'
    response[2].should == ["method not allowed"]
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dragonfly-1.4.1 spec/functional/to_response_spec.rb