mno-enterprise-core 3.0.1 → 3.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: 8bbc0da51ab4bc7a4c3821afe013a2c45733f868
|
4
|
+
data.tar.gz: c186478fe2bdf9a0e7087d08ec7d8942af09ad60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d68a79355bfec26b264b226b7addef9f13331f498558941ca4c8c5d4128d8aecb2dc84d0f4885f378ae404f8411d870222e07e24414d24df8a4ba7be6b27747
|
7
|
+
data.tar.gz: bfb6e08bef16d00556eec3ae69163190048fd6e5278cd4675949b72b69696c09f1717071a591b0bd470eb07c50f623d43b4c68e5b8e277d0116e39a6794d779b
|
@@ -118,5 +118,21 @@ module MnoEnterprise
|
|
118
118
|
def after_sign_out_path_for(resource_or_scope)
|
119
119
|
MnoEnterprise.router.after_sign_out_url || super
|
120
120
|
end
|
121
|
+
|
122
|
+
private
|
123
|
+
|
124
|
+
# Append params to the fragment part of an existing url String
|
125
|
+
# add_param("/#/platform/accounts", 'foo', 'bar')
|
126
|
+
# => "/#/platform/accounts?foo=bar"
|
127
|
+
# add_param("/#/platform/dashboard/he/43?en=690", 'foo', 'bar')
|
128
|
+
# => "/#/platform/dashboard/he/43?en=690&foo=bar"
|
129
|
+
def add_param_to_fragment(url, param_name, param_value)
|
130
|
+
uri = URI(url)
|
131
|
+
fragment = URI(uri.fragment || "")
|
132
|
+
params = URI.decode_www_form(fragment.query || "") << [param_name, param_value]
|
133
|
+
fragment.query = URI.encode_www_form(params)
|
134
|
+
uri.fragment = fragment.to_s
|
135
|
+
uri.to_s
|
136
|
+
end
|
121
137
|
end
|
122
138
|
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: 3.0.
|
4
|
+
version: 3.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
|
@@ -501,6 +501,7 @@ files:
|
|
501
501
|
- lib/mno_enterprise/version.rb
|
502
502
|
- lib/tasks/mno_enterprise_tasks.rake
|
503
503
|
- spec/controllers/mno_enterprise/angular_csrf_spec.rb
|
504
|
+
- spec/controllers/mno_enterprise/application_controller_spec.rb
|
504
505
|
- spec/controllers/mno_enterprise/i18n_spec.rb
|
505
506
|
- spec/lib/her_extension/her_orm_adapter.rb
|
506
507
|
- spec/lib/her_extension/model/relation_spec.rb
|
@@ -519,7 +520,7 @@ files:
|
|
519
520
|
- spec/spec_helper.rb
|
520
521
|
homepage: https://maestrano.com
|
521
522
|
licenses:
|
522
|
-
-
|
523
|
+
- Apache-2.0
|
523
524
|
metadata: {}
|
524
525
|
post_install_message:
|
525
526
|
rdoc_options: []
|
@@ -558,4 +559,5 @@ test_files:
|
|
558
559
|
- spec/rails_helper.rb
|
559
560
|
- spec/controllers/mno_enterprise/i18n_spec.rb
|
560
561
|
- spec/controllers/mno_enterprise/angular_csrf_spec.rb
|
562
|
+
- spec/controllers/mno_enterprise/application_controller_spec.rb
|
561
563
|
- spec/mno_enterprise_spec.rb
|