ruby-trello 0.4.4.3 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/spec/card_spec.rb CHANGED
@@ -4,14 +4,30 @@ module Trello
4
4
  describe Card do
5
5
  include Helpers
6
6
 
7
+ let(:card) { client.find(:card, 'abcdef123456789123456789') }
8
+ let(:client) { Client.new }
9
+
7
10
  before(:each) do
8
- Client.stub(:get).with("/cards/abcdef123456789123456789").
11
+ client.stub(:get).with("/cards/abcdef123456789123456789").
9
12
  and_return JSON.generate(cards_details.first)
13
+ end
14
+
15
+ context "finding" do
16
+ let(:client) { Trello.client }
17
+
18
+ it "delegates to Trello.client#find" do
19
+ client.should_receive(:find).with(:card, 'abcdef123456789123456789')
20
+ Card.find('abcdef123456789123456789')
21
+ end
10
22
 
11
- @card = Card.find('abcdef123456789123456789')
23
+ it "is equivalent to client#find" do
24
+ Card.find('abcdef123456789123456789').should eq(card)
25
+ end
12
26
  end
13
27
 
14
28
  context "creating" do
29
+ let(:client) { Trello.client }
30
+
15
31
  it "creates a new record" do
16
32
  card = Card.new(cards_details.first)
17
33
  card.should be_valid
@@ -37,7 +53,7 @@ module Trello
37
53
 
38
54
  expected_payload = {:name => "Test Card", :desc => nil, :idList => "abcdef123456789123456789"}
39
55
 
40
- Client.should_receive(:post).with("/cards", expected_payload).and_return result
56
+ client.should_receive(:post).with("/cards", expected_payload).and_return result
41
57
 
42
58
  card = Card.create(cards_details.first.merge(payload.merge(:list_id => lists_details.first['id'])))
43
59
 
@@ -51,110 +67,123 @@ module Trello
51
67
 
52
68
  payload = {
53
69
  :name => expected_new_name,
54
- :desc => "Awesome things are awesome.",
55
- :due => nil,
56
- :closed => false,
57
- :idList => "abcdef123456789123456789",
58
- :idBoard => "abcdef123456789123456789",
59
- :idMembers => ["abcdef123456789123456789"],
60
- :pos => 12
61
70
  }
62
71
 
63
- Client.should_receive(:put).once.with("/cards/abcdef123456789123456789", payload)
64
- card = @card.dup
72
+ client.should_receive(:put).once.with("/cards/abcdef123456789123456789", payload)
73
+
65
74
  card.name = expected_new_name
66
75
  card.save
67
76
  end
68
77
  end
69
78
 
79
+ context "deleting" do
80
+ it "allows a member to be removed from a card" do
81
+ client.should_receive(:delete).with("/cards/#{card.id}")
82
+ card.delete
83
+ end
84
+ end
85
+
70
86
  context "fields" do
71
87
  it "gets its id" do
72
- @card.id.should_not be_nil
88
+ card.id.should_not be_nil
73
89
  end
74
90
 
75
91
  it "gets its short id" do
76
- @card.short_id.should_not be_nil
92
+ card.short_id.should_not be_nil
77
93
  end
78
94
 
79
95
  it "gets its name" do
80
- @card.name.should_not be_nil
96
+ card.name.should_not be_nil
81
97
  end
82
98
 
83
99
  it "gets its description" do
84
- @card.description.should_not be_nil
100
+ card.description.should_not be_nil
85
101
  end
86
102
 
87
103
  it "knows if it is open or closed" do
88
- @card.closed.should_not be_nil
104
+ card.closed.should_not be_nil
89
105
  end
90
106
 
91
107
  it "gets its url" do
92
- @card.url.should_not be_nil
108
+ card.url.should_not be_nil
93
109
  end
94
110
  end
95
111
 
96
112
  context "actions" do
97
113
  it "asks for all actions by default" do
98
- Client.stub(:get).with("/cards/abcdef123456789123456789/actions", { :filter => :all }).and_return actions_payload
99
- @card.actions.count.should be > 0
114
+ client.stub(:get).with("/cards/abcdef123456789123456789/actions", { :filter => :all }).and_return actions_payload
115
+ card.actions.count.should be > 0
100
116
  end
101
117
 
102
118
  it "allows overriding the filter" do
