浏览代码

added article create test

Kevin Hughes 11 年之前
父节点
当前提交
51b97c4594
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      test/article_test.rb

+ 7 - 0
test/article_test.rb

@@ -2,6 +2,13 @@ require 'test_helper'
 
 class ArticleTest < Test::Unit::TestCase
 
+  def test_create_article
+    fake "blogs/1008414260/articles", :method => :post, :body => load_fixture('article')
+    article = ShopifyAPI::Article.new(:blog_id => 1008414260)
+    article.save
+    assert_equal "First Post", article.title
+  end
+
   def test_get_article
     fake "articles/6242736", :method => :get, :body => load_fixture('article')
     article = ShopifyAPI::Article.find(6242736)