test/test_dzone.rb in ubiquitously-0.0.1.6 vs test/test_dzone.rb in ubiquitously-0.1.0

- old
+ new

@@ -1,12 +1,13 @@ require File.dirname(__FILE__) + '/test_helper.rb' module Ubiquitously class DzoneTest < ActiveSupport::TestCase - context "Dzone::User" do +=begin + context "Dzone::Account" do setup do - @user = Ubiquitously::Dzone::User.new + @user = Ubiquitously::Dzone::Account.new end context "login" do should "raise informative error if invalid password" do @user.password = "bad password" @@ -14,30 +15,34 @@ @user.login end end end end - +=end context "Dzone::Post" do setup do - @post = Ubiquitously::Dzone::Post.new + @user = Ubiquitously::User.new( + :username => "viatropos", + :cookies_path => "test/cookies.yml" + ) + + @title = "Using Redis on Heroku" + @description = "The only javascript framework you'll need. Well, if you need Object Oriented JS, you'll have to do a little initial setup." + @tags = %w(javascript, frameworks, jquery) + + @post = Ubiquitously::Post.new( + :url => "./test/meta.html", + :title => @title, + :description => @description, + :tags => @tags, + :categories => ["web-design"], + :user => @user + ) end - should "raise error if post exists already" do - assert_raises(Ubiquitously::DuplicateError) do - Ubiquitously::Dzone::Post.new_record?("http://www.google.com", true) - end - end - should "create a post" do - # http://www.dzone.com/links/buttons.jsp - assert Ubiquitously::Dzone::Post.create( - :debug => true, - :title => "A Title", - :description => "A Description", - :tags => ["usability", "ruby", "web services", "open source"], - :url => "http://example.com/abcdef" - ) + @post.url = "http://www.zhione.com/security/understanding-network-security-in-plain-english/" + assert @post.save(:dzone) end end end end