adobe_connect 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -50,7 +50,8 @@ module AdobeConnect
|
|
50
50
|
end
|
51
51
|
|
52
52
|
query_string = ParamFormatter.new(params).format
|
53
|
-
client.get("/api/xml?action=#{action}#{query_string}")
|
53
|
+
response = client.get("/api/xml?action=#{action}#{query_string}")
|
54
|
+
AdobeConnect::Response.new(response)
|
54
55
|
end
|
55
56
|
end
|
56
57
|
end
|
@@ -24,10 +24,9 @@ class AdobeConnectServiceTest < MiniTest::Unit::TestCase
|
|
24
24
|
|
25
25
|
def test_log_in_authenticates
|
26
26
|
response = mock(:status => 200)
|
27
|
-
response.expects(:fetch).returns('BREEZESESSION=12345')
|
27
|
+
response.expects(:fetch).with('set-cookie').returns('BREEZESESSION=12345')
|
28
28
|
response.expects(:body).returns(LOGIN_SUCCESS)
|
29
|
-
|
30
|
-
@service.client.stubs(:get).returns(ac_response)
|
29
|
+
@service.client.stubs(:get).returns(response)
|
31
30
|
|
32
31
|
@service.log_in
|
33
32
|
assert @service.authenticated?
|
@@ -37,10 +36,9 @@ class AdobeConnectServiceTest < MiniTest::Unit::TestCase
|
|
37
36
|
response = mock(:status => 200)
|
38
37
|
response.expects(:fetch).with('set-cookie').returns('BREEZESESSION=12345;HttpOnly;path=/')
|
39
38
|
response.expects(:body).returns(LOGIN_SUCCESS)
|
40
|
-
ac_response = AdobeConnect::Response.new(response)
|
41
39
|
@service.client.stubs(:get).
|
42
40
|
with("/api/xml?action=login&login=name&password=password").
|
43
|
-
returns(
|
41
|
+
returns(response)
|
44
42
|
|
45
43
|
@service.log_in
|
46
44
|
assert_equal @service.session, '12345'
|
@@ -49,8 +47,7 @@ class AdobeConnectServiceTest < MiniTest::Unit::TestCase
|
|
49
47
|
def test_log_in_returns_false_on_failure
|
50
48
|
response = mock(:status => 200)
|
51
49
|
response.expects(:body).returns(LOGIN_FAIL)
|
52
|
-
|
53
|
-
@service.client.stubs(:get).returns(ac_response)
|
50
|
+
@service.client.stubs(:get).returns(response)
|
54
51
|
|
55
52
|
refute @service.log_in
|
56
53
|
end
|
@@ -53,18 +53,20 @@ class AdobeConnectUserTest < MiniTest::Unit::TestCase
|
|
53
53
|
def test_save_returns_false_on_failure
|
54
54
|
response = mock(:status => 200)
|
55
55
|
response.expects(:body).returns(SAVE_ERROR)
|
56
|
-
ac_response = AdobeConnect::Response.new(response)
|
57
56
|
|
58
|
-
@connect_user.service.
|
57
|
+
@connect_user.service.
|
58
|
+
expects(:principal_update).
|
59
|
+
returns(AdobeConnect::Response.new(response))
|
59
60
|
refute @connect_user.save
|
60
61
|
end
|
61
62
|
|
62
63
|
def test_save_stores_errors_on_failure
|
63
64
|
response = mock(:status => 200)
|
64
65
|
response.expects(:body).returns(SAVE_ERROR)
|
65
|
-
ac_response = AdobeConnect::Response.new(response)
|
66
66
|
|
67
|
-
@connect_user.service.
|
67
|
+
@connect_user.service.
|
68
|
+
expects(:principal_update).
|
69
|
+
returns(AdobeConnect::Response.new(response))
|
68
70
|
@connect_user.save
|
69
71
|
assert_equal 3, @connect_user.errors.length
|
70
72
|
end
|
@@ -79,10 +81,9 @@ class AdobeConnectUserTest < MiniTest::Unit::TestCase
|
|
79
81
|
def test_find_should_return_an_existing_user
|
80
82
|
response = mock(:status => 200)
|
81
83
|
response.expects(:body).returns(FIND_SUCCESS)
|
82
|
-
ac_response = AdobeConnect::Response.new(response)
|
83
84
|
AdobeConnect::Service.any_instance.expects(:principal_list).
|
84
85
|
with(:filter_login => 'test@example.com').
|
85
|
-
returns(
|
86
|
+
returns(AdobeConnect::Response.new(response))
|
86
87
|
|
87
88
|
app_user = stub(:email => 'test@example.com')
|
88
89
|
connect_user = AdobeConnect::User.find(app_user)
|
@@ -92,9 +93,8 @@ class AdobeConnectUserTest < MiniTest::Unit::TestCase
|
|
92
93
|
def test_find_should_set_user_attributes
|
93
94
|
response = mock(:status => 200)
|
94
95
|
response.expects(:body).returns(FIND_ERROR)
|
95
|
-
ac_response = AdobeConnect::Response.new(response)
|
96
96
|
AdobeConnect::Service.any_instance.expects(:principal_list).
|
97
|
-
returns(
|
97
|
+
returns(AdobeConnect::Response.new(response))
|
98
98
|
|
99
99
|
app_user = stub(:email => 'notfound@example.com')
|
100
100
|
connect_user = AdobeConnect::User.find(app_user)
|