Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Bug: Cannot retrieve stories from an interation #71

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/pivotal-tracker/iteration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def all(project, options={})
params = PivotalTracker.encode_options(options)
parse(Client.connection["/projects/#{project.id}/iterations#{params}"].get)
end

def current(project)
array = parse(Client.connection["projects/#{project.id}/iterations/current"].get)
array.first if array
Expand All @@ -22,19 +22,19 @@ def backlog(project, options={})
params = PivotalTracker.encode_options(options)
parse(Client.connection["/projects/#{project.id}/iterations/backlog#{params}"].get)
end

def current_backlog(project, options={})
params = PivotalTracker.encode_options(options)
parse(Client.connection["/projects/#{project.id}/iterations/current_backlog#{params}"].get)
end
end
end

element :id, Integer
element :number, Integer
element :start, DateTime
element :finish, DateTime
element :team_strength, Float
has_many :stories, Story
has_many :stories, Story, :xpath => '//stories'

end
end
21 changes: 17 additions & 4 deletions spec/pivotal-tracker/iteration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
@iterations.first.should be_a(PivotalTracker::Iteration)
end
end

describe ".current_backlog" do
before do
@iterations = PivotalTracker::Iteration.current_backlog(@project)
Expand All @@ -59,18 +59,31 @@
@iterations.first.should be_a(PivotalTracker::Iteration)
end
end

describe ".team_strength" do
before do
@iteration = PivotalTracker::Iteration.current(@project)
end

it "should return a Float" do
@iteration.should respond_to(:team_strength)
@iteration.team_strength.should be_a(Float)
end
end


describe ".stories" do
before do
@iteration = PivotalTracker::Iteration.current(@project)
end

it "There should be 1 story in the current iteration" do
@iteration.stories.should be_a(Array)
@iteration.stories.length.should eq(1)
@iteration.stories.first.description.should eq("Generic description")
@iteration.stories.first.estimate.should eq (2)
end
end


end