Sha256: b8f9c7ea3b82b155852867da305a81a9601ac92d3964dda8a73a51e6d2e27287

Contents?: true

Size: 785 Bytes

Versions: 2

Compression:

Stored size: 785 Bytes

Contents

require File.expand_path('../teststrap', __FILE__)
require File.expand_path('../../lib/rabl', __FILE__)

context 'Rabl::Configuration' do
  context 'defaults' do
    # multi_json compatibility TODO
    helper(:json_engine) { MultiJson.respond_to?(:adapter) ? MultiJson.adapter : MultiJson.engine }
    setup { Rabl.configuration }

    asserts(:include_json_root).equals true
    asserts(:include_xml_root).equals false
    asserts(:enable_json_callbacks).equals false
    asserts(:view_paths).equals []
    asserts(:json_engine).equals { json_engine }
  end

  context 'custom JSON engine' do
    setup do
      Rabl.configure do |c|
        c.json_engine = :yajl
      end
    end

    asserts('uses a custom JSON engine') { topic.json_engine.to_s =~ /MultiJson.*::Yajl/ }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rabl-0.6.12 test/configuration_test.rb
rabl-0.6.11 test/configuration_test.rb