Sha256: 1569e653d1e0fdd234d179212be794e8b326b730f1c92c6f8cf5f996d96ec25c

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

require File.dirname(__FILE__) + '/test_helper.rb'

module Ubiquitously
  class DzoneTest < ActiveSupport::TestCase
    context "Dzone::User" do
      setup do
        @user = Ubiquitously::Dzone::User.new
      end
      
      context "login" do
        should "raise informative error if invalid password" do
          @user.password = "bad password"
          assert_raises(Ubiquitously::AuthenticationError) do
            @user.login
          end
        end
      end
    end
    
    context "Dzone::Post" do
      setup do
        @post = Ubiquitously::Dzone::Post.new
      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"
        )
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ubiquitously-0.0.1.6 test/test_dzone.rb