require 'test_helper' class N4jTest < ActiveSupport::TestCase class NodeWithFields include N4j::Entity include N4j::Node field :foo end test "use field to set data" do node = NodeWithFields.new({}) assert node.foo = 'hi' assert node.foo == 'hi' assert_equal node.data['foo'], 'hi' end end