Skip to content
This repository

Adds 2 new fields for projects #47

Merged
merged 9 commits into from over 2 years ago

3 participants

Ben Scheirman tomazy anuradha-r
Ben Scheirman

This adds:

  • first_iteration_start_time
  • current_iteration_number

To the PivotalTracker::Project class.

Changed the tests to reflect this, but stale_fish seems to be never updating the fixtures (everything is hard coded to be stale in spec_helper)

The fixtures were updated manually.

lib/pivotal-tracker/project.rb
@@ -22,13 +22,15 @@ def find(id)
22 22 element :week_start_day, String
23 23 element :point_scale, String
24 24 element :labels, String
25   - element :week_start_day, String
  25 + #element :week_start_day, String
3
tomazy
tomazy added a note

why?

Ben Scheirman
subdigital added a note

That line needs to be deleted :) -- It was a duplicate of line 22.

tomazy
tomazy added a note

Ok, so let's delete it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
spec/fixtures/stale_fish.yml
@@ -6,133 +6,133 @@
2
tomazy
tomazy added a note

please ignore this file when committing

Ben Scheirman
subdigital added a note

Got it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
spec/unit/pivotal-tracker/project_spec.rb
@@ -5,15 +5,28 @@
5 5 before do
6 6 PivotalTracker::Client.token = TOKEN
7 7 @projects = PivotalTracker::Project.all
  8 + @project = @projects.first
1
tomazy
tomazy added a note

the field doesn't seem to be used anywhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
spec/unit/pivotal-tracker/project_spec.rb
((5 lines not shown))
8 9 end
9 10
10 11 it "should return an array of available projects" do
11 12 @projects.should be_a(Array)
12 13 end
13 14
14   - it "should be a project instance" do
  15 + it "should be a project instance" do
1
tomazy
tomazy added a note

delete this change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
tomazy

@subdigital, @anuradha-r please update the pull request according to suggested changes

anuradha-r

@tomazy I think that should do it. Any other changes you'd like me to make?

spec/unit/pivotal-tracker/project_spec.rb
@@ -14,6 +14,17 @@
14 14 it "should be a project instance" do
15 15 @projects.first.should be_a(PivotalTracker::Project)
16 16 end
  17 +
  18 + it "should parse first_iteration_start_time" do
  19 + @projects.each do |pt|
  20 + pt.first_iteration_start_time.should_not be_nil
  21 + end
  22 + end
  23 + it "should parse field current_iteration_number" do
  24 + @projects.each do |pt|
  25 + pt.current_iteration_number.should_not be_nil
  26 + end
  27 + end
17 28 end
1
tomazy
tomazy added a note

@anuradha-r I think it would have more sense to move these tests to ".find" context and make them to look like:

it "should have first_iteration_start_time attribute" do
  @project.respond_to?(:first_iteration_start_time).should be_true
end 

as this is how we check for attributes in other parts of this file. Also separate tests by a blank line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
anuradha-r

@tomazy I moved those tests and also changed them as you suggested :)

tomazy tomazy merged commit 32d6c34 into from
tomazy tomazy closed this
tomazy

@anuradha-r, @subdigital - thanks :)

Ben Scheirman

Thanks for accepting!

anuradha-r

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
3  lib/pivotal-tracker/project.rb
@@ -22,13 +22,14 @@ def find(id)
22 22 element :week_start_day, String
23 23 element :point_scale, String
24 24 element :labels, String
25   - element :week_start_day, String
26 25 element :velocity_scheme, String
27 26 element :iteration_length, Integer
28 27 element :initial_velocity, Integer
29 28 element :current_velocity, Integer
30 29 element :last_activity_at, DateTime
31 30 element :use_https, Boolean
  31 + element :first_iteration_start_time, DateTime
  32 + element :current_iteration_number, Integer
32 33
33 34 def initialize(attributes={})
34 35 update_attributes(attributes)
2  spec/fixtures/project.xml
@@ -2,6 +2,8 @@
2 2 <project>
3 3 <id>102622</id>
4 4 <name>Pivotal Tracker API Gem</name>
  5 + <first_iteration_start_time type="datetime">2011/12/05 06:00:00 UTC</first_iteration_start_time>
  6 + <current_iteration_number type="integer">4</current_iteration_number>
5 7 <iteration_length type="integer">1</iteration_length>
6 8 <week_start_day>Monday</week_start_day>
7 9 <point_scale>0,1,2,3</point_scale>
4 spec/fixtures/projects.xml
@@ -5,6 +5,8 @@
5 5 <name>Pivotal Tracker API Gem</name>
6 6 <iteration_length type="integer">1</iteration_length>
7 7 <week_start_day>Monday</week_start_day>
  8 + <first_iteration_start_time type="datetime">2011/12/05 06:00:00 UTC</first_iteration_start_time>
  9 + <current_iteration_number type="integer">4</current_iteration_number>
8 10 <point_scale>0,1,2,3</point_scale>
9 11 <account>Jon</account>
10 12 <velocity_scheme>Average of 3 iterations</velocity_scheme>
@@ -55,6 +57,8 @@
55 57 <name>Pivotal Tracker API Gem Target Project</name>
56 58 <iteration_length type="integer">1</iteration_length>
57 59 <week_start_day>Monday</week_start_day>
  60 + <first_iteration_start_time type="datetime">2011/12/05 06:00:00 UTC</first_iteration_start_time>
  61 + <current_iteration_number type="integer">4</current_iteration_number>
58 62 <point_scale>0,1,2,3</point_scale>
59 63 <account>Jon</account>
60 64 <velocity_scheme>Average of 3 iterations</velocity_scheme>
10 spec/unit/pivotal-tracker/project_spec.rb
@@ -13,7 +13,7 @@
13 13
14 14 it "should be a project instance" do
15 15 @projects.first.should be_a(PivotalTracker::Project)
16   - end
  16 + end
17 17 end
18 18
19 19 context ".find" do
@@ -32,6 +32,14 @@
32 32 it "should have false for use_https" do
33 33 @project.use_https.should be_false
34 34 end
  35 +
  36 + it "should have first_iteration_start_time attribute" do
  37 + @project.respond_to?(:first_iteration_start_time).should be_true
  38 + end
  39 +
  40 + it "should have current_iteration_number attribute" do
  41 + @project.respond_to?(:current_iteration_number).should be_true
  42 + end
35 43 end
36 44
37 45 context ".stories" do

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.