Permalink
Browse files

Added green test for creating an Article.

  • Loading branch information...
francois committed Oct 17, 2008
1 parent 63a012c commit 1ff281e82c8bd234441bb36e3c5d2a00031ded3c
Showing with 16 additions and 0 deletions.
  1. +8 −0 app/models/article.rb
  2. 0 test/fixtures/articles.yml
  3. +8 −0 test/unit/article_test.rb
View
@@ -0,0 +1,8 @@
+class Article
+ include DataMapper::Resource
+
+ property :id, Integer, :serial => true
+ property :title, String
+ property :body, Text
+ property :published_at, DateTime
+end
No changes.
@@ -0,0 +1,8 @@
+require 'test_helper'
+
+class ArticleTest < ActiveSupport::TestCase
+ def test_create
+ article = Article.create(:title => "First Post", :body => "This is my first-ever post", :published_at => Time.now.utc)
+ assert !article.new_record?
+ end
+end

0 comments on commit 1ff281e

Please sign in to comment.