added spec to support ORMs with 'simple columns' (Neo4j)
This commit is contained in:
parent
591ec7afde
commit
5246fdad26
|
@ -215,3 +215,7 @@ Feature: Use step definitions generated by factories
|
||||||
And the post "Tagged post" should not have the following tags:
|
And the post "Tagged post" should not have the following tags:
|
||||||
| name |
|
| name |
|
||||||
| funky |
|
| funky |
|
||||||
|
|
||||||
|
Scenario: step definitions work correctly with ORMs that have simple `columns`
|
||||||
|
Given a simple column exists
|
||||||
|
Then there should be 1 SimpleColumn
|
||||||
|
|
|
@ -58,6 +58,21 @@ end
|
||||||
class NonActiveRecord
|
class NonActiveRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class SimpleColumn
|
||||||
|
def self.columns
|
||||||
|
[:name]
|
||||||
|
end
|
||||||
|
|
||||||
|
def save!
|
||||||
|
@@count ||= 0
|
||||||
|
@@count += 1
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.count
|
||||||
|
@@count
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
FactoryGirl.define do
|
FactoryGirl.define do
|
||||||
# To make sure the step defs work with an email
|
# To make sure the step defs work with an email
|
||||||
sequence :email do |n|
|
sequence :email do |n|
|
||||||
|
@ -90,6 +105,10 @@ FactoryGirl.define do
|
||||||
# This is here to ensure that factory step definitions don't raise for a non-AR factory
|
# This is here to ensure that factory step definitions don't raise for a non-AR factory
|
||||||
factory :non_active_record do
|
factory :non_active_record do
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# This is here to make FG work with ORMs that have `columns => [:name, :admin, :etc]` on the class (Neo4j)
|
||||||
|
factory :simple_column do
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
require 'factory_girl/step_definitions'
|
require 'factory_girl/step_definitions'
|
||||||
|
|
Loading…
Reference in New Issue