103
- Client.stub(:get).with("/cards/abcdef123456789123456789/actions", { :filter => :updateCard }).and_return actions_payload
104
- @card.actions(:filter => :updateCard).count.should be > 0
119
+ client.stub(:get).with("/cards/abcdef123456789123456789/actions", { :filter => :updateCard }).and_return actions_payload
120
+ card.actions(:filter => :updateCard).count.should be > 0
105
121
  end
106
122
  end
107
123
 
108
124
  context "boards" do
109
125
  it "has a board" do
110
- Client.stub(:get).with("/boards/abcdef123456789123456789").and_return JSON.generate(boards_details.first)
111
- @card.board.should_not be_nil
126
+ client.stub(:get).with("/boards/abcdef123456789123456789").and_return JSON.generate(boards_details.first)
127
+ card.board.should_not be_nil
112
128
  end
113
129
  end
114
130
 
115
131
  context "checklists" do
116
132
  it "has a list of checklists" do
117
- Client.stub(:get).with("/cards/abcdef123456789123456789/checklists", { :filter => :all }).and_return checklists_payload
118
- @card.checklists.count.should be > 0
133
+ client.stub(:get).with("/cards/abcdef123456789123456789/checklists", { :filter => :all }).and_return checklists_payload
134
+ card.checklists.count.should be > 0
119
135
  end
120
136
  end
121
137
 
122
138
  context "list" do
123
139
  it 'has a list' do
124
- Client.stub(:get).with("/lists/abcdef123456789123456789").and_return JSON.generate(lists_details.first)
125
- @card.list.should_not be_nil
140
+ client.stub(:get).with("/lists/abcdef123456789123456789").and_return JSON.generate(lists_details.first)
141
+ card.list.should_not be_nil
126
142
  end
127
143
 
128
144
  it 'can be moved to another list' do
129
145
  other_list = stub(:id => '987654321987654321fedcba')
130
146
  payload = {:value => other_list.id}
131
- Client.should_receive(:put).with("/cards/abcdef123456789123456789/idList", payload)
132
- @card.move_to_list(other_list)
147
+ client.should_receive(:put).with("/cards/abcdef123456789123456789/idList", payload)
148
+ card.move_to_list(other_list)
149
+ end
150
+
151
+ it 'should not be moved if new list is identical to old list' do
152
+ other_list = stub(:id => 'abcdef123456789123456789')
153
+ payload = {:value => other_list.id}
154
+ client.should_not_receive(:put)
155
+ card.move_to_list(other_list)
133
156
  end
134
157
 
135
158
  it 'can be moved to another board' do
136
159
  other_board = stub(:id => '987654321987654321fedcba')
137
160
  payload = {:value => other_board.id}
138
- Client.should_receive(:put).with("/cards/abcdef123456789123456789/idBoard", payload)
139
- @card.move_to_board(other_board)
161
+ client.should_receive(:put).with("/cards/abcdef123456789123456789/idBoard", payload)
162
+ card.move_to_board(other_board)
140
163
  end
141
164
 
142
165
  it 'can be moved to a list on another board' do
143
166
  other_board = stub(:id => '987654321987654321fedcba')
144
167
  other_list = stub(:id => '987654321987654321aalist')
145
168
  payload = {:value => other_board.id, :idList => other_list.id}
146
- Client.should_receive(:put).with("/cards/abcdef123456789123456789/idBoard", payload)
147
- @card.move_to_board(other_board, other_list)
169
+ client.should_receive(:put).with("/cards/abcdef123456789123456789/idBoard", payload)
170
+ card.move_to_board(other_board, other_list)
171
+ end
172
+
173
+ it 'should not be moved if new board is identical with old board', :focus => true do
174
+ other_board = stub(:id => 'abcdef123456789123456789')
175
+ client.should_not_receive(:put)
176
+ card.move_to_board(other_board)
148
177
  end
149
178
  end
150
179
 
151
180
  context "members" do
152
181
  it "has a list of members" do
153
- Client.stub(:get).with("/boards/abcdef123456789123456789").and_return JSON.generate(boards_details.first)
154
- Client.stub(:get).with("/members/abcdef123456789123456789").and_return user_payload
182
+ client.stub(:get).with("/boards/abcdef123456789123456789").and_return JSON.generate(boards_details.first)
183
+ client.stub(:get).with("/members/abcdef123456789123456789").and_return user_payload
155
184
 
