tracker_api 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7793fe2c2e8736d0a9ee554fe4235e5650972ec0
4
- data.tar.gz: 8d42a92f7700283678f2d9aa1dafcb4ef356f4dc
3
+ metadata.gz: f4d013c6228760ae953b8a63e8eb9bfb46491e82
4
+ data.tar.gz: c103f57b86db7418f2d2390ec1dc81ffbfcdacf6
5
5
  SHA512:
6
- metadata.gz: ecd29246f3c13ba882b16949070dc4c3dbffd3647610ab74445146486f4bb911b11187f7766d71f568e2b62b7fcf9d0352daf2fd4d3b36c2f869c048b97a7b2c
7
- data.tar.gz: a2cd38c0ee78666f65cdb1eaf03012b93bc1bf73c6d7dd49bc4df1e49d260926edfc35b2f37751064fde179c284586e6939487601961e03f6430df72ae9992ad
6
+ metadata.gz: 59f28333799be92a3e38edb8bdd5bd4f1cd113c781a21f653ab34673eadd3f1a325f55b09d6a3d9286a483b826ef2d8e1c833cae9e3b1adfb1dd7ba0a9a42565
7
+ data.tar.gz: 31d1d0096e0b79af497df676d0ae19d24fac653d7b529f8bd8a5505b8e02f49cdf503bb7eaa214709ab4b530f6c2eef3ca02dcd655d1ecac7071bb2e57d82382
@@ -113,6 +113,14 @@ module TrackerApi
113
113
  Endpoints::Me.new(self).get
114
114
  end
115
115
 
116
+ # Get information about a client story without knowing what project the story belongs to
117
+ #
118
+ # @param [String] story_id
119
+ # @return [TrackerApi::Resources::Story]
120
+ def story(story_id)
121
+ Endpoints::Story.new(self).get_story(story_id)
122
+ end
123
+
116
124
  private
117
125
 
118
126
  def parse_query_and_convenience_headers(path, options)
@@ -12,6 +12,12 @@ module TrackerApi
12
12
 
13
13
  Resources::Story.new({ client: client }.merge(data))
14
14
  end
15
+
16
+ def get_story(story_id)
17
+ data = client.get("/stories/#{story_id}").body
18
+
19
+ Resources::Story.new({ client: client }.merge(data))
20
+ end
15
21
  end
16
22
  end
17
23
  end
@@ -8,7 +8,7 @@ module TrackerApi
8
8
  attribute :accepted_at, DateTime
9
9
  attribute :comment_ids, Array[Integer]
10
10
  attribute :created_at, DateTime
11
- attribute :current_state, String # (accepted, delivered, finished, started, rejected, unstarted, unscheduled)
11
+ attribute :current_state, String # (accepted, delivered, finished, started, rejected, planned, unstarted, unscheduled)
12
12
  attribute :deadline, DateTime
13
13
  attribute :description, String
14
14
  attribute :estimate, Float
@@ -20,7 +20,8 @@ module TrackerApi
20
20
  attribute :label_ids, Array[Integer]
21
21
  attribute :labels, Array[TrackerApi::Resources::Label]
22
22
  attribute :name, String
23
- attribute :owned_by_id, Integer
23
+ attribute :owned_by_id, Integer # deprecated!
24
+ attribute :owners, Array[TrackerApi::Resources::Person]
24
25
  attribute :planned_iteration_number, Integer
25
26
  attribute :project_id, Integer
26
27
  attribute :requested_by_id, Integer
@@ -1,3 +1,3 @@
1
1
  module TrackerApi
2
- VERSION = '0.2.4'
2
+ VERSION = '0.2.5'
3
3
  end
@@ -112,4 +112,17 @@ describe TrackerApi::Client do
112
112
  end
113
113
  end
114
114
  end
