diff options
| author | Zack Hobson | 2009-08-23 20:36:42 -0700 | 
|---|---|---|
| committer | Zack Hobson | 2009-08-23 20:36:42 -0700 | 
| commit | d98c7b2dc30e088fe56cc26e4f7723c4c7b18d24 (patch) | |
| tree | f9b562bc187830657e6ac22be936f5af894cbba9 /test/day_entry_test.rb | |
| parent | 0582befffbfffd65d14c295874c720fba8d08aca (diff) | |
| download | hcl-d98c7b2dc30e088fe56cc26e4f7723c4c7b18d24.tar.bz2 | |
Started a test suite.
Diffstat (limited to 'test/day_entry_test.rb')
| -rw-r--r-- | test/day_entry_test.rb | 36 | 
1 files changed, 36 insertions, 0 deletions
| diff --git a/test/day_entry_test.rb b/test/day_entry_test.rb new file mode 100644 index 0000000..5c9b37d --- /dev/null +++ b/test/day_entry_test.rb @@ -0,0 +1,36 @@ +require 'test_helper' + +class DayEntryTest < Test::Unit::TestCase +  should "read DayEntry xml" do +    entries = HCl::DayEntry.from_xml(<<-EOD) +<daily> +  <for_day type="date">Wed, 18 Oct 2006</for_day> +  <day_entries> +    <day_entry> +      <id type="integer">195168</id> +      <client>Iridesco</client> +      <project>Harvest</project> +      <task>Backend Programming</task> +      <hours type="float">2.06</hours> +      <notes>Test api support</notes> +      <timer_started_at type="datetime"> +        Wed, 18 Oct 2006 09:53:06 -0000 +      </timer_started_at> +      <created_at type="datetime">Wed, 18 Oct 2006 09:53:06 -0000</created_at> +    </day_entry> +  </day_entries> +</daily> +    EOD +    assert_equal 1, entries.size +    { +      :project => 'Harvest', +      :client => 'Iridesco', +      :task => 'Backend Programming', +      :notes => 'Test api support', +      :hours => '2.06', +    }.each do |method, value| +      assert_equal value, entries.first.send(method) +    end +  end + +end | 
