Sha256: ad4bdaf9c7489af50534832a010e74c3fce543ff766abd9b528c79c7851b6f07

Contents?: true

Size: 882 Bytes

Versions: 2

Compression:

Stored size: 882 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_child_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 }
    asserts(:cache_engine).is_a?(Rabl::CacheEngine)
  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.7.1 test/configuration_test.rb
rabl-0.7.0 test/configuration_test.rb