summaryrefslogtreecommitdiffstats
path: root/test/day_entry_test.rb
diff options
context:
space:
mode:
authorZack Hobson2009-08-23 20:46:29 -0700
committerZack Hobson2009-08-23 20:46:38 -0700
commitd82f777ee4e3e89cfab56afb92297a6330dd8199 (patch)
tree39158e1d5bd531286d18bfd1ae190006f54379be /test/day_entry_test.rb
parentd98c7b2dc30e088fe56cc26e4f7723c4c7b18d24 (diff)
downloadhcl-d82f777ee4e3e89cfab56afb92297a6330dd8199.tar.bz2
Another attempt at closing #26.
This time there are some tests!
Diffstat (limited to 'test/day_entry_test.rb')
-rw-r--r--test/day_entry_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/day_entry_test.rb b/test/day_entry_test.rb
index 5c9b37d..c27ffda 100644
--- a/test/day_entry_test.rb
+++ b/test/day_entry_test.rb
@@ -33,4 +33,17 @@ class DayEntryTest < Test::Unit::TestCase
end
end
+ should "append to an existing note" do
+ entry = HCl::DayEntry.new(:id => '1', :notes => 'yourmom.', :hours => '1.0')
+ HCl::DayEntry.stubs(:post)
+ entry.append_note('hi world')
+ assert_equal 'yourmom. hi world', entry.notes
+ end
+
+ should "append to an undefined note" do
+ entry = HCl::DayEntry.new(:id => '1', :notes => nil, :hours => '1.0')
+ HCl::DayEntry.stubs(:post)
+ entry.append_note('hi world')
+ assert_equal ' hi world', entry.notes
+ end
end