Sha256: 5416f0d479a1c4bca0d969dd1e1864d7d5890ae7311b52fe757682667448da30

Contents?: true

Size: 610 Bytes

Versions: 1

Compression:

Stored size: 610 Bytes

Contents

# encoding: utf-8
require File.dirname(__FILE__) + '/../test_helper'

class MetadataTest < ActiveSupport::TestCase
  def test_params_serialize_to_json_without_escaping_utf8
    Tutuf::VisualQuery::Base.new('sql' => %{SELECT AVG(age) AS "възраст" FROM people}, 'query' => {'name' => "params_serialization"}).save
    assert_equal %q!{"sql":"SELECT AVG(age) AS \"възраст\" FROM people","query":{"name":"params_serialization"}}!,
                 ActiveRecord::Base.connection.select_all(%{SELECT params FROM tutuf_visual_query_metadata WHERE name='params_serialization'}).first['params']
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
visual_query-0.3.0 test/unit/metadata_test.rb