mno-enterprise-core 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/mno_enterprise/application_controller.rb +16 -0
- data/lib/devise/models/remote_authenticatable.rb +1 -1
- data/lib/mno_enterprise/testing_support/factories/org_invite.rb +5 -1
- data/lib/mno_enterprise/version.rb +1 -1
- data/spec/controllers/mno_enterprise/application_controller_spec.rb +15 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbc28286415a3dba2f5e47526dbe72c64a8b1733
|
4
|
+
data.tar.gz: 04b1ea9f9202953209dd0aea50ed75d2bf5bc150
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f338f4c5ee9aea85d2b2932566b09897ec2a79e2660eae46469ccaa9330a1be73ef4743788dd6cbc044cad067e533777db922b5094e3f286f4164b140257f927
|
7
|
+
data.tar.gz: 8a92ad1e78f595cf02b57083eccd41d2096cb505591f19466e6f5e2672dd4302122bf3e55557fbfe29624e2a6358890296b548d6f2238771220aa87a9778e18f
|
@@ -112,5 +112,21 @@ module MnoEnterprise
|
|
112
112
|
def after_sign_out_path_for(resource_or_scope)
|
113
113
|
MnoEnterprise.router.after_sign_out_url || super
|
114
114
|
end
|
115
|
+
|
116
|
+
private
|
117
|
+
|
118
|
+
# Append params to the fragment part of an existing url String
|
119
|
+
# add_param("/#/platform/accounts", 'foo', 'bar')
|
120
|
+
# => "/#/platform/accounts?foo=bar"
|
121
|
+
# add_param("/#/platform/dashboard/he/43?en=690", 'foo', 'bar')
|
122
|
+
# => "/#/platform/dashboard/he/43?en=690&foo=bar"
|
123
|
+
def add_param_to_fragment(url, param_name, param_value)
|
124
|
+
uri = URI(url)
|
125
|
+
fragment = URI(uri.fragment || "")
|
126
|
+
params = URI.decode_www_form(fragment.query || "") << [param_name, param_value]
|
127
|
+
fragment.query = URI.encode_www_form(params)
|
128
|
+
uri.fragment = fragment.to_s
|
129
|
+
uri.to_s
|
130
|
+
end
|
115
131
|
end
|
116
132
|
end
|
@@ -30,7 +30,7 @@ module Devise
|
|
30
30
|
def serialize_from_session(key,salt)
|
31
31
|
record = Rails.cache.fetch(['user', key], expires_in: 1.minutes) do
|
32
32
|
to_adapter.get(key)
|
33
|
-
end.tap
|
33
|
+
end.tap {|r| r && r.clear_association_cache}
|
34
34
|
record if record && record.authenticatable_salt == salt
|
35
35
|
end
|
36
36
|
|
@@ -14,11 +14,15 @@ FactoryGirl.define do
|
|
14
14
|
team { build(:team).attributes }
|
15
15
|
user_role 'Member'
|
16
16
|
|
17
|
-
created_at
|
17
|
+
created_at 1.days.ago
|
18
18
|
updated_at 1.hour.ago
|
19
19
|
|
20
20
|
# Properly build the resource with Her
|
21
21
|
initialize_with { new(attributes).tap { |e| e.clear_attribute_changes! } }
|
22
|
+
|
23
|
+
trait :expired do
|
24
|
+
created_at 1.month.ago
|
25
|
+
end
|
22
26
|
end
|
23
27
|
end
|
24
28
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
module MnoEnterprise
|
4
|
+
describe ApplicationController, type: :controller do
|
5
|
+
describe '#add_param_to_fragment' do
|
6
|
+
let(:controller) { MnoEnterprise::ApplicationController.new }
|
7
|
+
|
8
|
+
it { expect(subject.send(:add_param_to_fragment, '/#/platform/accounts', 'foo', 'bar')).to eq('/#/platform/accounts?foo=bar') }
|
9
|
+
it { expect(subject.send(:add_param_to_fragment, '/', 'foo', 'bar')).to eq('/#?foo=bar') }
|
10
|
+
it { expect(subject.send(:add_param_to_fragment, '/#/platform/dashboard/he/43?en=690', 'foo', 'bar')).to eq('/#/platform/dashboard/he/43?en=690&foo=bar') }
|
11
|
+
it { expect(subject.send(:add_param_to_fragment, '/#/platform/dashboard/he/43?en=690', 'foo', [{msg: 'yolo'}])).to eq('/#/platform/dashboard/he/43?en=690&foo=%7B%3Amsg%3D%3E%22yolo%22%7D') }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mno-enterprise-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arnaud Lachaume
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-05-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -367,6 +367,7 @@ files:
|
|
367
367
|
- lib/mno_enterprise/version.rb
|
368
368
|
- lib/tasks/mno_enterprise_tasks.rake
|
369
369
|
- spec/controllers/mno_enterprise/angular_csrf_spec.rb
|
370
|
+
- spec/controllers/mno_enterprise/application_controller_spec.rb
|
370
371
|
- spec/lib/her_extension/her_orm_adapter.rb
|
371
372
|
- spec/lib/her_extension/model/relation_spec.rb
|
372
373
|
- spec/lib/mandrill_client_spec.rb
|
@@ -382,7 +383,7 @@ files:
|
|
382
383
|
- spec/spec_helper.rb
|
383
384
|
homepage: https://maestrano.com
|
384
385
|
licenses:
|
385
|
-
-
|
386
|
+
- Apache-2.0
|
386
387
|
metadata: {}
|
387
388
|
post_install_message:
|
388
389
|
rdoc_options: []
|
@@ -418,4 +419,5 @@ test_files:
|
|
418
419
|
- spec/lib/mandrill_client_spec.rb
|
419
420
|
- spec/rails_helper.rb
|
420
421
|
- spec/controllers/mno_enterprise/angular_csrf_spec.rb
|
422
|
+
- spec/controllers/mno_enterprise/application_controller_spec.rb
|
421
423
|
- spec/mno_enterprise_spec.rb
|