Skip to content

Commit

Permalink
failing spec for node create with weird value
Browse files Browse the repository at this point in the history
  • Loading branch information
subvertallchris committed Aug 15, 2016
1 parent d8727fd commit eb262d6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/e2e/shared/query_factory_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ def self.count
expect(from_node_factory.query.pluck(:from_node).first).to be_a(FactoryFromClass)
end.to change { FactoryFromClass.count }
end

context 'with a value that might be interpreted as a prop' do
let(:from_node) { FactoryFromClass.new(name: '{Tricky .Value}')}
it 'creates without error' do
expect do
expect(from_node_factory.query.pluck(:from_node).first).to be_a(FactoryFromClass)
end.to change { FactoryFromClass.where(name: from_node.name).count }
end
end

This comment has been minimized.

Copy link
@subvertallchris

subvertallchris Aug 15, 2016

Author Contributor
 Failure/Error: expect(from_node_factory.query.pluck(:from_node).first).to be_a(FactoryFromClass)

 Neo4j::Session::CypherError:
   Invalid input '.': expected whitespace, comment, '}' or ':' (line 1, column 94 (offset: 93))
   "CREATE (from_node:`FactoryFromClass` {uuid: {from_node_FactoryFromClass_uuid}, name: {Tricky .Value}}) RETURN from_node"
end

context 'persisted' do
Expand All @@ -54,6 +63,16 @@ def self.count
expect(rel_factory.query.pluck(:rel).first).to be_a(FactoryRelClass)
end.to change { FactoryRelClass.count }
end

context 'with a value that might be interpreted as a prop' do
let(:rel) { FactoryRelClass.new(score: '{9000 ....}') }

it 'creates without error' do
expect do
expect(rel_factory.query.pluck(:rel).first).to be_a(FactoryRelClass)
end.to change { FactoryRelClass.count }
end
end

This comment has been minimized.

Copy link
@subvertallchris

subvertallchris Aug 15, 2016

Author Contributor

This does not exhibit the problem because rels use set, they do not pass the params in with CREATE function.

end

context 'persisted' do
Expand Down

0 comments on commit eb262d6

Please sign in to comment.