classiccms 0.3.6 → 0.3.7
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.
data/lib/classiccms/helpers.rb
CHANGED
@@ -8,7 +8,9 @@ module Classiccms
|
|
8
8
|
|
9
9
|
#insert the header for CMS to work
|
10
10
|
def cms
|
11
|
-
|
11
|
+
if defined? @user
|
12
|
+
show :header, views: File.join(Classiccms::ROOT, 'views/cms')
|
13
|
+
end
|
12
14
|
end
|
13
15
|
|
14
16
|
#insert the logout button
|
data/lib/classiccms/version.rb
CHANGED
data/spec/helpers_spec.rb
CHANGED
@@ -28,8 +28,16 @@ describe Classiccms do
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
describe 'cms helper' do
|
31
|
-
it 'should render cms' do
|
31
|
+
it 'should not render cms if not logged in' do
|
32
32
|
with_constants :CONFIG => {:home => 'application/cms'} do
|
33
|
+
set_file 'views/application/cms.haml', "= cms"
|
34
|
+
get '/'
|
35
|
+
last_response.body.should_not match('script')
|
36
|
+
end
|
37
|
+
end
|
38
|
+
it 'should render cms if logged in' do
|
39
|
+
with_constants :CONFIG => {:home => 'application/cms'} do
|
40
|
+
login
|
33
41
|
set_file 'views/application/cms.haml', "= cms"
|
34
42
|
get '/'
|
35
43
|
last_response.body.should match('script')
|
data/spec/lib/routing_spec.rb
CHANGED
@@ -71,5 +71,9 @@ describe Classiccms do
|
|
71
71
|
m2 = Menu.create connections: [Connection.new(parent_id: m1.id)]
|
72
72
|
get_route(m2).should == [m2.id, m1.id]
|
73
73
|
end
|
74
|
+
it 'should return something' do
|
75
|
+
m1 = Menu.create connections: [Connection.new(parent_id: nil)]
|
76
|
+
get_route(m1).should == [m1.id]
|
77
|
+
end
|
74
78
|
end
|
75
79
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: classiccms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|