Skip to content
This repository
Browse code

added spec to support ORMs with 'simple columns' (Neo4j)

  • Loading branch information...
commit 5246fdad261146bb8fa613ce021c12867be58968 1 parent 591ec7a
Dmytrii Nagirniak dnagir authored joshuaclayton committed
4 features/factory_girl_steps.feature
@@ -215,3 +215,7 @@ Feature: Use step definitions generated by factories
215 215 And the post "Tagged post" should not have the following tags:
216 216 | name |
217 217 | funky |
  218 +
  219 + Scenario: step definitions work correctly with ORMs that have simple `columns`
  220 + Given a simple column exists
  221 + Then there should be 1 SimpleColumn
19 features/support/factories.rb
@@ -58,6 +58,21 @@ class Tag < ActiveRecord::Base
58 58 class NonActiveRecord
59 59 end
60 60
  61 +class SimpleColumn
  62 + def self.columns
  63 + [:name]
  64 + end
  65 +
  66 + def save!
  67 + @@count ||= 0
  68 + @@count += 1
  69 + end
  70 +
  71 + def self.count
  72 + @@count
  73 + end
  74 +end
  75 +
61 76 FactoryGirl.define do
62 77 # To make sure the step defs work with an email
63 78 sequence :email do |n|
@@ -90,6 +105,10 @@ class NonActiveRecord
90 105 # This is here to ensure that factory step definitions don't raise for a non-AR factory
91 106 factory :non_active_record do
92 107 end
  108 +
  109 + # This is here to make FG work with ORMs that have `columns => [:name, :admin, :etc]` on the class (Neo4j)
  110 + factory :simple_column do
  111 + end
93 112 end
94 113
95 114 require 'factory_girl/step_definitions'

0 comments on commit 5246fda

Please sign in to comment.
Something went wrong with that request. Please try again.