Sha256: a3c367a9248e668698dcca76b5485e76affe2e77a1b425630839ad35876b02d5

Contents?: true

Size: 827 Bytes

Versions: 1

Compression:

Stored size: 827 Bytes

Contents

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

module Ubiquitously
  class RedditTest < ActiveSupport::TestCase
    context "Reddit::User" do
      setup do
        @user = Ubiquitously::Reddit::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
          assert_equal false, @user.logged_in?
        end
        
        should "login successfully if valid credentials" do
          assert_equal true, @user.login
          assert_equal true, @user.logged_in?
        end
      end
    end
    
    context "Reddit::Post" do
      setup do
        @post = Ubiquitously::Reddit::Post.new
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ubiquitously-0.0.1.6 test/test_reddit.rb