spec/helpers/models.rb in motion-prime-0.8.0 vs spec/helpers/models.rb in motion-prime-0.8.1
- old
+ new
@@ -31,18 +31,28 @@
class Autobot < MotionPrime::Model
attribute :name
end
+class Organization < MotionPrime::Model
+ attribute :name
+ has_many :projects
+end
+
+class Project < MotionPrime::Model
+ attribute :title
+end
+
module CustomModule; end
class CustomModule::Car < MotionPrime::Model
attribute :name
attribute :created_at
end
Car = CustomModule::Car
-def stub_user(name, age, created_at)
+def stub_user(name, age, created_at, id = nil)
user = User.new
+ user.id = id || 1
user.name = name
user.age = age
user.created_at = created_at
user
end
\ No newline at end of file