dribbble 1.0.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +33 -0
- data/.travis.yml +3 -6
- data/CHANGELOG.md +58 -0
- data/Gemfile +10 -0
- data/Guardfile +4 -2
- data/README.md +44 -285
- data/Rakefile +2 -0
- data/dribbble.gemspec +10 -8
- data/lib/dribbble.rb +3 -1
- data/lib/dribbble/attachment.rb +9 -1
- data/lib/dribbble/base.rb +3 -1
- data/lib/dribbble/client.rb +5 -30
- data/lib/dribbble/errors.rb +3 -3
- data/lib/dribbble/project.rb +10 -2
- data/lib/dribbble/shot.rb +3 -33
- data/lib/dribbble/user.rb +1 -51
- data/lib/dribbble/utils.rb +5 -3
- data/lib/dribbble/utils/creatable.rb +3 -1
- data/lib/dribbble/utils/deletable.rb +3 -1
- data/lib/dribbble/utils/findable.rb +2 -0
- data/lib/dribbble/utils/has_children.rb +16 -12
- data/lib/dribbble/utils/updatable.rb +2 -0
- data/lib/dribbble/version.rb +3 -1
- data/spec/lib/dribbble/base_spec.rb +10 -8
- data/spec/lib/dribbble/client_spec.rb +16 -69
- data/spec/lib/dribbble/project_spec.rb +52 -16
- data/spec/lib/dribbble/shot_spec.rb +14 -197
- data/spec/lib/dribbble/user_spec.rb +5 -175
- data/spec/spec_helper.rb +5 -3
- data/spec/support/dribbble_api.rb +17 -88
- data/spec/support/fixtures/current_user_success.json +35 -24
- data/spec/support/fixtures/project_success.json +1 -1
- data/spec/support/fixtures/projects_accepted.json +8 -0
- data/spec/support/fixtures/projects_deleted.json +8 -0
- data/spec/support/fixtures/projects_success.json +1 -1
- data/spec/support/fixtures/projects_updated.json +8 -0
- data/spec/support/fixtures/shot_success.json +16 -16
- data/spec/support/fixtures/shot_updated.json +78 -78
- data/spec/support/fixtures/shots_success.json +81 -103
- data/spec/support/fixtures/user_success.json +35 -24
- metadata +33 -67
- data/lib/dribbble/bucket.rb +0 -33
- data/lib/dribbble/comment.rb +0 -29
- data/lib/dribbble/like.rb +0 -7
- data/lib/dribbble/team.rb +0 -6
- data/spec/lib/dribbble/bucket_spec.rb +0 -136
- data/spec/lib/dribbble/comment_spec.rb +0 -77
- data/spec/lib/dribbble/team_spec.rb +0 -43
- data/spec/support/fixtures/attachments_success.json +0 -11
- data/spec/support/fixtures/bucket_created.json +0 -8
- data/spec/support/fixtures/bucket_success.json +0 -8
- data/spec/support/fixtures/bucket_updated.json +0 -8
- data/spec/support/fixtures/buckets_success.json +0 -10
- data/spec/support/fixtures/comment_created.json +0 -38
- data/spec/support/fixtures/comment_likes_success.json +0 -40
- data/spec/support/fixtures/comment_success.json +0 -38
- data/spec/support/fixtures/comment_updated.json +0 -38
- data/spec/support/fixtures/comments_success.json +0 -37
- data/spec/support/fixtures/followers_success.json +0 -33
- data/spec/support/fixtures/following_success.json +0 -33
- data/spec/support/fixtures/shot_likes_success.json +0 -33
- data/spec/support/fixtures/team_success.json +0 -26
- data/spec/support/fixtures/teams_success.json +0 -28
- data/spec/support/fixtures/user_likes_success.json +0 -91
- data/spec/support/fixtures/users_success.json +0 -27
@@ -1,25 +1,36 @@
|
|
1
1
|
{
|
2
|
-
"id" :
|
3
|
-
"name" : "
|
4
|
-
"
|
5
|
-
"html_url" : "https://dribbble.com/
|
6
|
-
"avatar_url" : "https://d13yacurqjgara.cloudfront.net/users/
|
7
|
-
"bio" : "",
|
8
|
-
"location" :
|
9
|
-
"links" : {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
"
|
14
|
-
"
|
15
|
-
"
|
16
|
-
"
|
17
|
-
"
|
18
|
-
"
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
2
|
+
"id" : 1,
|
3
|
+
"name" : "Dan Cederholm",
|
4
|
+
"login" : "simplebits",
|
5
|
+
"html_url" : "https://dribbble.com/simplebits",
|
6
|
+
"avatar_url" : "https://d13yacurqjgara.cloudfront.net/users/1/avatars/normal/dc.jpg?1371679243",
|
7
|
+
"bio" : "Co-founder & designer of <a href=\"https://dribbble.com/dribbble\">@Dribbble</a>. Principal of SimpleBits. Aspiring clawhammer banjoist.",
|
8
|
+
"location" : "Salem, MA",
|
9
|
+
"links" : {
|
10
|
+
"web" : "http://simplebits.com",
|
11
|
+
"twitter" : "https://twitter.com/simplebits"
|
12
|
+
},
|
13
|
+
"can_upload_shot" : true,
|
14
|
+
"pro" : true,
|
15
|
+
"followers_count" : 66557,
|
16
|
+
"created_at" : "2009-07-08T02:51:22Z",
|
17
|
+
"type" : "User",
|
18
|
+
"teams" : [
|
19
|
+
{
|
20
|
+
"id" : 39,
|
21
|
+
"name" : "Dribbble",
|
22
|
+
"login" : "dribbble",
|
23
|
+
"html_url" : "https://dribbble.com/dribbble",
|
24
|
+
"avatar_url" : "https://d13yacurqjgara.cloudfront.net/users/39/avatars/normal/apple-flat-precomposed.png?1388527574",
|
25
|
+
"bio" : "Show and tell for designers. This is Dribbble on Dribbble.",
|
26
|
+
"location" : "Salem, MA",
|
27
|
+
"links" : {
|
28
|
+
"web" : "http://dribbble.com",
|
29
|
+
"twitter" : "https://twitter.com/dribbble"
|
30
|
+
},
|
31
|
+
"type" : "Team",
|
32
|
+
"created_at" : "2009-08-18T18:34:31Z",
|
33
|
+
"updated_at" : "2014-02-14T22:32:11Z"
|
34
|
+
}
|
35
|
+
]
|
36
|
+
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dribbble
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Calyhre
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -16,84 +16,84 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: guard-rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '4.7'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '4.7'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 12.3.3
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 12.3.3
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '3.10'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '3.10'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: sinatra
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '1
|
75
|
+
version: '2.1'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '1
|
82
|
+
version: '2.1'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: webmock
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '3.13'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '3.13'
|
97
97
|
description: Simple gem to make shots and list stuff from Dribbble
|
98
98
|
email:
|
99
99
|
- contact@calyh.re
|
@@ -102,7 +102,9 @@ extensions: []
|
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
104
|
- ".gitignore"
|
105
|
+
- ".rubocop.yml"
|
105
106
|
- ".travis.yml"
|
107
|
+
- CHANGELOG.md
|
106
108
|
- CONTRIBUTING.md
|
107
109
|
- Gemfile
|
108
110
|
- Guardfile
|
@@ -113,14 +115,10 @@ files:
|
|
113
115
|
- lib/dribbble.rb
|
114
116
|
- lib/dribbble/attachment.rb
|
115
117
|
- lib/dribbble/base.rb
|
116
|
-
- lib/dribbble/bucket.rb
|
117
118
|
- lib/dribbble/client.rb
|
118
|
-
- lib/dribbble/comment.rb
|
119
119
|
- lib/dribbble/errors.rb
|
120
|
-
- lib/dribbble/like.rb
|
121
120
|
- lib/dribbble/project.rb
|
122
121
|
- lib/dribbble/shot.rb
|
123
|
-
- lib/dribbble/team.rb
|
124
122
|
- lib/dribbble/user.rb
|
125
123
|
- lib/dribbble/utils.rb
|
126
124
|
- lib/dribbble/utils/creatable.rb
|
@@ -130,48 +128,31 @@ files:
|
|
130
128
|
- lib/dribbble/utils/updatable.rb
|
131
129
|
- lib/dribbble/version.rb
|
132
130
|
- spec/lib/dribbble/base_spec.rb
|
133
|
-
- spec/lib/dribbble/bucket_spec.rb
|
134
131
|
- spec/lib/dribbble/client_spec.rb
|
135
|
-
- spec/lib/dribbble/comment_spec.rb
|
136
132
|
- spec/lib/dribbble/project_spec.rb
|
137
133
|
- spec/lib/dribbble/shot_spec.rb
|
138
|
-
- spec/lib/dribbble/team_spec.rb
|
139
134
|
- spec/lib/dribbble/user_spec.rb
|
140
135
|
- spec/spec_helper.rb
|
141
136
|
- spec/support/dribbble_api.rb
|
142
137
|
- spec/support/fixtures/attachment_success.json
|
143
|
-
- spec/support/fixtures/attachments_success.json
|
144
|
-
- spec/support/fixtures/bucket_created.json
|
145
|
-
- spec/support/fixtures/bucket_success.json
|
146
|
-
- spec/support/fixtures/bucket_updated.json
|
147
|
-
- spec/support/fixtures/buckets_success.json
|
148
|
-
- spec/support/fixtures/comment_created.json
|
149
|
-
- spec/support/fixtures/comment_likes_success.json
|
150
|
-
- spec/support/fixtures/comment_success.json
|
151
|
-
- spec/support/fixtures/comment_updated.json
|
152
|
-
- spec/support/fixtures/comments_success.json
|
153
138
|
- spec/support/fixtures/current_user_success.json
|
154
|
-
- spec/support/fixtures/followers_success.json
|
155
|
-
- spec/support/fixtures/following_success.json
|
156
139
|
- spec/support/fixtures/image.jpg
|
157
140
|
- spec/support/fixtures/not_found.json
|
158
141
|
- spec/support/fixtures/project_success.json
|
142
|
+
- spec/support/fixtures/projects_accepted.json
|
143
|
+
- spec/support/fixtures/projects_deleted.json
|
159
144
|
- spec/support/fixtures/projects_success.json
|
160
|
-
- spec/support/fixtures/
|
145
|
+
- spec/support/fixtures/projects_updated.json
|
161
146
|
- spec/support/fixtures/shot_success.json
|
162
147
|
- spec/support/fixtures/shot_updated.json
|
163
148
|
- spec/support/fixtures/shots_success.json
|
164
|
-
- spec/support/fixtures/team_success.json
|
165
|
-
- spec/support/fixtures/teams_success.json
|
166
149
|
- spec/support/fixtures/unauthorized.json
|
167
|
-
- spec/support/fixtures/user_likes_success.json
|
168
150
|
- spec/support/fixtures/user_success.json
|
169
|
-
- spec/support/fixtures/users_success.json
|
170
151
|
homepage: http://github.com/Calyhre/dribbble
|
171
152
|
licenses:
|
172
153
|
- MIT
|
173
154
|
metadata: {}
|
174
|
-
post_install_message:
|
155
|
+
post_install_message:
|
175
156
|
rdoc_options: []
|
176
157
|
require_paths:
|
177
158
|
- lib
|
@@ -179,54 +160,39 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
179
160
|
requirements:
|
180
161
|
- - ">="
|
181
162
|
- !ruby/object:Gem::Version
|
182
|
-
version: 2.
|
163
|
+
version: 2.5.0
|
164
|
+
- - "<"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '3.0'
|
183
167
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
184
168
|
requirements:
|
185
169
|
- - ">="
|
186
170
|
- !ruby/object:Gem::Version
|
187
171
|
version: '0'
|
188
172
|
requirements: []
|
189
|
-
|
190
|
-
|
191
|
-
signing_key:
|
173
|
+
rubygems_version: 3.1.4
|
174
|
+
signing_key:
|
192
175
|
specification_version: 4
|
193
176
|
summary: Dribbble API ruby wrapper
|
194
177
|
test_files:
|
195
178
|
- spec/lib/dribbble/base_spec.rb
|
196
|
-
- spec/lib/dribbble/bucket_spec.rb
|
197
179
|
- spec/lib/dribbble/client_spec.rb
|
198
|
-
- spec/lib/dribbble/comment_spec.rb
|
199
180
|
- spec/lib/dribbble/project_spec.rb
|
200
181
|
- spec/lib/dribbble/shot_spec.rb
|
201
|
-
- spec/lib/dribbble/team_spec.rb
|
202
182
|
- spec/lib/dribbble/user_spec.rb
|
203
183
|
- spec/spec_helper.rb
|
204
184
|
- spec/support/dribbble_api.rb
|
205
185
|
- spec/support/fixtures/attachment_success.json
|
206
|
-
- spec/support/fixtures/attachments_success.json
|
207
|
-
- spec/support/fixtures/bucket_created.json
|
208
|
-
- spec/support/fixtures/bucket_success.json
|
209
|
-
- spec/support/fixtures/bucket_updated.json
|
210
|
-
- spec/support/fixtures/buckets_success.json
|
211
|
-
- spec/support/fixtures/comment_created.json
|
212
|
-
- spec/support/fixtures/comment_likes_success.json
|
213
|
-
- spec/support/fixtures/comment_success.json
|
214
|
-
- spec/support/fixtures/comment_updated.json
|
215
|
-
- spec/support/fixtures/comments_success.json
|
216
186
|
- spec/support/fixtures/current_user_success.json
|
217
|
-
- spec/support/fixtures/followers_success.json
|
218
|
-
- spec/support/fixtures/following_success.json
|
219
187
|
- spec/support/fixtures/image.jpg
|
220
188
|
- spec/support/fixtures/not_found.json
|
221
189
|
- spec/support/fixtures/project_success.json
|
190
|
+
- spec/support/fixtures/projects_accepted.json
|
191
|
+
- spec/support/fixtures/projects_deleted.json
|
222
192
|
- spec/support/fixtures/projects_success.json
|
223
|
-
- spec/support/fixtures/
|
193
|
+
- spec/support/fixtures/projects_updated.json
|
224
194
|
- spec/support/fixtures/shot_success.json
|
225
195
|
- spec/support/fixtures/shot_updated.json
|
226
196
|
- spec/support/fixtures/shots_success.json
|
227
|
-
- spec/support/fixtures/team_success.json
|
228
|
-
- spec/support/fixtures/teams_success.json
|
229
197
|
- spec/support/fixtures/unauthorized.json
|
230
|
-
- spec/support/fixtures/user_likes_success.json
|
231
198
|
- spec/support/fixtures/user_success.json
|
232
|
-
- spec/support/fixtures/users_success.json
|
data/lib/dribbble/bucket.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'dribbble/utils/findable'
|
2
|
-
require 'dribbble/utils/creatable'
|
3
|
-
require 'dribbble/utils/updatable'
|
4
|
-
require 'dribbble/utils/deletable'
|
5
|
-
|
6
|
-
module Dribbble
|
7
|
-
class Bucket < Dribbble::Base
|
8
|
-
include Dribbble::Utils::Findable
|
9
|
-
include Dribbble::Utils::Creatable
|
10
|
-
include Dribbble::Utils::Updatable
|
11
|
-
include Dribbble::Utils::Deletable
|
12
|
-
|
13
|
-
has_many :shots
|
14
|
-
|
15
|
-
def add_shot(shot)
|
16
|
-
shot_id = shot.is_a?(Dribbble::Shot) ? shot.id : shot
|
17
|
-
res = html_put("/buckets/#{id}/shots") do |payload|
|
18
|
-
payload[:shot_id] = shot_id
|
19
|
-
end
|
20
|
-
res.code == 204 ? true : false
|
21
|
-
end
|
22
|
-
|
23
|
-
def remove_shot(shot)
|
24
|
-
shot_id = shot.is_a?(Dribbble::Shot) ? shot.id : shot
|
25
|
-
res = html_delete "/buckets/#{id}/shots", shot_id: shot_id
|
26
|
-
res.code == 204 ? true : false
|
27
|
-
end
|
28
|
-
|
29
|
-
def self.available_fields
|
30
|
-
%i(name description)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
data/lib/dribbble/comment.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
module Dribbble
|
2
|
-
class Comment < Dribbble::Base
|
3
|
-
def self.available_fields
|
4
|
-
%i(body)
|
5
|
-
end
|
6
|
-
|
7
|
-
def likes
|
8
|
-
url = "#{dribbble_url}/likes"
|
9
|
-
Dribbble::Like.batch_new token, html_get(url), nil, url
|
10
|
-
end
|
11
|
-
|
12
|
-
def like?
|
13
|
-
html_get "#{dribbble_url}/like"
|
14
|
-
true
|
15
|
-
rescue RestClient::ResourceNotFound
|
16
|
-
false
|
17
|
-
end
|
18
|
-
|
19
|
-
def like!
|
20
|
-
res = html_post "#{dribbble_url}/like"
|
21
|
-
res.code == 201 ? true : false
|
22
|
-
end
|
23
|
-
|
24
|
-
def unlike!
|
25
|
-
res = html_delete "#{dribbble_url}/like"
|
26
|
-
res.code == 204 ? true : false
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
data/lib/dribbble/like.rb
DELETED
data/lib/dribbble/team.rb
DELETED
@@ -1,136 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
RAW_BUCKET = data_from_json 'bucket_success.json'
|
4
|
-
|
5
|
-
describe Dribbble::Bucket do
|
6
|
-
describe 'on instance' do
|
7
|
-
before :all do
|
8
|
-
@bucket = Dribbble::Bucket.new 'valid_token', RAW_BUCKET
|
9
|
-
end
|
10
|
-
|
11
|
-
describe 'after initialization' do
|
12
|
-
RAW_BUCKET.each do |field, value|
|
13
|
-
it "respond to #{field}" do
|
14
|
-
expect(@bucket.send field).to eq(value)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
describe 'on #update' do
|
20
|
-
subject do
|
21
|
-
stub_dribbble :put, '/buckets/2754', DribbbleAPI::BucketUpdated
|
22
|
-
new_bucket = {
|
23
|
-
name: 'Bucket title',
|
24
|
-
description: 'Bucket description'
|
25
|
-
}
|
26
|
-
@bucket.update new_bucket
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'update bucket' do
|
30
|
-
expect(subject.name).to eq('Bucket title')
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
describe 'on #delete' do
|
35
|
-
subject do
|
36
|
-
stub_dribbble :delete, '/buckets/2754', DribbbleAPI::BucketDeleted
|
37
|
-
@bucket.delete
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'return true' do
|
41
|
-
expect(subject).to eq(true)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
describe 'on #shots' do
|
46
|
-
subject do
|
47
|
-
stub_dribbble :get, '/buckets/2754/shots', DribbbleAPI::ShotsSuccess
|
48
|
-
@bucket.shots
|
49
|
-
end
|
50
|
-
|
51
|
-
it 'responds with shots' do
|
52
|
-
expect(subject.size).to eq 2
|
53
|
-
expect(subject.first).to be_a Dribbble::Shot
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
describe 'on #add_shot' do
|
58
|
-
subject do
|
59
|
-
stub_dribbble :put, '/buckets/2754/shots', DribbbleAPI::NoContent
|
60
|
-
@bucket.add_shot '471756'
|
61
|
-
end
|
62
|
-
|
63
|
-
it 'add shot' do
|
64
|
-
expect(subject).to eq(true)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
describe 'on #remove_shot' do
|
69
|
-
subject do
|
70
|
-
stub_dribbble :delete, '/buckets/2754/shots?shot_id=471756', DribbbleAPI::NoContent
|
71
|
-
@bucket.remove_shot '471756'
|
72
|
-
end
|
73
|
-
|
74
|
-
it 'remove shot' do
|
75
|
-
expect(subject).to eq(true)
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
describe 'on class' do
|
81
|
-
describe 'on #create' do
|
82
|
-
subject do
|
83
|
-
stub_dribbble :post, '/buckets', DribbbleAPI::BucketCreated
|
84
|
-
bucket = {
|
85
|
-
name: 'Bucket title',
|
86
|
-
description: 'Bucket description'
|
87
|
-
}
|
88
|
-
Dribbble::Bucket.create 'valid_token', bucket
|
89
|
-
end
|
90
|
-
|
91
|
-
it 'create the shot' do
|
92
|
-
expect(subject).to be_a Dribbble::Bucket
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
describe 'on #update' do
|
97
|
-
subject do
|
98
|
-
stub_dribbble :get, '/buckets/2754', DribbbleAPI::BucketSuccess
|
99
|
-
stub_dribbble :put, '/buckets/2754', DribbbleAPI::BucketUpdated
|
100
|
-
bucket = {
|
101
|
-
name: 'Bucket title',
|
102
|
-
description: 'Bucket description'
|
103
|
-
}
|
104
|
-
Dribbble::Bucket.update 'valid_token', 2754, bucket
|
105
|
-
end
|
106
|
-
|
107
|
-
it 'update bucket' do
|
108
|
-
expect(subject.name).to eq('Bucket title')
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
describe 'on #delete' do
|
113
|
-
subject do
|
114
|
-
stub_dribbble :get, '/buckets/2754', DribbbleAPI::BucketSuccess
|
115
|
-
stub_dribbble :delete, '/buckets/2754', DribbbleAPI::BucketDeleted
|
116
|
-
Dribbble::Bucket.delete 'valid_token', 2754
|
117
|
-
end
|
118
|
-
|
119
|
-
it 'return true' do
|
120
|
-
expect(subject).to eq(true)
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
|
-
describe 'on #find' do
|
125
|
-
subject do
|
126
|
-
stub_dribbble :get, '/buckets/2754', DribbbleAPI::BucketSuccess
|
127
|
-
Dribbble::Bucket.find 'valid_token', 2754
|
128
|
-
end
|
129
|
-
|
130
|
-
it 'return a bucket' do
|
131
|
-
expect(subject).to be_a Dribbble::Bucket
|
132
|
-
expect(subject.id).to eq(2754)
|
133
|
-
end
|
134
|
-
end
|
135
|
-
end
|
136
|
-
end
|