Neo4j::Rspec Build Status

Install

Add line into your Gemfile:

gem "neo4j-rspec"

or install it directly

gem install neo4j-rspec

Examples

Properties

it { is_expected.to define_property :general }
it { is_expected.to define_property :string, String }
it { is_expected.to define_property :boolean, Boolean } # This might need to be `ActiveAttr::Typecasting::Boolean`

has_one and has_many

it { is_expected.to have_many(:comments) }
it { is_expected.to have_many(:comments).with_direction(:in) }
it { is_expected.to have_many(:comments).with_direction(:in).with_origin(:post) }
it { is_expected.to have_many(:written_things).with_direction(:in).without_type.with_model_class([:Post, :Comment]) }

Constraints

it { is_expected.to define_constraint :name, :unique }

created_at and updated_at

it { is_expected.to track_creations } # `created_at`
it { is_expected.to track_modifications } # `updated_at`

TODO: Put some examples of usage:

  • [ ] define_index
  • [ ] come_from_model
  • [ ] lead_to_model