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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 960921d41a890c65c8139789bfbcace08a8386c8
4
- data.tar.gz: a24198885b40f89733bd48004f6da18bf4915dc0
3
+ metadata.gz: bec52e272697693165db34995b638267602c1fde
4
+ data.tar.gz: 1f7b4a77e8b014eace483465ea53a9680d1201cd
5
5
  SHA512:
6
- metadata.gz: 99f3ecbcd868359bc5979f5fa486c78d6fa2bae91aa36e173bef085125e470b0f791b7789ade17a1827326c782462589cfee048d9c1a91627b87e78c0e61fd8e
7
- data.tar.gz: 3b5752ea27d7593489e67b6cbd19d18100242dcc17165af70218664d284644e94679c68b246d662102ad0206095f18001a5846e35cd2ccfeaac6028c3cfc6864
6
+ metadata.gz: 9b60b74aea97d3f016fdc7d227b081f32f638ed87161e3edad4d6c92eaf74cef3037b2dfa3fd28e3a2c963fb41af88e459c9416a4ec31c6970e89ac9e3a8575c
7
+ data.tar.gz: fee79922258e4fe6e5e2e7c3e588a9503861488b0b52b7f038c6c8c1cf5bccac725dd6feaa8e1d1c74dfb97817cc507e3091ed007978c9b86df06b15188aceeb
@@ -3,5 +3,12 @@ module Chiketto
3
3
  attr_accessor :name
4
4
 
5
5
  attr_attrib :description
6
+
7
+ def self.create(params)
8
+ response = Organizer.post 'organizer_new', params
9
+ if response.fetch('process', false)
10
+ response['process']['id']
11
+ end
12
+ end
6
13
  end
7
14
  end
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| Chiketto::Email.new email }
17
+ @emails.map { |email| Email.new email }
18
18
  end
19
19
 
20
20
  def events(params = {})
21
- events = Chiketto::User.find_events @id, params
22
- events['events'].map { |e| Chiketto::Event.new 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
@@ -1,3 +1,3 @@
1
1
  module Chiketto
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -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.0
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-05 00:00:00.000000000 Z
11
+ date: 2014-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler