0
@@ -151,6 +151,54 @@ class BackendControllerTest < Test::Unit::TestCase
0
+ def test_meta_weblog_new_post_tags
0
+ # test weather we can create a new post, set tags and get away with it...
0
+ tags = 'blog, emacs, fun, rails, ruby'
0
+ article = MetaWeblogStructs::Article.new(:title => 'This is a title', :description => 'This is a post', :mt_keywords => tags)
0
+ args = [ 1, 'quentin', 'test', article, 1 ]
0
+ result = invoke_layered :metaWeblog, :newPost, *args
0
+ new_post = Article.find(result)
0
+ assert_equal Tag.parse_to_tags(tags).collect(&:name).sort, new_post.tags.collect(&:name).sort
0
+ def test_meta_weblog_edit_post_tags
0
+ tags = 'blog, emacs, fun, rails, ruby'
0
+ article = MetaWeblogStructs::Article.new(:title => 'This is a title', :description => 'This is a post', :mt_keywords => tags)
0
+ args = [ 1, 'quentin', 'test', article, 1 ]
0
+ post_id = invoke_layered :metaWeblog, :newPost, *args
0
+ new_post = Article.find(post_id)
0
+ assert_equal Tag.parse_to_tags(tags).collect(&:name).sort, new_post.tags.collect(&:name).sort
0
+ tags = 'bar, baz, foo'
0
+ article = MetaWeblogStructs::Article.new(:title => 'This is a title', :description => 'This is a post', :mt_keywords => tags)
0
+ args = [ post_id, 'quentin', 'test', article, 1]
0
+ edit_result = invoke_layered :metaWeblog, :editPost, *args
0
+ assert_equal true, edit_result
0
+ new_post = Article.find(post_id)
0
+ assert_equal Tag.parse_to_tags(tags).collect(&:name).sort, new_post.tags.collect(&:name).sort
0
+ def test_meta_weblog_get_post_with_tags
0
+ # set tags and see if we recive them!
0
+ tags = 'blog, emacs, fun, rails, ruby'
0
+ article = MetaWeblogStructs::Article.new(:title => 'This is a title', :description => 'This is a post', :mt_keywords => tags)
0
+ args = [ 1, 'quentin', 'test', article, 1 ]
0
+ post_id = invoke_layered :metaWeblog, :newPost, *args
0
+ args = [ post_id, 'quentin', 'test' ]
0
+ result = invoke_layered :metaWeblog, :getPost, *args
0
+ assert_equal tags, result['mt_keywords']
0
def test_meta_weblog_new_post_min
0
# This is going to test weather a post is correctly submited or not without the published_at field!
0
# See http://www.xmlrpc.com/metaWeblogApi#theStruct or
0
@@ -195,7 +243,6 @@ class BackendControllerTest < Test::Unit::TestCase
0
assert_equal 'This is a title', new_post.title
0
assert_equal c[:expect], new_post.status
0
@@ -253,5 +300,4 @@ class BackendControllerTest < Test::Unit::TestCase
0
'bits' => Base64.encode64(File.open(File.expand_path(RAILS_ROOT) + '/public/images/mephisto/shadow.png', 'rb') { |f| f.read })
Comments
No one has commented yet.