diff options
| author | Zack Hobson | 2013-12-22 02:01:37 -0800 | 
|---|---|---|
| committer | Zack Hobson | 2013-12-22 02:01:37 -0800 | 
| commit | 24bb1cc3fea3e75aedcc64cdc30bb73089a7c157 (patch) | |
| tree | 9a57f2baf979605e349d0856f62fe91d63da2ea4 /test/day_entry_test.rb | |
| parent | de34961a1a1795bd12b3cabd47ca06e01c73c27a (diff) | |
| download | hcl-24bb1cc3fea3e75aedcc64cdc30bb73089a7c157.tar.bz2 | |
coverage game!
Diffstat (limited to 'test/day_entry_test.rb')
| -rw-r--r-- | test/day_entry_test.rb | 18 | 
1 files changed, 18 insertions, 0 deletions
| diff --git a/test/day_entry_test.rb b/test/day_entry_test.rb index 5b390c3..581b22b 100644 --- a/test/day_entry_test.rb +++ b/test/day_entry_test.rb @@ -1,6 +1,24 @@  require 'test_helper'  class DayEntryTest < HCl::TestCase +  def test_cancel_success +    entry = HCl::DayEntry.new(id:123) +    HCl::DayEntry.expects(:delete) +    assert entry.cancel +  end + +  def test_cancel_failure +    entry = HCl::DayEntry.new(id:123) +    HCl::DayEntry.expects(:delete).raises(HCl::TimesheetResource::Failure) +    assert !entry.cancel +  end + +  def test_to_s +    entry = HCl::DayEntry.new \ +      hours: '1.2', client: 'Taco Town', project:'Pizza Taco', task:'Preparation' +    assert_equal "Taco Town - Pizza Taco - Preparation (1:12)", entry.to_s +  end +    def test_from_xml      entries = HCl::DayEntry.from_xml(<<-EOD)  <daily> | 