115
+
116
+ describe '.story' do
117
+ let(:pt_user) { PT_USER_1 }
118
+ let(:client) { TrackerApi::Client.new token: pt_user[:token] }
119
+
120
+ it 'retrieves a story solely by story id' do
121
+ VCR.use_cassette('client: get single story by story id', record: :new_episodes) do
122
+ story = client.story('66728004')
123
+
124
+ story.must_be_instance_of TrackerApi::Resources::Story
125
+ end
126
+ end
127
+ end
115
128
  end
@@ -0,0 +1 @@
1
+ {"http_interactions":[{"request":{"method":"get","uri":"https://www.pivotaltracker.com/services/v5/stories/66728004","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Ruby/2.0.0 (x86_64-darwin13.0.0; ruby) TrackerApi/0.2.4 Faraday/0.8.9"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"]}},"response":{"status":{"code":200,"message":null},"headers":{"content-type":["application/json; charset=utf-8"],"transfer-encoding":["chunked"],"connection":["close"],"status":["200 OK"],"x-tracker-project-version":["4"],"x-ua-compatible":["IE=Edge,chrome=1"],"cache-control":["max-age=0, private, must-revalidate"],"x-request-id":["80de9c9217a4a7fd9721779ac9e01238"],"x-runtime":["0.038658"],"date":["Thu, 03 Jul 2014 13:45:50 GMT"],"x-rack-cache":["miss"],"x-powered-by":["Phusion Passenger 4.0.41"],"server":["nginx/1.6.0 + Phusion Passenger 4.0.41"],"access-control-allow-origin":["*"],"access-control-allow-credentials":["false"],"access-control-allow-methods":["GET, POST, PUT, DELETE, OPTIONS"],"access-control-allow-headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"]},"body":{"encoding":"UTF-8","string":"{\n \"kind\": \"story\",\n \"id\": 66728004,\n \"project_id\": 1027488,\n \"name\": \"Some product photos not scaled properly when browsing products\",\n \"story_type\": \"bug\",\n \"current_state\": \"started\",\n \"requested_by_id\": 1266314,\n \"owner_ids\": [\n\n ],\n \"labels\": [\n {\n \"kind\": \"label\",\n \"id\": 7849082,\n \"project_id\": 1027488,\n \"name\": \"shopping\",\n \"created_at\": \"2014-03-02T07:11:04Z\",\n \"updated_at\": \"2014-03-02T07:11:04Z\"\n }\n ],\n \"created_at\": \"2014-02-17T00:00:00Z\",\n \"updated_at\": \"2014-06-02T12:44:52Z\",\n \"url\": \"https://www.pivotaltracker.com/story/show/66728004\"\n}"},"http_version":null},"recorded_at":"Thu, 03 Jul 2014 13:45:52 GMT"}],"recorded_with":"VCR 2.9.2"}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracker_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Forest Carlisle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-22 00:00:00.000000000 Z
11
+ date: 2014-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -197,6 +197,7 @@ files:
197
197
  - test/story_test.rb
198
198
  - test/vcr/cassettes/client_done_iterations_with_pagination.json
199
199
  - test/vcr/cassettes/client_get_all_stories_with_pagination.json
200
+ - test/vcr/cassettes/client_get_single_story_by_story_id.json
200
201
  - test/vcr/cassettes/get_all_projects.json
201
202
  - test/vcr/cassettes/get_current_iteration.json
202
203
  - test/vcr/cassettes/get_done_iterations.json
@@ -238,6 +239,7 @@ test_files:
238
239
  - test/story_test.rb
239
240
  - test/vcr/cassettes/client_done_iterations_with_pagination.json
240
241
  - test/vcr/cassettes/client_get_all_stories_with_pagination.json
242
+ - test/vcr/cassettes/client_get_single_story_by_story_id.json
241
243
  - test/vcr/cassettes/get_all_projects.json
242
244
  - test/vcr/cassettes/get_current_iteration.json
243
245
  - test/vcr/cassettes/get_done_iterations.json