156
- @card.board.should_not be_nil
157
- @card.members.should_not be_nil
185
+ card.board.should_not be_nil
186
+ card.members.should_not be_nil
158
187
  end
159
188
 
160
189
  it "allows a member to be added to a card" do
@@ -162,32 +191,32 @@ module Trello
162
191
  payload = {
163
192
  :value => new_member.id
164
193
  }
165
- Client.should_receive(:post).with("/cards/abcdef123456789123456789/members", payload)
166
- @card.add_member(new_member)
194
+ client.should_receive(:post).with("/cards/abcdef123456789123456789/members", payload)
195
+ card.add_member(new_member)
167
196
  end
168
197
 
169
198
  it "allows a member to be removed from a card" do
170
199
  existing_member = stub(:id => '4ee7df3ce582acdec80000b2')
171
- Client.should_receive(:delete).with("/cards/abcdef123456789123456789/members/#{existing_member.id}")
172
- @card.remove_member(existing_member)
200
+ client.should_receive(:delete).with("/cards/abcdef123456789123456789/members/#{existing_member.id}")
201
+ card.remove_member(existing_member)
173
202
  end
174
203
  end
175
204
 
176
205
  context "comments" do
177
206
  it "posts a comment" do
178
- Client.should_receive(:post).
207
+ client.should_receive(:post).
179
208
  with("/cards/abcdef123456789123456789/actions/comments", { :text => 'testing' }).
180
209
  and_return JSON.generate(boards_details.first)
181
210
 
182
- @card.add_comment "testing"
211
+ card.add_comment "testing"
183
212
  end
184
213
  end
185
214
 
186
215
  context "labels" do
187
216
  it "can retrieve labels" do
188
- Client.stub(:get).with("/cards/abcdef123456789123456789/labels").
217
+ client.stub(:get).with("/cards/abcdef123456789123456789/labels").
189
218
  and_return label_payload
190
- labels = @card.labels
219
+ labels = card.labels
191
220
  labels.size.should == 2
192
221
 
193
222
  labels[0].color.should == 'yellow'
@@ -198,94 +227,87 @@ module Trello
198
227
  end
199
228
 
200
229
  it "can add a label" do
201
- Client.stub(:post).with("/cards/abcdef123456789123456789/labels", { :value => 'green' }).
230
+ client.stub(:post).with("/cards/abcdef123456789123456789/labels", { :value => 'green' }).
202
231
  and_return "not important"
203
- @card.add_label('green')
204
- @card.errors.should be_empty
232
+ card.add_label('green')
233
+ card.errors.should be_empty
205
234
  end
206
235
 
207
236
  it "can remove a label" do
208
- Client.stub(:delete).with("/cards/abcdef123456789123456789/labels/green").
237
+ client.stub(:delete).with("/cards/abcdef123456789123456789/labels/green").
209
238
  and_return "not important"
210
- @card.remove_label('green')
211
- @card.errors.should be_empty
239
+ card.remove_label('green')
240
+ card.errors.should be_empty
212
241
  end
213
242
 
214
243
  it "throws an error when trying to add a label with an unknown colour" do
215
- Client.stub(:post).with("/cards/abcdef123456789123456789/labels", { :value => 'green' }).
244
+ client.stub(:post).with("/cards/abcdef123456789123456789/labels", { :value => 'green' }).
216
245
  and_return "not important"
217
- @card.add_label('mauve')
218
- @card.errors.full_messages.to_sentence.should == "Label colour 'mauve' does not exist"
246
+ card.add_label('mauve')
247
+ card.errors.full_messages.to_sentence.should == "Label colour 'mauve' does not exist"
219
248
  end
220
249
 
221
250
  it "throws an error when trying to remove a label with an unknown colour" do
222
- Client.stub(:delete).with("/cards/abcdef123456789123456789/labels/mauve").
251
+ client.stub(:delete).with("/cards/abcdef123456789123456789/labels/mauve").
223
252
  and_return "not important"
224
- @card.remove_label('mauve')
225
- @card.errors.full_messages.to_sentence.should == "Label colour 'mauve' does not exist"
253
+ card.remove_label('mauve')
254
+ card.errors.full_messages.to_sentence.should == "Label colour 'mauve' does not exist"
226
255
  end
227
256
  end
228
257
 
229
258
  context "attachments" do
230
259
  it "can add an attachment" do
231
260
  f = File.new('spec/list_spec.rb', 'r')
