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
describe 'Created Node Class' do | |
before(:all) do | |
@name = 'Patient' | |
@token = {model_name: @name, properties: [:first, :second]} | |
@klass = NodeFactory.get_node_class(@token) | |
end | |
it 'queries the graph and instantiates itself the correct number of times' do |
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
➜ MgDB git:(abs-neo4j) ✗ pry | |
[1] pry(main)> require 'yaml' | |
=> true | |
[2] pry(main)> require './model/abstract_node' | |
=> true | |
[3] pry(main)> myhash = YAML.load(File.open('yaml-model/patient.yaml')) | |
=> {:model_name=>"Patient", | |
:properties=>[:mrn, :firstname, :surname, :dob, :gender]} | |
[4] pry(main)> Patient = Mgdb::NodeFactory.get_node_class(myhash) | |
=> Kernel::Patient |
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
describe "PUT update" do | |
describe "with valid params" do | |
it "updates the requested article" do | |
article = Article.create! valid_attributes | |
Article.any_instance.should_receive(:update).with({ "these" => "params" }) | |
put :update, {:id => article.to_param, :article => { "these" => "params" }}, valid_session | |
end | |
it "assigns the requested article as @article" do | |
article = Article.create! valid_attributes |
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
--- ~ » irb | |
2.0.0p247 :001 > class MyClass | |
2.0.0p247 :002?> def initialize(val) | |
2.0.0p247 :003?> @x = val | |
2.0.0p247 :004?> end | |
2.0.0p247 :005?> def my_method | |
2.0.0p247 :006?> @x | |
2.0.0p247 :007?> end | |
2.0.0p247 :008?> end | |
=> nil |
NewerOlder