ruby-trello 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/trello/association.rb +2 -2
- data/lib/trello/authorization.rb +15 -4
- data/lib/trello/basic_data.rb +1 -1
- data/lib/trello/card.rb +4 -3
- data/spec/action_spec.rb +21 -21
- data/spec/association_spec.rb +6 -6
- data/spec/basic_auth_policy_spec.rb +17 -17
- data/spec/board_spec.rb +2 -2
- data/spec/card_spec.rb +15 -9
- data/spec/checklist_spec.rb +1 -2
- data/spec/client_spec.rb +8 -10
- data/spec/configuration_spec.rb +18 -18
- data/spec/integration/how_to_authorize_spec.rb +1 -1
- data/spec/item_spec.rb +10 -10
- data/spec/list_spec.rb +33 -33
- data/spec/member_spec.rb +35 -35
- data/spec/oauth_policy_spec.rb +49 -49
- data/spec/organization_spec.rb +8 -8
- data/spec/spec_helper.rb +129 -130
- data/spec/string_spec.rb +7 -7
- data/spec/token_spec.rb +17 -17
- data/spec/trello_spec.rb +7 -7
- data/spec/webhook_spec.rb +1 -4
- metadata +13 -25
data/spec/token_spec.rb
CHANGED
@@ -4,46 +4,46 @@ module Trello
|
|
4
4
|
describe Token do
|
5
5
|
include Helpers
|
6
6
|
|
7
|
-
let(:token) { client.find(:token,
|
7
|
+
let(:token) { client.find(:token, '1234') }
|
8
8
|
let(:client) { Client.new }
|
9
9
|
|
10
10
|
before(:each) do
|
11
|
-
client.stub(:get).with(
|
11
|
+
client.stub(:get).with('/tokens/1234', {}).and_return token_payload
|
12
12
|
end
|
13
13
|
|
14
|
-
context
|
14
|
+
context 'finding' do
|
15
15
|
let(:client) { Trello.client }
|
16
16
|
|
17
|
-
it
|
17
|
+
it 'delegates to Trello.client#find' do
|
18
18
|
client.should_receive(:find).with(:token, '1234', {:webhooks => true})
|
19
19
|
Token.find('1234')
|
20
20
|
end
|
21
21
|
|
22
|
-
it
|
22
|
+
it 'is equivalent to client#find' do
|
23
23
|
Token.find('1234', {}).should eq(token)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
context
|
28
|
-
it
|
29
|
-
token.id.should ==
|
27
|
+
context 'attributes' do
|
28
|
+
it 'has an id' do
|
29
|
+
token.id.should == '4f2c10c7b3eb95a45b294cd5'
|
30
30
|
end
|
31
31
|
|
32
|
-
it
|
33
|
-
token.created_at.should == Time.iso8601(
|
32
|
+
it 'gets its created_at date' do
|
33
|
+
token.created_at.should == Time.iso8601('2012-02-03T16:52:23.661Z')
|
34
34
|
end
|
35
35
|
|
36
|
-
it
|
36
|
+
it 'has a permission grant' do
|
37
37
|
token.permissions.count.should be 3
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
context
|
42
|
-
it
|
43
|
-
client.stub(:get).with(
|
44
|
-
Trello.client.stub(:get).with(
|
45
|
-
client.stub(:get).with(
|
46
|
-
token.member.should == Member.find(
|
41
|
+
context 'members' do
|
42
|
+
it 'retrieves the member who authorized the token' do
|
43
|
+
client.stub(:get).with('/members/abcdef123456789123456789', {}).and_return user_payload
|
44
|
+
Trello.client.stub(:get).with('/members/abcdef123456789123456789', {}).and_return user_payload
|
45
|
+
client.stub(:get).with('/tokens/1234', {}).and_return token_payload
|
46
|
+
token.member.should == Member.find('abcdef123456789123456789')
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
data/spec/trello_spec.rb
CHANGED
@@ -5,8 +5,8 @@ include Trello::Authorization
|
|
5
5
|
|
6
6
|
describe Trello do
|
7
7
|
|
8
|
-
describe
|
9
|
-
it
|
8
|
+
describe 'self.configure' do
|
9
|
+
it 'builds auth policy client uses to make requests' do
|
10
10
|
Trello.configure do |config|
|
11
11
|
config.developer_public_key = 'developer_public_key'
|
12
12
|
config.member_token = 'member_token'
|
@@ -17,7 +17,7 @@ describe Trello do
|
|
17
17
|
Trello.client.get(:member, params = {})
|
18
18
|
end
|
19
19
|
|
20
|
-
it
|
20
|
+
it 'configures basic auth policy' do
|
21
21
|
Trello.configure do |config|
|
22
22
|
config.developer_public_key = 'developer_public_key'
|
23
23
|
config.member_token = 'member_token'
|
@@ -29,7 +29,7 @@ describe Trello do
|
|
29
29
|
auth_policy.member_token.should eq('member_token')
|
30
30
|
end
|
31
31
|
|
32
|
-
context
|
32
|
+
context 'oauth' do
|
33
33
|
before do
|
34
34
|
Trello.configure do |config|
|
35
35
|
config.consumer_key = 'consumer_key'
|
@@ -39,7 +39,7 @@ describe Trello do
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
it
|
42
|
+
it 'configures oauth policy' do
|
43
43
|
auth_policy = Trello.auth_policy
|
44
44
|
|
45
45
|
auth_policy.should be_a(OAuthPolicy)
|
@@ -49,7 +49,7 @@ describe Trello do
|
|
49
49
|
auth_policy.oauth_token_secret.should eq('oauth_token_secret')
|
50
50
|
end
|
51
51
|
|
52
|
-
it
|
52
|
+
it 'updates auth policy configuration' do
|
53
53
|
auth_policy = Trello.auth_policy
|
54
54
|
auth_policy.consumer_key.should eq('consumer_key')
|
55
55
|
|
@@ -70,7 +70,7 @@ describe Trello do
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
-
context
|
73
|
+
context 'not configured' do
|
74
74
|
before do
|
75
75
|
Trello.configure
|
76
76
|
end
|
data/spec/webhook_spec.rb
CHANGED
@@ -33,10 +33,7 @@ module Trello
|
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'creates a new webhook and saves it on Trello', :refactor => true do
|
36
|
-
payload = {
|
37
|
-
:name => 'Test Card',
|
38
|
-
:desc => nil,
|
39
|
-
}
|
36
|
+
payload = { :name => 'Test Card', :desc => nil }
|
40
37
|
|
41
38
|
webhook = webhooks_details.first
|
42
39
|
result = JSON.generate(webhook)
|
metadata
CHANGED
@@ -1,36 +1,32 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-trello
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
5
|
-
prerelease:
|
4
|
+
version: 1.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jeremy Tregunna
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-11-23 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: activemodel
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
19
|
+
version: 3.2.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
26
|
+
version: 3.2.0
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: addressable
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,23 +41,20 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: json
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - '>='
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: oauth
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ~>
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ~>
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -78,7 +69,6 @@ dependencies:
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: rest-client
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
73
|
- - ~>
|
84
74
|
- !ruby/object:Gem::Version
|
@@ -86,7 +76,6 @@ dependencies:
|
|
86
76
|
type: :runtime
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
80
|
- - ~>
|
92
81
|
- !ruby/object:Gem::Version
|
@@ -151,28 +140,27 @@ files:
|
|
151
140
|
homepage: https://github.com/jeremytregunna/ruby-trello
|
152
141
|
licenses:
|
153
142
|
- MIT
|
143
|
+
metadata: {}
|
154
144
|
post_install_message:
|
155
145
|
rdoc_options:
|
156
146
|
- --charset=UTF-8
|
157
147
|
require_paths:
|
158
148
|
- lib
|
159
149
|
required_ruby_version: !ruby/object:Gem::Requirement
|
160
|
-
none: false
|
161
150
|
requirements:
|
162
|
-
- -
|
151
|
+
- - '>='
|
163
152
|
- !ruby/object:Gem::Version
|
164
153
|
version: '0'
|
165
154
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
|
-
none: false
|
167
155
|
requirements:
|
168
|
-
- -
|
156
|
+
- - '>='
|
169
157
|
- !ruby/object:Gem::Version
|
170
158
|
version: 1.3.6
|
171
159
|
requirements: []
|
172
160
|
rubyforge_project: ruby-trello
|
173
|
-
rubygems_version:
|
161
|
+
rubygems_version: 2.0.3
|
174
162
|
signing_key:
|
175
|
-
specification_version:
|
163
|
+
specification_version: 4
|
176
164
|
summary: A wrapper around the trello.com API.
|
177
165
|
test_files:
|
178
166
|
- spec/action_spec.rb
|