Skip to content

Commit 8f0a63a

Browse files
committed
Changed endpoint url so we don't need to pass the project_id
1 parent 5f05370 commit 8f0a63a

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

lib/extracker/stories.ex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ defmodule ExTracker.Stories do
99
1010
ExTracker.Stories.find("12345", "67890", client)
1111
12-
More info at: https://www.pivotaltracker.com/help/api/rest/v5#Story
12+
More info at: https://www.pivotaltracker.com/help/api/rest/v5#stories_story_id_get
1313
"""
14-
@spec find(pos_integer, pos_integer, Client.t, [{atom, binary}] | []) :: ExTracker.Record.Story.t
15-
def find(project_id, story_id, client, params \\ []) do
16-
get("projects/#{project_id}/stories/#{story_id}", client, params)
14+
@spec find(pos_integer, Client.t, [{atom, binary}] | []) :: ExTracker.Record.Story.t
15+
def find(story_id, client, params \\ []) do
16+
get("stories/#{story_id}", client, params)
1717
|> ExTracker.Parser.parse_story
1818
end
1919

@@ -25,7 +25,7 @@ defmodule ExTracker.Stories do
2525
2626
ExTracker.Stories.list(client, project_id)
2727
28-
More info at:https://www.pivotaltracker.com/help/api/rest/v5#Stories
28+
More info at: https://www.pivotaltracker.com/help/api/rest/v5#Stories
2929
"""
3030
@spec list(Client.t, pos_integer, [{atom, binary}] | []) :: [ExTracker.Record.Story.t] | []
3131
def list(client, project_id, params \\ []) do

test/fixture/vcr_cassettes/stories#find.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"method": "get",
1010
"options": [],
1111
"request_body": "",
12-
"url": "https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66727974"
12+
"url": "https://www.pivotaltracker.com/services/v5/stories/66727974"
1313
},
1414
"response": {
1515
"body": "{\"kind\":\"story\",\"id\":66727974,\"created_at\":\"2014-02-10T00:00:00Z\",\"updated_at\":\"2014-03-02T07:11:04Z\",\"accepted_at\":\"2014-02-11T00:00:00Z\",\"story_type\":\"chore\",\"name\":\"Setup development environment\",\"description\":\"We need 2 machines set up\",\"current_state\":\"accepted\",\"requested_by_id\":1266314,\"url\":\"https://www.pivotaltracker.com/story/show/66727974\",\"project_id\":1027488,\"owner_ids\":[],\"labels\":[]}",
@@ -18,12 +18,12 @@
1818
"Transfer-Encoding": "chunked",
1919
"Status": "200 OK",
2020
"Cache-Control": "max-age=0, private, must-revalidate",
21-
"Date": "Mon, 29 Feb 2016 08:40:24 GMT",
21+
"Date": "Tue, 01 Mar 2016 06:04:50 GMT",
2222
"X-Tracker-Project-Version": "120",
23-
"X-Request-Id": "cd4b9d80941914b8b42b04d565766489",
23+
"X-Request-Id": "75bae1844699644e82d9257ef0a3a29f",
2424
"X-UA-Compatible": "IE=Edge,chrome=1",
2525
"ETag": "\"cb76acb351c88232bdc0a95c1ab73bc9\"",
26-
"X-Runtime": "0.052720",
26+
"X-Runtime": "0.056699",
2727
"X-Rack-Cache": "miss",
2828
"X-Powered-By": "Phusion Passenger Enterprise",
2929
"Server": "nginx + Phusion Passenger",

test/stories_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ defmodule ExTracker.StoriesTest do
1717
HTTPoison.start
1818
end
1919

20-
test "find/3" do
20+
test "find/2" do
2121
use_cassette "stories#find" do
22-
%Story{name: name} = find(@project_id, @story_id, @client)
22+
%Story{name: name} = find(@story_id, @client)
2323
assert name == "Setup development environment"
2424
end
2525
end

0 commit comments

Comments
 (0)