Skip to content

Commit

Permalink
Add 4 more attributes which are non-default fields for an Iteration r…
Browse files Browse the repository at this point in the history
…esource.

- velocity
- points
- accepted points
- effective points
  • Loading branch information
winston committed Apr 24, 2017
1 parent 7714e3d commit 29dcf96
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/tracker_api/resources/iteration.rb
Expand Up @@ -16,6 +16,10 @@ class Iteration
attribute :stories, [Story]
attribute :story_ids, [Integer]
attribute :team_strength, Float
attribute :velocity, Float
attribute :points, Integer
attribute :accepted_points, Integer
attribute :effective_points, Float

def stories=(data)
super.each { |s| s.client = client }
Expand Down
14 changes: 14 additions & 0 deletions test/project_test.rb
Expand Up @@ -92,6 +92,20 @@
end
end

it 'can get iteration with non-default fields' do
VCR.use_cassette('get current iteration', record: :new_episodes) do
iterations = project.iterations(scope: :current, fields: ":default,velocity,points,accepted_points,effective_points")

iterations.wont_be_empty

current = iterations.first
current.velocity.must_equal 10.0
current.points.must_equal 10
current.accepted_points.must_equal 0
current.effective_points.must_equal 10.0
end
end

it 'can get an iteration by number' do
VCR.use_cassette('get iteration by number', record: :new_episodes) do
iterations = project.iterations(number: 2)
Expand Down

0 comments on commit 29dcf96

Please sign in to comment.