Permalink
Browse files

[projects] initial model

  • Loading branch information...
1 parent 4ebb3c8 commit ce6aa6122dca869d42accfd320c5a8170eb41b66 @achiu achiu committed Jul 12, 2010
Showing with 24 additions and 0 deletions.
  1. +8 −0 app/models/project.rb
  2. +5 −0 test/blueprints.rb
  3. +11 −0 test/models/project_test.rb
View
8 app/models/project.rb
@@ -0,0 +1,8 @@
+class Project
+ include MongoMapper::Document
+
+ # key <name>, <type>
+ key :title, String
+ key :description, String
+ timestamps!
+end
View
5 test/blueprints.rb
@@ -14,6 +14,11 @@
description { Sham.body }
end
+Project.blueprint do
+ title { Sham.title }
+ description { Sham.body }
+end
+
Account.blueprint do
username { Sham.username }
first_name { Sham.first_name }
View
11 test/models/project_test.rb
@@ -0,0 +1,11 @@
+require File.expand_path(File.dirname(__FILE__) + '/../test_config.rb')
+
+context "Project Model" do
+ setup { Project.delete_all }
+
+ context "definition" do
+ setup { Project.make }
+ asserts_topic.has_key :title, String
+ asserts_topic.has_key :description, String
+ end
+end

0 comments on commit ce6aa61

Please sign in to comment.