invitational 1.4.1 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -43,6 +43,17 @@ describe Ability do
43
43
  And { i.should_not be_able_to(:read, entity1) }
44
44
  end
45
45
 
46
+ context "Any Role (wildcard)" do
47
+ Given (:user) { Ability.new(user1) }
48
+ Given (:admin) { Ability.new(user2) }
49
+ When (:role) {:*}
50
+
51
+ Then { user.should be_able_to(:validate, entity1) }
52
+ And { user.should_not be_able_to(:validate, entity2) }
53
+ And { admin.should be_able_to(:validate, entity2) }
54
+ And { admin.should_not be_able_to(:validate, entity1) }
55
+ end
56
+
46
57
  context "System - Employer" do
47
58
  Given (:i) { Ability.new(user4) }
48
59
  When (:role) {:employer}
@@ -27,6 +27,15 @@ describe Invitational::Invitation do
27
27
  Then {new_invite.claim_hash.should_not be_nil}
28
28
  And {new_invite.date_sent.should_not be_nil}
29
29
  end
30
+
31
+ context "Generates Claim hash that is not predictable" do
32
+ Given(:first_invite) {Invitation.new(email: "test999@d-i.co", invitable: entity1, role: :user)}
33
+ Given(:second_invite) {Invitation.new(email: "test999@d-i.co", invitable: entity2, role: :user)}
34
+
35
+ When {first_invite.save && second_invite.save}
36
+
37
+ Then {first_invite.claim_hash != second_invite.claim_hash}
38
+ end
30
39
  end
31
40
 
32
41
  context "Role Title" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: invitational
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Goerlich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-01 00:00:00.000000000 Z
11
+ date: 2021-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.13'
33
+ version: '2.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.13'
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sqlite3
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -156,6 +156,7 @@ files:
156
156
  - lib/invitational/exceptions.rb
157
157
  - lib/invitational/version.rb
158
158
  - lib/tasks/invitational_tasks.rake
159
+ - spec/internal/app/assets/config/manifest.js
159
160
  - spec/internal/app/models/ability.rb
160
161
  - spec/internal/app/models/child.rb
161
162
  - spec/internal/app/models/entity.rb
@@ -200,35 +201,36 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
201
  - !ruby/object:Gem::Version
201
202
  version: '0'
202
203
  requirements: []
203
- rubygems_version: 3.0.1
204
+ rubygems_version: 3.1.4
204
205
  signing_key:
205
206
  specification_version: 4
206
207
  summary: Solution that eliminates the tight coupling between user identity/authentication
207
208
  and application functional authorization
208
209
  test_files:
209
- - spec/invitational/models/entity_spec.rb
210
- - spec/invitational/models/ability_spec.rb
211
- - spec/invitational/models/invitation_spec.rb
212
- - spec/invitational/models/user_spec.rb
213
- - spec/invitational/services/claims_invitation_spec.rb
214
- - spec/invitational/services/claims_all_invitations_spec.rb
215
- - spec/invitational/services/creates_system_user_invitation_spec.rb
216
- - spec/invitational/services/creates_uber_admin_invitation_spec.rb
217
- - spec/invitational/services/creates_invitation_spec.rb
218
- - spec/invitational/services/checks_for_invitation_spec.rb
219
- - spec/invitational/services/service_helper.rb
220
210
  - spec/spec_helper.rb
221
- - spec/internal/config/routes.rb
222
- - spec/internal/config/database.yml
223
- - spec/internal/public/favicon.ico
224
- - spec/internal/log/test.log
225
211
  - spec/internal/app/models/entity.rb
212
+ - spec/internal/app/models/system_thing.rb
213
+ - spec/internal/app/models/other_entity.rb
226
214
  - spec/internal/app/models/child.rb
227
- - spec/internal/app/models/invitation.rb
228
215
  - spec/internal/app/models/ability.rb
229
216
  - spec/internal/app/models/user.rb
230
217
  - spec/internal/app/models/grandparent.rb
231
- - spec/internal/app/models/system_thing.rb
232
- - spec/internal/app/models/other_entity.rb
233
- - spec/internal/db/schema.rb
218
+ - spec/internal/app/models/invitation.rb
219
+ - spec/internal/app/assets/config/manifest.js
220
+ - spec/internal/log/test.log
221
+ - spec/internal/config/routes.rb
222
+ - spec/internal/config/database.yml
223
+ - spec/internal/public/favicon.ico
234
224
  - spec/internal/db/combustion_test.sqlite
225
+ - spec/internal/db/schema.rb
226
+ - spec/invitational/models/entity_spec.rb
227
+ - spec/invitational/models/invitation_spec.rb
228
+ - spec/invitational/models/ability_spec.rb
229
+ - spec/invitational/models/user_spec.rb
230
+ - spec/invitational/services/claims_all_invitations_spec.rb
231
+ - spec/invitational/services/creates_uber_admin_invitation_spec.rb
232
+ - spec/invitational/services/creates_system_user_invitation_spec.rb
233
+ - spec/invitational/services/checks_for_invitation_spec.rb
234
+ - spec/invitational/services/service_helper.rb
235
+ - spec/invitational/services/creates_invitation_spec.rb
236
+ - spec/invitational/services/claims_invitation_spec.rb