Sha256: cb4fedd73d15ba689e037ffac22aa31c288eb8f6748be6fcfca0d750a80f2125

Contents?: true

Size: 529 Bytes

Versions: 2

Compression:

Stored size: 529 Bytes

Contents

require 'spec_helper'

describe Response::HTML, '.build' do
  subject { object.build(body) }

  let(:body)    { double('Body')    }
  let(:object)  { described_class }

  its(:status)  { should be(Response::Status::OK)  }
  its(:body)    { should be(body) }
  its(:headers) { should eql('Content-Type' => 'text/html; charset=UTF-8') }

  it 'allows to modify response' do
    object.build(body) do |response|
      response.with_status(Response::Status::NOT_FOUND)
    end.status.should be(Response::Status::NOT_FOUND)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
response-0.0.5 spec/unit/response/html/class_methods/build_spec.rb
response-0.0.4 spec/unit/response/html/class_methods/build_spec.rb