Sha256: b2bc6f1199dc1b53cc4dd521beab2cfa6d582d6e70084494cea7a85f2a8bd4e1

Contents?: true

Size: 507 Bytes

Versions: 2

Compression:

Stored size: 507 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

2 entries across 2 versions & 1 rubygems

Version Path
rasti-web-2.1.1 spec/endpoint_spec.rb
rasti-web-2.1.0 spec/endpoint_spec.rb