diff --git a/lib/neography/oj_parser.rb b/lib/neography/oj_parser.rb index 94ebd82..fe27953 100644 --- a/lib/neography/oj_parser.rb +++ b/lib/neography/oj_parser.rb @@ -1,8 +1,8 @@ class OjParser < HTTParty::Parser - + Oj.default_options = { :mode => :strict } + protected def json - #Oj::Doc.parse(body) Oj.load(body) end end \ No newline at end of file diff --git a/spec/integration/parsing_spec.rb b/spec/integration/parsing_spec.rb new file mode 100644 index 0000000..a73846b --- /dev/null +++ b/spec/integration/parsing_spec.rb @@ -0,0 +1,13 @@ +require File.join(File.dirname(__FILE__), '..', 'spec_helper') + +describe Neography do + subject { Neography::Rest.new } + describe 'create_node' do + it 'should not convert strings to symbol' do + node = subject.create_node({:text => ':1456'}) + + node['data']['text'].class.should == String # fails! expected: String got: Symbol (using ==) + node['data']['text'].should == ':1456' + end + end +end \ No newline at end of file