trello_lead_time 0.1.7 → 0.1.9

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: 793a7111375f11cb1dac651497ddf9c28a5041a2
4
- data.tar.gz: 8d1be23dc738209bf82d6d5bd68be42dbdc1cce7
3
+ metadata.gz: 100178c3dcb0b5bd52f4a5a64bc683472c849662
4
+ data.tar.gz: 71b84e248556f0cfebae87f85e1aeb50d70bfc3b
5
5
  SHA512:
6
- metadata.gz: 6bcbc2ffb7825461fc3b9271feb11c99d47155f604f71264841c5358cd57835560f56ebd16accafc2750d986d171bb4d719a92174c8c00f0e0379d07a25326d3
7
- data.tar.gz: 821d941a6d4865f9833ccec0682479301a674ede27766f5a059ff6cb50bcfd25fd561b9bca1360eca285e204268d0ab090a950feaad20eeb1bbdf9feacabb1af
6
+ metadata.gz: 9f967a9bd0757af27024af72bcf89a067082cab198d5bd93024739d09fad937b9fd756d16e1b4fce3091b4a21a4e64e2f0e900c0618f4f2961e89cc37fd9eccd
7
+ data.tar.gz: effe775e668e04744394dd076bc33dced219de0321e2b2a786b35a8e4d935c1fe001e0f9164f473bb6a31f795fc5697e1c2576a369b3fcd67947d7c3c690f3a1
@@ -23,7 +23,7 @@ module TrelloLeadTime
23
23
 
24
24
  def cards(name_of_list_with_done_cards)
25
25
  list = find_list_by_name(name_of_list_with_done_cards)
26
- response = default_format
26
+ response = []
27
27
  return response if list.nil?
28
28
  list.done_or_closed_cards
29
29
  end
@@ -13,6 +13,10 @@ module TrelloLeadTime
13
13
  @trello_card.name
14
14
  end
15
15
 
16
+ def short_url
17
+ @trello_card.short_url
18
+ end
19
+
16
20
  def done?
17
21
  @timeline.done?
18
22
  end
@@ -1,3 +1,3 @@
1
1
  module TrelloLeadTime
2
- VERSION = '0.1.7'
2
+ VERSION = '0.1.9'
3
3
  end
@@ -0,0 +1,10 @@
1
+ [
2
+ {
3
+ "id": "mylist_id",
4
+ "name": "Accepted for 2014-03"
5
+ },
6
+ {
7
+ "id": "44444444444",
8
+ "name": "Refining"
9
+ }
10
+ ]
@@ -11,6 +11,7 @@ describe TrelloLeadTime::Board do
11
11
  let(:board_id) { "myboard_id" }
12
12
  let(:board_name) { "Development Team" }
13
13
  let(:list_with_done_cards) { "Done for 2014-03" }
14
+ let(:list_not_found_on_board) { "Not a real list" }
14
15
  let(:list_id) { "mylist_id" }
15
16
  let(:card_id) { "mycard_id" }
16
17
 
@@ -26,6 +27,10 @@ describe TrelloLeadTime::Board do
26
27
  File.read(File.expand_path("../../../fixtures/lists.json", __FILE__))
27
28
  }
28
29
 
30
+ let(:missing_lists_json) {
31
+ File.read(File.expand_path("../../../fixtures/missing_lists.json", __FILE__))
32
+ }
33
+
29
34
  let(:cards_json) {
30
35
  File.read(File.expand_path("../../../fixtures/cards.json", __FILE__))
31
36
  }
@@ -63,7 +68,11 @@ describe TrelloLeadTime::Board do
63
68
  it "should have some cards" do
64
69
  stub_all_requests
65
70
  expect(subject.cards(list_with_done_cards).length).to eq(4)
66
- puts subject.cards(list_with_done_cards)[0].cycle_time
71
+ end
72
+
73
+ it "should default an empty list of cards when list is not found" do
74
+ stub_all_requests_missing_list
75
+ expect(subject.cards(list_not_found_on_board).length).to eq(0)
67
76
  end
68
77
  end
69
78
 
@@ -203,6 +212,11 @@ describe TrelloLeadTime::Board do
203
212
  stub_card_requests
204
213
  end
205
214
 
215
+ def stub_all_requests_missing_list
216
+ stub_board_requests
217
+ stub_missing_list_requests
218
+ end
219
+
206
220
  def stub_board_requests
207
221
  stub_request(:get, "https://api.trello.com/1/organizations/wellmatch?key=#{key}&token=#{token}").
208
222
  with(headers).
@@ -223,6 +237,12 @@ describe TrelloLeadTime::Board do
223
237
  to_return(stub_returns(cards_json))
224
238
  end
225
239
 
240
+ def stub_missing_list_requests
241
+ stub_request(:get, "https://api.trello.com/1/boards/#{board_id}/lists?filter=all&key=#{key}&token=#{token}").
242
+ with(headers).
243
+ to_return(stub_returns(missing_lists_json))
244
+ end
245
+
226
246
  def stub_card_requests
227
247
  %w{1111 2222 3333 4444}.each do |card_id|
228
248
  stub_request(:get, "https://api.trello.com/1/cards/#{card_id}/actions?filter=copyCard,moveCardToBoard,createCard,updateCard:idList,updateCard:closed&key=#{key}&token=#{token}").
@@ -37,6 +37,12 @@ describe TrelloLeadTime::Card do
37
37
  to_return(:status => 200, :body => comments_json, :headers => {})
38
38
  }
39
39
 
40
+ describe "#short_url" do
41
+ it "should have a url" do
42
+ expect(subject.short_url).to_not be_nil
43
+ end
44
+ end
45
+
40
46
  describe ".done" do
41
47
  it "should be a card" do
42
48
  subject.should be_an_instance_of(TrelloLeadTime::Card)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trello_lead_time
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Baldwin
@@ -100,6 +100,7 @@ files:
100
100
  - spec/fixtures/labels.4444.json
101
101
  - spec/fixtures/labels.json
102
102
  - spec/fixtures/lists.json
103
+ - spec/fixtures/missing_lists.json
103
104
  - spec/fixtures/organization.json
104
105
  - spec/lib/trello_lead_time/array_matcher_spec.rb
105
106
  - spec/lib/trello_lead_time/board_spec.rb
@@ -156,6 +157,7 @@ test_files:
156
157
  - spec/fixtures/labels.4444.json
157
158
  - spec/fixtures/labels.json
158
159
  - spec/fixtures/lists.json
160
+ - spec/fixtures/missing_lists.json
159
161
  - spec/fixtures/organization.json
160
162
  - spec/lib/trello_lead_time/array_matcher_spec.rb
161
163
  - spec/lib/trello_lead_time/board_spec.rb