registrar-rails 0.0.12.alpha → 0.0.13.alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfda5870a7c1a99c12972c5aa75a246ae111a3b4
|
4
|
+
data.tar.gz: 3375d6685f8d21aaa9eceb5b68b38131e9b5dedb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 998857c562890df19911e071b25599d153fb64689b46599dc4c145f65c73fe6bea7a5f7198778fa1b3f00176230a7cc0e5bfe93cd4d1e2b9e082ced66e095d7e
|
7
|
+
data.tar.gz: 2c59d47e9d3c7a259a86d949c052f58119402310c83664ed5d1c2309c714c8cc052673ccf8f6487cc9e1201b938485d36aa19f35af37303450ba6a32864a3a82
|
@@ -1,16 +1,5 @@
|
|
1
1
|
module Registrar
|
2
2
|
module Rails
|
3
|
-
class CurrentProfile
|
4
|
-
attr_reader :uid
|
5
|
-
def initialize(uid)
|
6
|
-
@uid = uid
|
7
|
-
end
|
8
|
-
|
9
|
-
def profile_uid
|
10
|
-
@uid
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
3
|
module ControllerExtensions
|
15
4
|
def self.included(klass)
|
16
5
|
klass.send :include, InstanceMethods
|
@@ -54,13 +43,22 @@ module Registrar
|
|
54
43
|
|
55
44
|
if current_profile_uid
|
56
45
|
@current_user = Registrar::Middleware::config.handler.call(
|
57
|
-
|
46
|
+
build_current_profile
|
58
47
|
)
|
59
48
|
end
|
60
49
|
|
61
50
|
@current_user
|
62
51
|
end
|
63
52
|
|
53
|
+
def build_current_profile
|
54
|
+
{
|
55
|
+
"provider" => {
|
56
|
+
"name" => "session",
|
57
|
+
"uid" => current_profile_uid
|
58
|
+
}
|
59
|
+
}
|
60
|
+
end
|
61
|
+
|
64
62
|
def current_profile?
|
65
63
|
!!current_profile
|
66
64
|
end
|
@@ -3,7 +3,8 @@ require 'test_helper'
|
|
3
3
|
class CurrentProfileTest < ActionDispatch::IntegrationTest
|
4
4
|
test 'exposes current profile if registrar.profile is avaliable' do
|
5
5
|
get '/'
|
6
|
-
|
7
|
-
|
6
|
+
current_profile = JSON.parse(response.body)
|
7
|
+
expected = {"provider"=>{"name"=>"session", "uid"=>"1"}}
|
8
|
+
assert_equal expected, current_profile
|
8
9
|
end
|
9
10
|
end
|
data/test/dummy/log/test.log
CHANGED
@@ -841,3 +841,40 @@ Started GET "/" for 127.0.0.1 at 2015-06-01 16:55:41 +0200
|
|
841
841
|
Processing by SomeController#index as HTML
|
842
842
|
Rendered text template (0.0ms)
|
843
843
|
Completed 200 OK in 17ms (Views: 2.7ms)
|
844
|
+
----------------------------------------------------------------------------------
|
845
|
+
CurrentProfileTest: test_exposes_current_profile_if_registrar.profile_is_avaliable
|
846
|
+
----------------------------------------------------------------------------------
|
847
|
+
Started GET "/" for 127.0.0.1 at 2015-06-02 11:16:20 +0200
|
848
|
+
Processing by SomeController#index as HTML
|
849
|
+
Completed 500 Internal Server Error in 14ms
|
850
|
+
----------------------------------------------------------------------------------
|
851
|
+
CurrentProfileTest: test_exposes_current_profile_if_registrar.profile_is_avaliable
|
852
|
+
----------------------------------------------------------------------------------
|
853
|
+
Started GET "/" for 127.0.0.1 at 2015-06-02 11:16:48 +0200
|
854
|
+
Processing by SomeController#index as HTML
|
855
|
+
Completed 500 Internal Server Error in 14ms
|
856
|
+
----------------------------------------------------------------------------------
|
857
|
+
CurrentProfileTest: test_exposes_current_profile_if_registrar.profile_is_avaliable
|
858
|
+
----------------------------------------------------------------------------------
|
859
|
+
Started GET "/" for 127.0.0.1 at 2015-06-02 11:18:07 +0200
|
860
|
+
Processing by SomeController#index as HTML
|
861
|
+
Rendered text template (0.0ms)
|
862
|
+
Completed 200 OK in 17ms (Views: 3.0ms)
|
863
|
+
----------------------------------------------------------------------------------
|
864
|
+
CurrentProfileTest: test_exposes_current_profile_if_registrar.profile_is_avaliable
|
865
|
+
----------------------------------------------------------------------------------
|
866
|
+
Started GET "/" for 127.0.0.1 at 2015-06-02 11:18:34 +0200
|
867
|
+
Processing by SomeController#index as HTML
|
868
|
+
Completed 200 OK in 14ms (Views: 0.1ms)
|
869
|
+
----------------------------------------------------------------------------------
|
870
|
+
CurrentProfileTest: test_exposes_current_profile_if_registrar.profile_is_avaliable
|
871
|
+
----------------------------------------------------------------------------------
|
872
|
+
Started GET "/" for 127.0.0.1 at 2015-06-02 11:18:41 +0200
|
873
|
+
Processing by SomeController#index as HTML
|
874
|
+
Completed 200 OK in 14ms (Views: 0.1ms)
|
875
|
+
----------------------------------------------------------------------------------
|
876
|
+
CurrentProfileTest: test_exposes_current_profile_if_registrar.profile_is_avaliable
|
877
|
+
----------------------------------------------------------------------------------
|
878
|
+
Started GET "/" for 127.0.0.1 at 2015-06-02 11:19:44 +0200
|
879
|
+
Processing by SomeController#index as HTML
|
880
|
+
Completed 200 OK in 14ms (Views: 0.2ms)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: registrar-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13.alpha
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Owiesniak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|