Sha256: 096f52b2a9602afd9f3909cb2fcb9b1ca61071766f717422bea4cedf2dc98f54

Contents?: true

Size: 686 Bytes

Versions: 3

Compression:

Stored size: 686 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe Neo4jr::FormatHandler do

  it 'returns pure json by default' do
    get '/'
    last_response.body.should_not include(html_space = ' ')
    last_response.headers['Content-Type'].should include('application/json')
  end

  it 'returns htmlized json if a browser request' do
    get '/', {}, {'HTTP_ACCEPT' => 'text/html'}
    last_response.body.should include(html_space = ' ')
    last_response.headers['Content-Type'].should include('text/html')
  end
  
  it 'always returns utf compliant text' do
    get '/'
    last_response.headers['Content-Type'].should include('charset=utf-8')
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
neo4jr-social-0.3.1 spec/format_handler_spec.rb
neo4jr-social-0.2.0 spec/format_handler_spec.rb
neo4jr-social-0.1.2 spec/format_handler_spec.rb