File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class << self
13
13
# Method used by Padrino::Application when we register the extension
14
14
#
15
15
def registered ( app )
16
- app . set :session_id , "_padrino_#{ File . basename ( Padrino . root ) } _#{ app . app_name } " . to_sym
16
+ app . set :session_id , "_padrino_#{ File . basename ( Padrino . root ) } _#{ app . app_name } " . to_sym unless app . respond_to? ( :session_id )
17
17
app . set :admin_model , 'Account' unless app . respond_to? ( :admin_model )
18
18
app . helpers Padrino ::Admin ::Helpers ::AuthenticationHelpers
19
19
app . helpers Padrino ::Admin ::Helpers ::ViewHelpers
Original file line number Diff line number Diff line change @@ -6,6 +6,26 @@ def setup
6
6
load_fixture 'data_mapper'
7
7
end
8
8
9
+ describe "session id setting" do
10
+ it "should provide it if it doesn't exist" do
11
+ mock_app do
12
+ register Padrino ::Admin ::AccessControl
13
+ end
14
+
15
+ assert_equal @app . session_id , "_padrino_#{ File . basename ( Padrino . root ) } _#{ @app . app_name } " . to_sym
16
+ end
17
+
18
+ # it "should preserve it if it already existed" do
19
+ # Padrino.configure_apps { enable :sessions; set :session_id, "foo" }
20
+
21
+ # mock_app do
22
+ # register Padrino::Admin::AccessControl
23
+ # end
24
+
25
+ # assert_equal @app.session_id, "foo"
26
+ # end
27
+ end
28
+
9
29
it 'should require correctly login' do
10
30
mock_app do
11
31
register Padrino ::Admin ::AccessControl
You can’t perform that action at this time.
0 commit comments