sineed / neo4j-rspec

MIT License
10 stars 13 forks source link

uniqueness validation #19

Open ernestoe opened 8 years ago

ernestoe commented 8 years ago

The following syntax

describe Post do
  context 'validations' do
    subject { FactoryGirl.build(:post) }

    it do
      should validate_uniqueness_of(:slug).
        scoped_to(:user_id).
        with_message('duplicate slug within same user_id').
        case_insensitive
    end
  end
end

is supported by shoulda-matchers / Active Record .

Although some of the shoulda-matchers can be used with ActiveNode, the previous one cannot.

Is this something that neo4j-rspec can tackle?

cheerfulstoic commented 8 years ago

I imagine so, though I don't know if the gem stores state in such a way that neo4j-rspec could determine this or not. Let me know if something in the gem needs to change to help make this happen