chiketto 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chiketto/organizer.rb +7 -0
- data/lib/chiketto/user.rb +12 -3
- data/lib/chiketto/version.rb +1 -1
- data/test/organizer_test.rb +7 -0
- data/test/user_test.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bec52e272697693165db34995b638267602c1fde
|
4
|
+
data.tar.gz: 1f7b4a77e8b014eace483465ea53a9680d1201cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b60b74aea97d3f016fdc7d227b081f32f638ed87161e3edad4d6c92eaf74cef3037b2dfa3fd28e3a2c963fb41af88e459c9416a4ec31c6970e89ac9e3a8575c
|
7
|
+
data.tar.gz: fee79922258e4fe6e5e2e7c3e588a9503861488b0b52b7f038c6c8c1cf5bccac725dd6feaa8e1d1c74dfb97817cc507e3091ed007978c9b86df06b15188aceeb
|
data/lib/chiketto/organizer.rb
CHANGED
data/lib/chiketto/user.rb
CHANGED
@@ -14,12 +14,17 @@ module Chiketto
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def emails
|
17
|
-
@emails.map { |email|
|
17
|
+
@emails.map { |email| Email.new email }
|
18
18
|
end
|
19
19
|
|
20
20
|
def events(params = {})
|
21
|
-
events =
|
22
|
-
events['events'].map { |e|
|
21
|
+
events = User.find_events @id, params
|
22
|
+
events['events'].map { |e| Event.new e }
|
23
|
+
end
|
24
|
+
|
25
|
+
def organizers
|
26
|
+
organizers = User.find_organizers @id
|
27
|
+
organizers['organizers'].map { |o| Organizer.new o }
|
23
28
|
end
|
24
29
|
|
25
30
|
private
|
@@ -27,5 +32,9 @@ module Chiketto
|
|
27
32
|
def self.find_events(id, params)
|
28
33
|
get "users/#{id}/owned_events", params
|
29
34
|
end
|
35
|
+
|
36
|
+
def self.find_organizers(id)
|
37
|
+
get "users/#{id}/organizers"
|
38
|
+
end
|
30
39
|
end
|
31
40
|
end
|
data/lib/chiketto/version.rb
CHANGED
data/test/organizer_test.rb
CHANGED
@@ -20,4 +20,11 @@ class OrganizerTest < MiniTest::Test
|
|
20
20
|
assert_respond_to @organizer.description, :html
|
21
21
|
assert_respond_to @organizer.description, :text
|
22
22
|
end
|
23
|
+
|
24
|
+
def test_can_create_new_organizer
|
25
|
+
VCR.use_cassette 'organizer-create' do
|
26
|
+
organizer = Chiketto::Organizer.create name: 'Test Organizer'
|
27
|
+
assert_kind_of Fixnum, organizer
|
28
|
+
end
|
29
|
+
end
|
23
30
|
end
|
data/test/user_test.rb
CHANGED
@@ -48,4 +48,12 @@ class UserTest < MiniTest::Test
|
|
48
48
|
assert_kind_of Chiketto::Event, @user.events.first
|
49
49
|
end
|
50
50
|
end
|
51
|
+
|
52
|
+
def test_user_has_organizers
|
53
|
+
find_me
|
54
|
+
|
55
|
+
VCR.use_cassette 'user-organizers' do
|
56
|
+
assert_kind_of Chiketto::Organizer, @user.organizers.first
|
57
|
+
end
|
58
|
+
end
|
51
59
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chiketto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Radford
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|