woopy 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/woopy.rb +1 -0
- data/lib/woopy/account.rb +6 -1
- data/lib/woopy/role.rb +8 -0
- data/lib/woopy/version.rb +1 -1
- data/spec/spec_helper.rb +4 -0
- data/spec/woopy/account_spec.rb +12 -3
- metadata +14 -19
data/lib/woopy.rb
CHANGED
data/lib/woopy/account.rb
CHANGED
data/lib/woopy/role.rb
ADDED
data/lib/woopy/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
data/spec/woopy/account_spec.rb
CHANGED
@@ -6,13 +6,15 @@ describe Woopy::Account do
|
|
6
6
|
@token = 'foo'
|
7
7
|
Woopy(token: @token)
|
8
8
|
ActiveResource::HttpMock.respond_to do |mock|
|
9
|
-
mock.post(
|
10
|
-
mock.post(
|
11
|
-
mock.post(
|
9
|
+
mock.post( '/services/v1/accounts.json', request_headers(@token), account_response )
|
10
|
+
mock.post( '/services/v1/users.json', request_headers(@token), user_response )
|
11
|
+
mock.post( '/services/v1/ownerships.json', request_headers(@token), ownership_response )
|
12
12
|
|
13
13
|
mock.get( '/services/v1/accounts/1/users/1/employment.json', accept_request_headers(@token), employment_response )
|
14
14
|
mock.post( '/services/v1/accounts/1/employments.json', request_headers(@token), employment_response )
|
15
15
|
mock.delete( '/services/v1/accounts/1/employments/1.json', accept_request_headers(@token), employment_response )
|
16
|
+
|
17
|
+
mock.put( "/services/v1/accounts/1/users/1/update_roles.json?#{ roles_attributes.to_query }", request_headers(@token), :ok )
|
16
18
|
end
|
17
19
|
end
|
18
20
|
|
@@ -64,5 +66,12 @@ describe Woopy::Account do
|
|
64
66
|
it { should be_persisted }
|
65
67
|
its(:user_id) { should == @user.id }
|
66
68
|
end
|
69
|
+
|
70
|
+
describe "#grant_role" do
|
71
|
+
subject { @account.grant_role(@user, ["role1", "role2"]) }
|
72
|
+
|
73
|
+
it { should be_true }
|
74
|
+
end
|
75
|
+
|
67
76
|
end
|
68
77
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: woopy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-03-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement: &
|
16
|
+
requirement: &70136584535640 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70136584535640
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &70136584535140 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '2.8'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70136584535140
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: json
|
38
|
-
requirement: &
|
38
|
+
requirement: &70136584534720 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70136584534720
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: gem-release
|
49
|
-
requirement: &
|
49
|
+
requirement: &70136584534260 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70136584534260
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: activeresource
|
60
|
-
requirement: &
|
60
|
+
requirement: &70136584533760 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: '3.1'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70136584533760
|
69
69
|
description: Wraps the Woople API as ActiveResources
|
70
70
|
email:
|
71
71
|
- developers@bigbangtechnology.com
|
@@ -85,6 +85,7 @@ files:
|
|
85
85
|
- lib/woopy/employment.rb
|
86
86
|
- lib/woopy/ownership.rb
|
87
87
|
- lib/woopy/resource.rb
|
88
|
+
- lib/woopy/role.rb
|
88
89
|
- lib/woopy/user.rb
|
89
90
|
- lib/woopy/version.rb
|
90
91
|
- spec/spec_helper.rb
|
@@ -104,21 +105,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
105
|
- - ! '>='
|
105
106
|
- !ruby/object:Gem::Version
|
106
107
|
version: '0'
|
107
|
-
segments:
|
108
|
-
- 0
|
109
|
-
hash: -1435565781307241770
|
110
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
109
|
none: false
|
112
110
|
requirements:
|
113
111
|
- - ! '>='
|
114
112
|
- !ruby/object:Gem::Version
|
115
113
|
version: '0'
|
116
|
-
segments:
|
117
|
-
- 0
|
118
|
-
hash: -1435565781307241770
|
119
114
|
requirements: []
|
120
115
|
rubyforge_project: woopy
|
121
|
-
rubygems_version: 1.8.
|
116
|
+
rubygems_version: 1.8.17
|
122
117
|
signing_key:
|
123
118
|
specification_version: 3
|
124
119
|
summary: Woople API Wrapper
|