Sha256: 747a6e54e12f48de50f9a796a405d0a27b126566eafff22613882ab678a9ee7c

Contents?: true

Size: 511 Bytes

Versions: 17

Compression:

Stored size: 511 Bytes

Contents

require 'minitest_helper'

describe Rasti::Web::Endpoint do

  it 'Call' do
    endpoint = Rasti::Web::Endpoint.new do |req, res, render|
      req.must_be_instance_of Rasti::Web::Request
      res.must_be_instance_of Rack::Response

      render.text 'Content'
    end    

    env = Rack::MockRequest.env_for '/'

    status, headers, response = endpoint.call env

    status.must_equal 200
    headers['Content-Type'].must_equal 'text/plain; charset=utf-8'
    response.body.must_equal ['Content']
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rasti-web-2.0.1 spec/endpoint_spec.rb
rasti-web-2.0.0 spec/endpoint_spec.rb
rasti-web-1.2.1 spec/endpoint_spec.rb
rasti-web-1.2.0 spec/endpoint_spec.rb
rasti-web-1.1.0 spec/endpoint_spec.rb
rasti-web-1.0.0 spec/endpoint_spec.rb
rasti-web-0.2.3 spec/endpoint_spec.rb
rasti-web-0.2.2 spec/endpoint_spec.rb
rasti-web-0.2.1 spec/endpoint_spec.rb
rasti-web-0.2.0 spec/endpoint_spec.rb
rasti-web-0.1.1 spec/endpoint_spec.rb
rasti-web-0.1.0 spec/endpoint_spec.rb
rasti-web-0.0.7 spec/endpoint_spec.rb
rasti-web-0.0.6 spec/endpoint_spec.rb
rasti-web-0.0.5 spec/endpoint_spec.rb
rasti-web-0.0.4 spec/endpoint_spec.rb
rasti-web-0.0.3 spec/endpoint_spec.rb