spud_cms 0.9.7 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/spud_cms/template_parser.rb +2 -3
- data/lib/spud_cms/version.rb +1 -1
- data/spec/dummy/log/test.log +1876 -0
- data/spec/models/spud_menu_item_spec.rb +4 -4
- data/spec/models/spud_page_partial_spec.rb +2 -2
- data/spec/models/spud_page_spec.rb +18 -18
- metadata +4 -6
- data/spec/helpers/spud/admin/snippets_helper_spec.rb +0 -15
@@ -9,22 +9,22 @@ describe SpudMenuItem do
|
|
9
9
|
|
10
10
|
describe :validations do
|
11
11
|
it "should require a name" do
|
12
|
-
p =
|
12
|
+
p = FactoryGirl.build(:spud_menu_item,:name => nil)
|
13
13
|
p.should_not be_valid
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should require a menu_id" do
|
17
|
-
p =
|
17
|
+
p = FactoryGirl.build(:spud_menu_item,:spud_menu_id => nil)
|
18
18
|
p.should_not be_valid
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should require a parent_type" do
|
22
|
-
p =
|
22
|
+
p = FactoryGirl.build(:spud_menu_item,:parent_type => nil)
|
23
23
|
p.should_not be_valid
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should require a parent_id" do
|
27
|
-
p =
|
27
|
+
p = FactoryGirl.build(:spud_menu_item,:parent_id => nil)
|
28
28
|
p.should_not be_valid
|
29
29
|
end
|
30
30
|
end
|
@@ -4,12 +4,12 @@ describe SpudPagePartial do
|
|
4
4
|
describe "validations" do
|
5
5
|
|
6
6
|
it "should require a name" do
|
7
|
-
p =
|
7
|
+
p = FactoryGirl.build(:spud_page_partial,:name => nil)
|
8
8
|
p.should_not be_valid
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should respond with a symbol_name based on name" do
|
12
|
-
p =
|
12
|
+
p = FactoryGirl.build(:spud_page_partial,:name => "Test Page")
|
13
13
|
p.symbol_name.should == "test_page"
|
14
14
|
end
|
15
15
|
end
|
@@ -11,19 +11,19 @@ describe SpudPage do
|
|
11
11
|
describe "validations" do
|
12
12
|
|
13
13
|
it "should require a name" do
|
14
|
-
p =
|
14
|
+
p = FactoryGirl.build(:spud_page,:name => nil)
|
15
15
|
p.should_not be_valid
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should require a unique url_name" do
|
19
19
|
Factory(:spud_page, :url_name => "test", :use_custom_url_name => true)
|
20
|
-
t =
|
20
|
+
t = FactoryGirl.build(:spud_page, :url_name => "test", :use_custom_url_name => true)
|
21
21
|
t.should_not be_valid
|
22
22
|
end
|
23
23
|
|
24
24
|
it "should generate a url_name if taken" do
|
25
25
|
Factory(:spud_page, :name => "test")
|
26
|
-
t =
|
26
|
+
t = FactoryGirl.build(:spud_page, :name => "test")
|
27
27
|
lambda {
|
28
28
|
t.valid?
|
29
29
|
}.should change(t, :url_name)
|
@@ -54,13 +54,13 @@ describe SpudPage do
|
|
54
54
|
end
|
55
55
|
|
56
56
|
it "should group pages by parent" do
|
57
|
-
parent_page =
|
57
|
+
parent_page = FactoryGirl.build(:spud_page,:name => "parent")
|
58
58
|
parent_page.save
|
59
59
|
|
60
|
-
page =
|
60
|
+
page = FactoryGirl.build(:spud_page,:name => "Page 1")
|
61
61
|
page.spud_page = parent_page
|
62
62
|
page.save
|
63
|
-
page2 =
|
63
|
+
page2 = FactoryGirl.build(:spud_page,:name => "Page 2")
|
64
64
|
page2.spud_page = parent_page
|
65
65
|
page2.save
|
66
66
|
|
@@ -70,7 +70,7 @@ describe SpudPage do
|
|
70
70
|
end
|
71
71
|
|
72
72
|
it "should return private if visibility is == 1" do
|
73
|
-
parent_page =
|
73
|
+
parent_page = FactoryGirl.build(:spud_page,:name => "parent",:visibility => 1)
|
74
74
|
|
75
75
|
parent_page.is_private?.should == true
|
76
76
|
|
@@ -84,9 +84,9 @@ describe SpudPage do
|
|
84
84
|
describe "generate_url_name" do
|
85
85
|
it "should add the parent url name if a page has a parent" do
|
86
86
|
# Factory(:spud_page, :name => "test")
|
87
|
-
parent_page =
|
87
|
+
parent_page = FactoryGirl.build(:spud_page,:name => "about")
|
88
88
|
parent_page.save
|
89
|
-
t =
|
89
|
+
t = FactoryGirl.build(:spud_page, :name => "test")
|
90
90
|
t.spud_page = parent_page
|
91
91
|
t.valid?
|
92
92
|
|
@@ -95,29 +95,29 @@ describe SpudPage do
|
|
95
95
|
end
|
96
96
|
|
97
97
|
it "should add a counter to url_name if the url_name is already in use" do
|
98
|
-
page =
|
98
|
+
page = FactoryGirl.build(:spud_page,:name => "testimonials")
|
99
99
|
page.save
|
100
100
|
|
101
|
-
page2 =
|
101
|
+
page2 = FactoryGirl.build(:spud_page,:name => "testimonials")
|
102
102
|
page2.valid?
|
103
103
|
|
104
104
|
page2.url_name.should == 'testimonials-1'
|
105
105
|
end
|
106
106
|
|
107
107
|
it "should add a counter to url_name if the url_name was once in use by another page that was renamed" do
|
108
|
-
page =
|
108
|
+
page = FactoryGirl.build(:spud_page,:name => "another")
|
109
109
|
page.save
|
110
110
|
page.name = "again"
|
111
111
|
page.save
|
112
112
|
|
113
|
-
page2 =
|
113
|
+
page2 = FactoryGirl.build(:spud_page,:name => "another")
|
114
114
|
page2.valid?
|
115
115
|
|
116
116
|
page2.url_name.should == 'another-1'
|
117
117
|
end
|
118
118
|
|
119
119
|
it "should destroy historical permalink if a page is renamed back to its previous name" do
|
120
|
-
page =
|
120
|
+
page = FactoryGirl.build(:spud_page,:name => "permapage")
|
121
121
|
page.save
|
122
122
|
|
123
123
|
page.name = 'permapage new'
|
@@ -133,21 +133,21 @@ describe SpudPage do
|
|
133
133
|
end
|
134
134
|
|
135
135
|
it "should not allow a custom url to be reused by another page" do
|
136
|
-
page =
|
136
|
+
page = FactoryGirl.build(:spud_page,:name => "original")
|
137
137
|
page.save
|
138
138
|
|
139
|
-
page =
|
139
|
+
page = FactoryGirl.build(:spud_page,:name => "new",:use_custom_url_name => true,:url_name => "original")
|
140
140
|
|
141
141
|
page.valid?.should == false
|
142
142
|
end
|
143
143
|
|
144
144
|
it "should not allow a custom url to be reused by another page even if it is a historical permalink" do
|
145
|
-
page =
|
145
|
+
page = FactoryGirl.build(:spud_page,:name => "original")
|
146
146
|
page.save
|
147
147
|
page.name = "original2"
|
148
148
|
page.save
|
149
149
|
|
150
|
-
page =
|
150
|
+
page = FactoryGirl.build(:spud_page,:name => "new")
|
151
151
|
page.save
|
152
152
|
page.use_custom_url_name = true
|
153
153
|
page.url_name = 'original'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spud_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.8
|
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-12-
|
12
|
+
date: 2012-12-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -368,7 +368,6 @@ files:
|
|
368
368
|
- spec/dummy/Rakefile
|
369
369
|
- spec/dummy/README.rdoc
|
370
370
|
- spec/dummy/script/rails
|
371
|
-
- spec/helpers/spud/admin/snippets_helper_spec.rb
|
372
371
|
- spec/helpers/spud/cms/application_helper_spec.rb
|
373
372
|
- spec/models/spud_menu_item_spec.rb
|
374
373
|
- spec/models/spud_page_liquid_tag_spec.rb
|
@@ -392,7 +391,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
392
391
|
version: '0'
|
393
392
|
segments:
|
394
393
|
- 0
|
395
|
-
hash:
|
394
|
+
hash: 3010547608925371015
|
396
395
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
397
396
|
none: false
|
398
397
|
requirements:
|
@@ -401,7 +400,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
401
400
|
version: '0'
|
402
401
|
segments:
|
403
402
|
- 0
|
404
|
-
hash:
|
403
|
+
hash: 3010547608925371015
|
405
404
|
requirements: []
|
406
405
|
rubyforge_project:
|
407
406
|
rubygems_version: 1.8.24
|
@@ -455,7 +454,6 @@ test_files:
|
|
455
454
|
- spec/dummy/Rakefile
|
456
455
|
- spec/dummy/README.rdoc
|
457
456
|
- spec/dummy/script/rails
|
458
|
-
- spec/helpers/spud/admin/snippets_helper_spec.rb
|
459
457
|
- spec/helpers/spud/cms/application_helper_spec.rb
|
460
458
|
- spec/models/spud_menu_item_spec.rb
|
461
459
|
- spec/models/spud_page_liquid_tag_spec.rb
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
# Specs in this file have access to a helper object that includes
|
4
|
-
# the Spud::Admin::SnippetsHelper. For example:
|
5
|
-
#
|
6
|
-
# describe Spud::Admin::SnippetsHelper do
|
7
|
-
# describe "string concat" do
|
8
|
-
# it "concats two strings with spaces" do
|
9
|
-
# helper.concat_strings("this","that").should == "this that"
|
10
|
-
# end
|
11
|
-
# end
|
12
|
-
# end
|
13
|
-
describe Spud::Admin::SnippetsHelper do
|
14
|
-
pending "add some examples to (or delete) #{__FILE__}"
|
15
|
-
end
|