Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added first little shoulda tests

  • Loading branch information...
commit c520687d9ed74b05802e464e0bc3022cbcf2f52e 1 parent d89f27d
@aaronrussell authored
View
1  .gitignore
@@ -3,3 +3,4 @@
coverage
rdoc
pkg
+test/user_credentials.yaml
View
2  lib/freeagent/timeslip.rb
@@ -24,4 +24,4 @@ def self.find(timeslip_id)
end
end
-module Freeagent
+end
View
29 test/freeagent_api_test.rb
@@ -1,7 +1,32 @@
require 'test_helper'
+require 'yaml'
class FreeagentApiTest < Test::Unit::TestCase
- should "probably rename this file and start testing for real" do
- flunk "hey buddy, you should probably rename this file and start testing for real"
+
+ include Freeagent
+
+ context "Before we do anything, we" do
+ setup do
+ @config ||= YAML.load_file 'test/user_credentials.yaml'
+ end
+ should "set the domain" do
+ assert Freeagent.domain = @config['domain']
+ end
+ should "set the username" do
+ assert Freeagent.username = @config['username']
+ end
+ should "set the password" do
+ assert Freeagent.password = @config['password']
+ end
end
+
+ context "Many projects" do
+ setup do
+ @projects = Project.find_all
+ end
+ should "be in an array" do
+ assert @projects.is_a? Array
+ end
+ end
+
end
Please sign in to comment.
Something went wrong with that request. Please try again.