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 +4 -4
- data/lib/tracker_api/client.rb +8 -0
- data/lib/tracker_api/endpoints/story.rb +6 -0
- data/lib/tracker_api/resources/story.rb +3 -2
- data/lib/tracker_api/version.rb +1 -1
- data/test/client_test.rb +13 -0
- data/test/vcr/cassettes/client_get_single_story_by_story_id.json +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4d013c6228760ae953b8a63e8eb9bfb46491e82
|
4
|
+
data.tar.gz: c103f57b86db7418f2d2390ec1dc81ffbfcdacf6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59f28333799be92a3e38edb8bdd5bd4f1cd113c781a21f653ab34673eadd3f1a325f55b09d6a3d9286a483b826ef2d8e1c833cae9e3b1adfb1dd7ba0a9a42565
|
7
|
+
data.tar.gz: 31d1d0096e0b79af497df676d0ae19d24fac653d7b529f8bd8a5505b8e02f49cdf503bb7eaa214709ab4b530f6c2eef3ca02dcd655d1ecac7071bb2e57d82382
|
data/lib/tracker_api/client.rb
CHANGED
@@ -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)
|
@@ -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
|
data/lib/tracker_api/version.rb
CHANGED
data/test/client_test.rb
CHANGED
@@ -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
|
+
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-
|
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
|