protolink 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/protolink/protonet.rb +4 -3
- data/lib/protolink/version.rb +1 -1
- data/test/all_tests.rb +4 -0
- metadata +4 -4
data/lib/protolink/protonet.rb
CHANGED
@@ -38,10 +38,11 @@ module Protolink
|
|
38
38
|
|
39
39
|
# Creates and returns a new Channel with the given +name+ and optionally a +description+
|
40
40
|
def create_channel(options={})
|
41
|
-
name
|
42
|
-
description
|
41
|
+
name = options[:name] || raise(ArgumentError, "Please provide a name for the channel")
|
42
|
+
description = options[:description]
|
43
|
+
display_name = options[:display_name]
|
43
44
|
skip_autosubscribe = options[:skip_autosubscribe]
|
44
|
-
post('/api/v1/channels', :body => { :name => name, :description => description, :skip_autosubscribe => skip_autosubscribe } )
|
45
|
+
post('/api/v1/channels', :body => { :name => name, :description => description, :display_name => display_name, :skip_autosubscribe => skip_autosubscribe } )
|
45
46
|
find_channel_by_name(name)
|
46
47
|
end
|
47
48
|
|
data/lib/protolink/version.rb
CHANGED
data/test/all_tests.rb
CHANGED
@@ -35,6 +35,8 @@ class TestAll < Test::Unit::TestCase
|
|
35
35
|
user.delete!
|
36
36
|
user = protonet.find_user_by_login("test_2")
|
37
37
|
user.delete!
|
38
|
+
user = protonet.find_user_by_login("test_3")
|
39
|
+
user.delete!
|
38
40
|
channel = protonet.find_channel_by_name("test_foobar")
|
39
41
|
channel.delete!
|
40
42
|
channel = protonet.find_channel_by_name("test_foobar_2")
|
@@ -60,6 +62,8 @@ class TestAll < Test::Unit::TestCase
|
|
60
62
|
assert_equal 'test_2', user_3.login
|
61
63
|
assert_equal 'test_2@test.com', user_3.email
|
62
64
|
|
65
|
+
user_4 = protonet.find_or_create_user_by_login('test_3', {:name => 'foobar', :email => "email@du-bist-mir-sympathisch.de"), :external_profile_url => "http://du-bist-mir-sympathisch.de/profile_redirect", :avatar_url => "http://www.google.com/intl/en_com/images/srpr/logo2w.png"})
|
66
|
+
|
63
67
|
channel_1 = protonet.create_channel(:name => "test_foobar", :skip_autosubscribe => true)
|
64
68
|
assert channel_1.is_a?(Protolink::Channel), "Couldn't create channel"
|
65
69
|
assert_equal 'test_foobar', channel_1.name
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protolink
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 3
|
10
|
+
version: 0.2.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Bj\xC3\xB6rn B. Dorra"
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-07-
|
19
|
+
date: 2011-07-28 00:00:00 +02:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|