Skip to content

Commit

Permalink
transaction specs for everyone!
Browse files Browse the repository at this point in the history
  • Loading branch information
subvertallchris committed Dec 30, 2014
1 parent a22a705 commit 7edf31a
Showing 1 changed file with 11 additions and 36 deletions.
47 changes: 11 additions & 36 deletions spec/e2e/transaction_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,19 @@
end
end

#:nocov:
it 'returns a wrapped node inside and outside of transaction' do
i = 0
SecureRandom.stub(:uuid) do
i += 1
"secure1234_#{i}"
end

if Neo4j::Session.current.db_type == :server_db
clazz
begin
tx = Neo4j::Transaction.new
a = clazz.create name: 'a'
b = clazz.create name: 'b'
a.thing = b
# expect(a.thing).to eq("name"=>"b", "_classname"=>clazz.to_s, "uuid" => "secure1234_2")
expect(a.thing).to eq b
ensure
tx.close
end
expect(a.thing).to eq(b)
end
before { clazz }

if Neo4j::Session.current.db_type == :embedded_db
clazz
begin
tx = Neo4j::Transaction.new
a = clazz.create name: 'a'
b = clazz.create name: 'b'
a.thing = b
expect(a.thing).to eq(b)
ensure
tx.close
end
expect(a.thing).to eq(b)
it 'returns a wrapped node inside and outside of transaction' do
begin
tx = Neo4j::Transaction.new
a = clazz.create name: 'a'
b = clazz.create name: 'b'
a.thing = b
expect(a.thing).to eq b
ensure
tx.close
end

expect(a.thing).to eq(b)
end
#:nocov:
end
end

0 comments on commit 7edf31a

Please sign in to comment.