Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit test for entity updates #8

Merged
merged 1 commit into from Jul 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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