summaryrefslogtreecommitdiffstats
path: root/test/task_test.rb
blob: e69fcf916a845a333e067589990a8b2c2d5a7575 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class Task < Test::Unit::TestCase
  def test_cache_tasks
    HCl::Task.cache_tasks(REXML::Document.new(<<-EOD))
<daily>
  <projects>
    <project>
      <name>Click and Type</name>
      <code></code>
      <id type="integer">3</id>
      <client>AFS</client>
      <tasks>
        <task>
          <name>Security support</name>
          <id type="integer">14</id>
          <billable type="boolean">true</billable>
        </task>
      </tasks>
    </project>
  </projects>
</daily>
    EOD
    assert_equal 1, HCl::Task.all.size
    assert_equal 'Security support', HCl::Task.all.first.name
  end
end