232
- Client.stub(:get).with("/cards/abcdef123456789123456789/attachments").and_return attachments_payload
233
- Client.stub(:post).with("/cards/abcdef123456789123456789/attachments",
261
+ client.stub(:get).with("/cards/abcdef123456789123456789/attachments").and_return attachments_payload
262
+ client.stub(:post).with("/cards/abcdef123456789123456789/attachments",
234
263
  { :file => f, :name => '' }).
235
264
  and_return "not important"
236
265
 
237
- @card.add_attachment(f)
266
+ card.add_attachment(f)
238
267
 
239
- @card.errors.should be_empty
268
+ card.errors.should be_empty
240
269
  end
241
270
 
242
271
  it "can list the existing attachments" do
243
- Client.stub(:get).with("/boards/abcdef123456789123456789").and_return JSON.generate(boards_details.first)
244
- Client.stub(:get).with("/cards/abcdef123456789123456789/attachments").and_return attachments_payload
272
+ client.stub(:get).with("/boards/abcdef123456789123456789").and_return JSON.generate(boards_details.first)
273
+ client.stub(:get).with("/cards/abcdef123456789123456789/attachments").and_return attachments_payload
245
274
 
246
- @card.board.should_not be_nil
247
- @card.attachments.should_not be_nil
275
+ card.board.should_not be_nil
276
+ card.attachments.should_not be_nil
248
277
  end
249
278
 
250
279
  it "can remove an attachment" do
251
- Client.stub(:delete).with("/cards/abcdef123456789123456789/attachments/abcdef123456789123456789").
280
+ client.stub(:delete).with("/cards/abcdef123456789123456789/attachments/abcdef123456789123456789").
252
281
  and_return "not important"
253
- Client.stub(:get).with("/cards/abcdef123456789123456789/attachments").and_return attachments_payload
282
+ client.stub(:get).with("/cards/abcdef123456789123456789/attachments").and_return attachments_payload
254
283
 
255
- @card.remove_attachment(@card.attachments.first)
256
- @card.errors.should be_empty
284
+ card.remove_attachment(card.attachments.first)
285
+ card.errors.should be_empty
257
286
  end
258
287
  end
259
288
 
260
289
  describe "#closed?" do
261
290
  it "returns the closed attribute" do
262
- @card.closed?.should_not be_true
291
+ card.closed?.should_not be_true
263
292
  end
264
293
  end
265
294
 
266
295
  describe "#close" do
267
296
  it "updates the close attribute to true" do
268
- @card.close
269
- @card.closed.should be_true
297
+ card.close
298
+ card.closed.should be_true
270
299
  end
271
300
  end
272
301
 
273
302
  describe "#close!" do
274
303
  it "updates the close attribute to true and saves the list" do
275
304
  payload = {
276
- :name => @card.name,
277
- :desc => "Awesome things are awesome.",
278
- :due => nil,
279
305
  :closed => true,
280
- :idList => "abcdef123456789123456789",
281
- :idBoard => "abcdef123456789123456789",
282
- :idMembers => ["abcdef123456789123456789"],
283
- :pos => 12
284
306
  }
285
307
 
286
- Client.should_receive(:put).once.with("/cards/abcdef123456789123456789", payload)
308
+ client.should_receive(:put).once.with("/cards/abcdef123456789123456789", payload)
287
309
 
288
- @card.close!
310
+ card.close!
289
311
  end
290
312
  end
291
313
 
@@ -4,14 +4,30 @@ module Trello
4
4
  describe Checklist do
5
5
  include Helpers
6
6
 
7
+ let(:checklist) { client.find(:checklist, 'abcdef123456789123456789') }
8
+ let(:client) { Client.new }
9
+
7
10
  before(:each) do
8
- Client.stub(:get).with("/checklists/abcdef123456789123456789").
11
+ client.stub(:get).with("/checklists/abcdef123456789123456789").
9
12
  and_return JSON.generate(checklists_details.first)
13
+ end
10
14
 
11
- @checklist = Checklist.find('abcdef123456789123456789')
15
+ context "finding" do
16
+ let(:client) { Trello.client }
17
+
18
+ it "delegates to Trello.client#find" do
19
+ client.should_receive(:find).with(:checklist, 'abcdef123456789123456789')
20
+ Checklist.find('abcdef123456789123456789')
21
+ end
22
+
23
+ it "is equivalent to client#find" do
24
+ Checklist.find('abcdef123456789123456789').should eq(checklist)
25
+ end
12
26
  end
13
27
 
14
28
  context "creating" do
29
+ let(:client) { Trello.client }
30
+
15
31
  it 'creates a new record and saves it on Trello', :refactor => true do
16
32
  payload = {
17
33
  :name => 'Test Checklist',
@@ -22,7 +38,7 @@ module Trello
22
38
 
23
39
  expected_payload = {:name => "Test Checklist", :idBoard => "abcdef123456789123456789"}
24
40
 
25
- Client.should_receive(:post).with("/checklists", expected_payload).and_return result
41
+ client.should_receive(:post).with("/checklists", expected_payload).and_return result
26
42
 
27
43
  checklist = Checklist.create(checklists_details.first.merge(payload.merge(:board_id => boards_details.first['id'])))
28
44
 
@@ -33,18 +49,31 @@ module Trello
33
49
  context "updating" do
34
50
  it "updating name does a put on the correct resource with the correct value" do
35
51
  expected_new_name = "xxx"
36
- expected_resource = "/checklists/#{@checklist.id}"
52
+ expected_resource = "/checklists/abcdef123456789123456789"
37
53
  payload = {
38
54
  :name => expected_new_name
39
55
  }
40
56
 
41
57
  result = JSON.generate(checklists_details.first)
42
- Client.should_receive(:put).once.with("/checklists/abcdef123456789123456789", payload).and_return result
43
- checklist = @checklist.dup
58
+ client.should_receive(:put).once.with("/checklists/abcdef123456789123456789", payload).and_return result
59
+
44
60
  checklist.name = expected_new_name
45
61
  checklist.save
46
62
  end
47
63
  end
48
64
 
65
+ context "board" do
66
+ it "has a board" do
67
+ client.stub(:get).with("/boards/abcdef123456789123456789").and_return JSON.generate(boards_details.first)
68
+ checklist.board.should_not be_nil
69
+ end
70
+ end
71
+
72
+ context "list" do
73
+ it 'has a list' do
74
+ client.stub(:get).with("/lists/abcdef123456789123456789").and_return JSON.generate(lists_details.first)
75
+ checklist.list.should_not be_nil
76
+ end
77
+ end
49
78
  end
50
79
  end
data/spec/client_spec.rb CHANGED
@@ -9,19 +9,22 @@ describe Client, "and how it handles authorization" do
9
9
  :code => 200,
10
10
  :body => "A fake response body"
11
11
  }
12
-
12
+ let(:client) { Client.new }
13
+ let(:auth_policy) { stub }
14
+
13
15
  before do
14
16
  TInternet.stub(:execute).and_return fake_ok_response
15
- Authorization::AuthPolicy.stub(:authorize) do |request|
17
+ Authorization::AuthPolicy.stub(:new).and_return(auth_policy)
18
+ auth_policy.stub(:authorize) do |request|
16
19
  request
17
20
  end
18
21
  end
19
22
 
20
23
  it "authorizes before it queries the internet" do
21
- AuthPolicy.should_receive(:authorize).once.ordered
24
+ auth_policy.should_receive(:authorize).once.ordered
22
25
  TInternet.should_receive(:execute).once.ordered
23
26
 
24
- Client.get "/xxx"
27
+ client.get "/xxx"
25
28
  end
26
29
 
27
30
  it "queries the internet with expanded earl and query parameters" do
@@ -30,7 +33,7 @@ describe Client, "and how it handles authorization" do
30
33
 
31
34
  TInternet.should_receive(:execute).once.with expected_request
32
35
 
33
- Client.get "/xxx", :a => "1", :b => "2"
36
+ client.get "/xxx", :a => "1", :b => "2"
34
37
  end
35
38
 
36
39
  it "encodes parameters" do
@@ -39,42 +42,42 @@ describe Client, "and how it handles authorization" do
39
42
 
40
43
  TInternet.should_receive(:execute).once.with expected_request
41
44
 
42
- Client.get "/xxx", :name => "Jazz Kang"
45
+ client.get "/xxx", :name => "Jazz Kang"
43
46
  end
44
47
 
45
48
  it "raises an error when response has non-200 status" do
46
49
  expected_error_message = "An error response"
47
- response_with_non_200_status = stub "A fake OK response",
50
+ response_with_non_200_status = stub "A fake OK response",
48
51
  :code => 404,
49
52
  :body => expected_error_message
50
53
 
51
54
  TInternet.stub(:execute).and_return response_with_non_200_status
52
55
 
53
- lambda{Client.get "/xxx"}.should raise_error expected_error_message
56
+ lambda{client.get "/xxx"}.should raise_error expected_error_message
54
57
  end
55
58
 
56
59
  it "uses version 1 of the API" do
57
60
  TInternet.should_receive(:execute).once do |request|
58
61
  request.uri.to_s.should =~ /1\//
59
62
  fake_ok_response
60
- end
63
+ end
61
64
 
62
- Client.get "/"
63
- end
65
+ client.get "/"
66
+ end
64
67
 
65
68
  it "omits the \"?\" when no parameters" do
66
69
  TInternet.should_receive(:execute).once do |request|
67
70
  request.uri.to_s.should_not =~ /\?$/
68
71
  fake_ok_response
69
- end
72
+ end
70
73
 
71
- Client.get "/xxx"
74
+ client.get "/xxx"
72
75
  end
73
76
 
74
77
  it "supports post" do
75
78
  TInternet.should_receive(:execute).once.and_return fake_ok_response
76
79
 
77
- Client.post "/xxx", { :phil => "T' north" }
80
+ client.post "/xxx", { :phil => "T' north" }
78
81
  end
79
82
 
80
83
  it "supplies the body for a post" do
@@ -85,7 +88,7 @@ describe Client, "and how it handles authorization" do
85
88
  fake_ok_response
86
89
  end
87
90
 
88
- Client.post "/xxx", expected_body
91
+ client.post "/xxx", expected_body
89
92
  end
90
93
 
91
94
  it "supplies the path for a post" do
@@ -96,7 +99,7 @@ describe Client, "and how it handles authorization" do
96
99
  fake_ok_response
97
100
  end
98
101
 
99
- Client.post "/xxx", {}
102
+ client.post "/xxx", {}
100
103
  end
101
104
 
102
105
  it "supports put" do
@@ -104,7 +107,7 @@ describe Client, "and how it handles authorization" do
104
107
 
105
108
  TInternet.should_receive(:execute).once.and_return fake_ok_response
106
109
 
107
- Client.put "/xxx", { :phil => "T' north" }
110
+ client.put "/xxx", { :phil => "T' north" }
108
111
  end
109
112
 
110
113
  it "supplies the body for a put" do
@@ -115,7 +118,7 @@ describe Client, "and how it handles authorization" do
115
118
  fake_ok_response
116
119
  end
117
120
 
118
- Client.put "/xxx", expected_body
121
+ client.put "/xxx", expected_body
119
122
  end
120
123
 
121
124
  it "supplies the path for a put" do
@@ -126,6 +129,40 @@ describe Client, "and how it handles authorization" do
126
129
  fake_ok_response
127
130
  end
128
131
 
129
- Client.put "/xxx", {}
132
+ client.put "/xxx", {}
133
+ end
134
+
135
+ context "initialize" do
136
+ let(:client) {
137
+ Client.new(
138
+ :consumer_key => 'consumer_key',
139
+ :consumer_secret => 'consumer_secret',
140
+ :oauth_token => 'oauth_token',
141
+ :oauth_token_secret => 'oauth_token_secret'
142
+ )
143
+ }
144
+
145
+ it "is configurable" do
146
+ client.consumer_key.should eq('consumer_key')
147
+ client.consumer_secret.should eq('consumer_secret')
148
+ client.oauth_token.should eq('oauth_token')
149
+ client.oauth_token_secret.should eq('oauth_token_secret')
150
+ end
151
+ end
152
+
153
+ describe "configure" do
154
+ it "sets key attributes through config block" do
155
+ client.configure do |config|
156
+ config.consumer_key = 'consumer_key'
157
+ config.consumer_secret = 'consumer_secret'
158
+ config.oauth_token = 'oauth_token'
159
+ config.oauth_token_secret = 'oauth_token_secret'
160
+ end
161
+
162
+ client.consumer_key.should eq('consumer_key')
163
+ client.consumer_secret.should eq('consumer_secret')
164
+ client.oauth_token.should eq('oauth_token')
165
+ client.oauth_token_secret.should eq('oauth_token_secret')
166
+ end
130
167
  end
131
168
  end