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

- old
+ new

@@ -1,42 +1,40 @@ require File.dirname(__FILE__) + '/test_helper.rb' -require 'restclient' + module Ubiquitously class FavesTest < ActiveSupport::TestCase - context "Faves::User" do + context "Faves::Account" do setup do - @user = Ubiquitously::Faves::User.new + create_user(:storage => "test/config") 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 should "login successfully if valid credentials" do - assert_equal true, @user.login + assert_equal true, @user.login(:faves) end end end -=begin context "Faves::Post" do setup do - @post = Ubiquitously::Faves::Post.new( - :debug => true, - :title => "A Title", - :description => "A Description", - :tags => ["usability", "ruby", "web services", "open source"], - :url => "http://example.com/abcdef", - :user => Ubiquitously::Faves::User.new + create_user(:storage => "test/config") + + @title = "Viatropos" + @description = "Mechanically logging in" + @tags = %w(ubiquitous) + + @post = Ubiquitously::Post.new( + :url => "http://twitter.com/", + :title => @title, + :description => @description, + :tags => @tags, + :user => @user ) end should "create a post" do - assert @post.save + assert @post.save(:faves) end end -=end + end end