Sha256: 420e58baaf9b6d0c7c4e24996067e9653735889391059d436ef46a5fd01f325e

Contents?: true

Size: 759 Bytes

Versions: 13

Compression:

Stored size: 759 Bytes

Contents

require File.expand_path('../../helper', __FILE__)

class SpecResponse
  Innate.node '/'

  def index
    "some text"
  end
end

describe Innate::Response do
  describe 'Content-Type' do
    behaves_like :rack_test

    it 'responds with text/html by default' do
      got = get('/')
      got['Content-Type'].should == 'text/html'
    end

    it 'changes when option is changed' do
      Innate::Response.options.headers['Content-Type'] = 'text/plain'
      got = get('/')
      got['Content-Type'].should == 'text/plain'
    end

    it 'is ok with extended value' do
      Innate::Response.options.headers['Content-Type'] = 'text/plain; charset=utf-8'
      got = get('/')
      got['Content-Type'].should == 'text/plain; charset=utf-8'
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
innate-2023.01.06 spec/innate/response.rb
innate-2015.10.28 spec/innate/response.rb
innate-2013.02.21 spec/innate/response.rb
innate-2013.02 spec/innate/response.rb
innate-2012.12 spec/innate/response.rb
innate-2012.03 spec/innate/response.rb
innate-2011.12 spec/innate/response.rb
innate-2011.10 spec/innate/response.rb
innate-2011.04 spec/innate/response.rb
innate-2011.01 spec/innate/response.rb
innate-2010.07 spec/innate/response.rb
innate-2010.06.18 spec/innate/response.rb
innate-2010.04 spec/innate/response.rb