Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
proof that we can wrap transaction responses easily
- Loading branch information
1 parent
06a2292
commit b27be5c
Showing
4 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
require 'spec_helper' | ||
|
||
describe 'wrapped nodes in transactions' do | ||
module TransactionNode | ||
class Student | ||
include Neo4j::ActiveNode | ||
property :name | ||
end | ||
end | ||
|
||
let!(:clazz) { TransactionNode::Student } | ||
before do | ||
clazz.create(name: 'John') | ||
tx = Neo4j::Transaction.new | ||
@student = clazz.first | ||
tx.close | ||
end | ||
after { clazz.destroy_all } | ||
|
||
it 'can load a node within a transaction' do | ||
expect(@student).to be_a(clazz) | ||
expect(@student.name).to eq 'John' | ||
expect(@student.id).not_to be_nil | ||
end | ||
|
||
# here's where the problems start | ||
it 'returns its :labels' do | ||
expect(@student.neo_id).to be_nil | ||
expect(@student.labels).to eq [clazz.to_sym] | ||
end | ||
|
||
it 'responds positively to exist?' do | ||
expect(@student.exist?).to be_truthy | ||
end | ||
|
||
# and so on | ||
end |
b27be5c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#487