Skip to content

Commit

Permalink
using strict mode on Oj gem, so we don't convert to strings with colo…
Browse files Browse the repository at this point in the history
…ns to symbols
  • Loading branch information
maxdemarzi committed Jul 17, 2012
1 parent 100aa75 commit 28313e1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/neography/oj_parser.rb
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions spec/integration/parsing_spec.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 28313e1

Please sign in to comment.