Skip to content

Commit

Permalink
Add unit test for entity updates (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreylovitz committed Jul 13, 2020
1 parent 50f39ff commit 6fa303d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/redisgraph_spec.rb
Expand Up @@ -76,4 +76,20 @@ def create_graph()
expect(res.resultset).to eq([["src1", [{"name"=>"dest1"}, {"color"=>"magenta"}], [{"weight"=>7.8}]]])
end
end

context "update" do
it "should support adding new properties" do
q = """MATCH (a {name: 'src1'}) SET a.newval = true"""
plan = @r.explain(q)
expect(plan.detect { |row| row.include?("Update") }).to_not be_nil
res = @r.query(q)
expect(res.stats[:properties_set]).to eq(1)
end

it "should print property strings correctly after updates" do
q = """MATCH (a {name: 'src1'}) RETURN a"""
res = @r.query(q)
expect(res.resultset).to eq([[[{"name"=>"src1"}, {"color"=>"cyan"}, {"newval"=>TRUE}]]])
end
end
end

0 comments on commit 6fa303d

Please sign in to comment.