comfortable_mexican_sofa 1.0.51 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -18
- data/Rakefile +1 -4
- data/VERSION +1 -1
- data/app/controllers/cms_admin/base_controller.rb +8 -9
- data/app/controllers/cms_admin/layouts_controller.rb +5 -5
- data/app/controllers/cms_admin/pages_controller.rb +14 -14
- data/app/controllers/cms_admin/sites_controller.rb +4 -4
- data/app/controllers/cms_admin/snippets_controller.rb +4 -4
- data/app/controllers/cms_admin/uploads_controller.rb +2 -2
- data/app/controllers/cms_content_controller.rb +21 -8
- data/app/models/cms/block.rb +13 -0
- data/app/models/{cms_layout.rb → cms/layout.rb} +16 -44
- data/app/models/{cms_page.rb → cms/page.rb} +26 -57
- data/app/models/{cms_site.rb → cms/site.rb} +8 -6
- data/app/models/cms/snippet.rb +36 -0
- data/app/models/{cms_upload.rb → cms/upload.rb} +5 -3
- data/app/views/cms_admin/layouts/_form.html.erb +2 -2
- data/app/views/cms_admin/pages/_form.html.erb +5 -5
- data/app/views/cms_admin/pages/_form_blocks.html.erb +3 -3
- data/app/views/cms_admin/uploads/_index.html.erb +1 -1
- data/app/views/layouts/cms_admin.html.erb +2 -38
- data/app/views/layouts/cms_admin/_body.html.erb +17 -0
- data/app/views/layouts/cms_admin/_center.html.erb +6 -0
- data/app/views/layouts/cms_admin/_head.html.erb +11 -0
- data/app/views/layouts/cms_admin/_left.html.erb +7 -0
- data/app/views/layouts/cms_admin/_right.html.erb +1 -0
- data/comfortable_mexican_sofa.gemspec +94 -96
- data/config/environments/development.rb +1 -1
- data/config/environments/production.rb +1 -1
- data/config/environments/test.rb +1 -1
- data/config/initializers/comfortable_mexican_sofa.rb +10 -12
- data/db/cms_fixtures/example.com/layouts/default/_default.yml +1 -0
- data/db/cms_fixtures/example.com/layouts/default/content.html +5 -0
- data/db/cms_fixtures/example.com/layouts/default/css.css +1 -0
- data/db/cms_fixtures/example.com/layouts/default/js.js +1 -0
- data/db/cms_fixtures/example.com/layouts/default/nested/_nested.yml +1 -0
- data/db/cms_fixtures/example.com/layouts/default/nested/content.html +2 -0
- data/db/cms_fixtures/example.com/layouts/default/nested/css.css +1 -0
- data/db/cms_fixtures/example.com/layouts/default/nested/js.js +1 -0
- data/db/cms_fixtures/example.com/pages/index/_index.yml +2 -0
- data/db/cms_fixtures/example.com/pages/index/child/_child.yml +2 -0
- data/db/cms_fixtures/example.com/pages/index/child/left.html +1 -0
- data/db/cms_fixtures/example.com/pages/index/child/right.html +1 -0
- data/db/cms_fixtures/example.com/pages/index/content.html +2 -0
- data/db/cms_fixtures/example.com/snippets/default/_default.yml +1 -0
- data/db/cms_fixtures/example.com/snippets/default/content.html +1 -0
- data/db/migrate/01_create_cms.rb +11 -11
- data/db/migrate/upgrades/02_upgrade_to_1_1_0.rb +19 -0
- data/lib/comfortable_mexican_sofa.rb +6 -13
- data/lib/comfortable_mexican_sofa/configuration.rb +21 -20
- data/lib/comfortable_mexican_sofa/controller_methods.rb +3 -4
- data/lib/comfortable_mexican_sofa/engine.rb +1 -1
- data/lib/comfortable_mexican_sofa/fixtures.rb +155 -0
- data/lib/comfortable_mexican_sofa/form_builder.rb +7 -15
- data/lib/comfortable_mexican_sofa/{cms_tag.rb → tag.rb} +42 -23
- data/lib/comfortable_mexican_sofa/{cms_tag → tags}/field_datetime.rb +4 -5
- data/lib/comfortable_mexican_sofa/{cms_tag → tags}/field_integer.rb +4 -5
- data/lib/comfortable_mexican_sofa/{cms_tag → tags}/field_string.rb +4 -5
- data/lib/comfortable_mexican_sofa/{cms_tag → tags}/field_text.rb +4 -5
- data/lib/comfortable_mexican_sofa/{cms_tag → tags}/helper.rb +2 -5
- data/lib/comfortable_mexican_sofa/{cms_tag → tags}/page_datetime.rb +4 -5
- data/lib/comfortable_mexican_sofa/{cms_tag → tags}/page_integer.rb +4 -5
- data/lib/comfortable_mexican_sofa/{cms_tag → tags}/page_rich_text.rb +4 -5
- data/lib/comfortable_mexican_sofa/{cms_tag → tags}/page_string.rb +4 -5
- data/lib/comfortable_mexican_sofa/{cms_tag → tags}/page_text.rb +4 -5
- data/lib/comfortable_mexican_sofa/{cms_tag → tags}/partial.rb +2 -5
- data/lib/comfortable_mexican_sofa/tags/snippet.rb +13 -0
- data/lib/comfortable_mexican_sofa/view_methods.rb +4 -3
- data/lib/generators/cms_generator.rb +1 -1
- data/lib/tasks/comfortable_mexican_sofa.rake +12 -272
- data/public/javascripts/comfortable_mexican_sofa/cms.js +1 -1
- data/test/fixtures/{cms_blocks.yml → cms/blocks.yml} +2 -2
- data/test/fixtures/{cms_layouts.yml → cms/layouts.yml} +3 -3
- data/test/fixtures/{cms_pages.yml → cms/pages.yml} +4 -4
- data/test/fixtures/{cms_sites.yml → cms/sites.yml} +0 -0
- data/test/fixtures/{cms_snippets.yml → cms/snippets.yml} +1 -1
- data/test/fixtures/{cms_uploads.yml → cms/uploads.yml} +1 -1
- data/test/functional/cms_admin/layouts_controller_test.rb +6 -6
- data/test/functional/cms_admin/pages_controller_test.rb +64 -64
- data/test/functional/cms_admin/sites_controller_test.rb +5 -5
- data/test/functional/cms_admin/snippets_controller_test.rb +6 -6
- data/test/functional/cms_admin/uploads_controller_test.rb +4 -4
- data/test/functional/cms_content_controller_test.rb +27 -11
- data/test/integration/fixtures_test.rb +43 -0
- data/test/integration/sites_test.rb +23 -13
- data/test/test_helper.rb +9 -8
- data/test/unit/{cms_configuration_test.rb → configuration_test.rb} +5 -3
- data/test/unit/fixtures_test.rb +198 -0
- data/test/unit/models/block_test.rb +33 -0
- data/test/unit/models/layout_test.rb +129 -0
- data/test/unit/models/page_test.rb +199 -0
- data/test/unit/models/site_test.rb +41 -0
- data/test/unit/models/snippet_test.rb +32 -0
- data/test/unit/models/upload_test.rb +32 -0
- data/test/unit/{cms_tag_test.rb → tag_test.rb} +61 -44
- data/test/unit/tags/field_datetime_test.rb +44 -0
- data/test/unit/tags/field_integer_test.rb +43 -0
- data/test/unit/tags/field_string_test.rb +46 -0
- data/test/unit/tags/field_text_test.rb +42 -0
- data/test/unit/{cms_tags → tags}/helper_test.rb +18 -6
- data/test/unit/tags/page_datetime_test.rb +44 -0
- data/test/unit/tags/page_integer_test.rb +43 -0
- data/test/unit/tags/page_rich_text.rb +43 -0
- data/test/unit/{cms_tags → tags}/page_string_test.rb +15 -5
- data/test/unit/tags/page_text_test.rb +46 -0
- data/test/unit/{cms_tags → tags}/partial_test.rb +24 -8
- data/test/unit/tags/snippet_test.rb +45 -0
- data/test/unit/view_methods_test.rb +2 -2
- metadata +95 -121
- data/app/models/cms_block.rb +0 -28
- data/app/models/cms_snippet.rb +0 -69
- data/db/cms_seeds/example.local/layouts/default.yml +0 -8
- data/db/cms_seeds/example.local/layouts/nested.yml +0 -6
- data/db/cms_seeds/example.local/pages/child.yml +0 -10
- data/db/cms_seeds/example.local/pages/child/subchild.yml +0 -14
- data/db/cms_seeds/example.local/pages/index.yml +0 -11
- data/db/cms_seeds/example.local/snippets/example.yml +0 -4
- data/lib/comfortable_mexican_sofa/cms_tag/snippet.rb +0 -18
- data/test/cms_seeds/test.host/layouts/broken.yml +0 -1
- data/test/cms_seeds/test.host/layouts/default.yml +0 -3
- data/test/cms_seeds/test.host/layouts/nested.yml +0 -4
- data/test/cms_seeds/test.host/pages/broken.yml +0 -1
- data/test/cms_seeds/test.host/pages/child.yml +0 -10
- data/test/cms_seeds/test.host/pages/child/subchild.yml +0 -10
- data/test/cms_seeds/test.host/pages/index.yml +0 -10
- data/test/cms_seeds/test.host/snippets/broken.yml +0 -1
- data/test/cms_seeds/test.host/snippets/default.yml +0 -3
- data/test/integration/rake_tasks_test.rb +0 -65
- data/test/integration/render_cms_seed_test.rb +0 -34
- data/test/unit/cms_block_test.rb +0 -43
- data/test/unit/cms_layout_test.rb +0 -179
- data/test/unit/cms_page_test.rb +0 -257
- data/test/unit/cms_site_test.rb +0 -41
- data/test/unit/cms_snippet_test.rb +0 -77
- data/test/unit/cms_tags/field_datetime_test.rb +0 -34
- data/test/unit/cms_tags/field_integer_test.rb +0 -33
- data/test/unit/cms_tags/field_string_test.rb +0 -34
- data/test/unit/cms_tags/field_text_test.rb +0 -32
- data/test/unit/cms_tags/page_datetime_test.rb +0 -34
- data/test/unit/cms_tags/page_integer_test.rb +0 -33
- data/test/unit/cms_tags/page_rich_text.rb +0 -33
- data/test/unit/cms_tags/page_text_test.rb +0 -34
- data/test/unit/cms_tags/snippet_test.rb +0 -33
- data/test/unit/cms_upload_test.rb +0 -26
@@ -0,0 +1,43 @@
|
|
1
|
+
require File.expand_path('../../test_helper', File.dirname(__FILE__))
|
2
|
+
|
3
|
+
class PageIntegerTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
def test_initialize_tag
|
6
|
+
assert tag = ComfortableMexicanSofa::Tag::PageInteger.initialize_tag(
|
7
|
+
cms_pages(:default), '{{ cms:page:content:integer }}'
|
8
|
+
)
|
9
|
+
assert_equal 'content', tag.label
|
10
|
+
assert tag = ComfortableMexicanSofa::Tag::PageInteger.initialize_tag(
|
11
|
+
cms_pages(:default), '{{cms:page:content:integer}}'
|
12
|
+
)
|
13
|
+
assert_equal 'content', tag.label
|
14
|
+
assert tag = ComfortableMexicanSofa::Tag::PageInteger.initialize_tag(
|
15
|
+
cms_pages(:default), '{{cms:page:dash-content:integer}}'
|
16
|
+
)
|
17
|
+
assert_equal 'dash-content', tag.label
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_initialize_tag_failure
|
21
|
+
[
|
22
|
+
'{{cms:page:content:not_integer}}',
|
23
|
+
'{{cms:page:content}}',
|
24
|
+
'{{cms:not_page:content}}',
|
25
|
+
'{not_a_tag}'
|
26
|
+
].each do |tag_signature|
|
27
|
+
assert_nil ComfortableMexicanSofa::Tag::PageInteger.initialize_tag(
|
28
|
+
cms_pages(:default), tag_signature
|
29
|
+
)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_content_and_render
|
34
|
+
tag = ComfortableMexicanSofa::Tag::PageInteger.initialize_tag(
|
35
|
+
cms_pages(:default), '{{cms:page:content:integer}}'
|
36
|
+
)
|
37
|
+
assert tag.content.blank?
|
38
|
+
tag.content = '5'
|
39
|
+
assert_equal '5', tag.content
|
40
|
+
assert_equal '5', tag.render
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require File.expand_path('../../test_helper', File.dirname(__FILE__))
|
2
|
+
|
3
|
+
class PageRichTextTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
def test_initialize_tag
|
6
|
+
assert tag = ComfortableMexicanSofa::Tag::PageRichText.initialize_tag(
|
7
|
+
cms_pages(:default), '{{ cms:page:content:rich_text }}'
|
8
|
+
)
|
9
|
+
assert_equal 'content', tag.label
|
10
|
+
assert tag = ComfortableMexicanSofa::Tag::PageRichText.initialize_tag(
|
11
|
+
cms_pages(:default), '{{cms:page:content:rich_text}}'
|
12
|
+
)
|
13
|
+
assert_equal 'content', tag.label
|
14
|
+
assert tag = ComfortableMexicanSofa::Tag::PageRichText.initialize_tag(
|
15
|
+
cms_pages(:default), '{{cms:page:dash-content:rich_text}}'
|
16
|
+
)
|
17
|
+
assert_equal 'dash-content', tag.label
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_initialize_tag_failure
|
21
|
+
[
|
22
|
+
'{{cms:page:content:not_rich_text}}',
|
23
|
+
'{{cms:page:content}}',
|
24
|
+
'{{cms:not_page:content}}',
|
25
|
+
'{not_a_tag}'
|
26
|
+
].each do |tag_signature|
|
27
|
+
assert_nil ComfortableMexicanSofa::Tag::PageRichText.initialize_tag(
|
28
|
+
cms_pages(:default), tag_signature
|
29
|
+
)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_content_and_render
|
34
|
+
tag = ComfortableMexicanSofa::Tag::PageRichText.initialize_tag(
|
35
|
+
cms_pages(:default), '{{cms:page:content:rich_text}}'
|
36
|
+
)
|
37
|
+
assert tag.content.blank?
|
38
|
+
tag.content = 'test_content'
|
39
|
+
assert_equal 'test_content', tag.content
|
40
|
+
assert_equal 'test_content', tag.render
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
@@ -3,11 +3,17 @@ require File.expand_path('../../test_helper', File.dirname(__FILE__))
|
|
3
3
|
class PageStringTest < ActiveSupport::TestCase
|
4
4
|
|
5
5
|
def test_initialize_tag
|
6
|
-
assert tag =
|
6
|
+
assert tag = ComfortableMexicanSofa::Tag::PageString.initialize_tag(
|
7
|
+
cms_pages(:default), '{{ cms:page:content:string }}'
|
8
|
+
)
|
7
9
|
assert_equal 'content', tag.label
|
8
|
-
assert tag =
|
10
|
+
assert tag = ComfortableMexicanSofa::Tag::PageString.initialize_tag(
|
11
|
+
cms_pages(:default), '{{cms:page:content:string}}'
|
12
|
+
)
|
9
13
|
assert_equal 'content', tag.label
|
10
|
-
assert tag =
|
14
|
+
assert tag = ComfortableMexicanSofa::Tag::PageString.initialize_tag(
|
15
|
+
cms_pages(:default), '{{cms:page:dash-content:string}}'
|
16
|
+
)
|
11
17
|
assert_equal 'dash-content', tag.label
|
12
18
|
end
|
13
19
|
|
@@ -18,12 +24,16 @@ class PageStringTest < ActiveSupport::TestCase
|
|
18
24
|
'{{cms:not_page:content}}',
|
19
25
|
'{not_a_tag}'
|
20
26
|
].each do |tag_signature|
|
21
|
-
assert_nil
|
27
|
+
assert_nil ComfortableMexicanSofa::Tag::PageString.initialize_tag(
|
28
|
+
cms_pages(:default), tag_signature
|
29
|
+
)
|
22
30
|
end
|
23
31
|
end
|
24
32
|
|
25
33
|
def test_content_and_render
|
26
|
-
tag =
|
34
|
+
tag = ComfortableMexicanSofa::Tag::PageString.initialize_tag(
|
35
|
+
cms_pages(:default), '{{cms:page:content:string}}'
|
36
|
+
)
|
27
37
|
assert tag.content.blank?
|
28
38
|
tag.content = 'test_content'
|
29
39
|
assert_equal 'test_content', tag.content
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require File.expand_path('../../test_helper', File.dirname(__FILE__))
|
2
|
+
|
3
|
+
class PageTextTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
def test_initialize_tag
|
6
|
+
assert tag = ComfortableMexicanSofa::Tag::PageText.initialize_tag(
|
7
|
+
cms_pages(:default), '{{ cms:page:content:text }}'
|
8
|
+
)
|
9
|
+
assert_equal 'content', tag.label
|
10
|
+
assert tag = ComfortableMexicanSofa::Tag::PageText.initialize_tag(
|
11
|
+
cms_pages(:default), '{{cms:page:content}}'
|
12
|
+
)
|
13
|
+
assert_equal 'content', tag.label
|
14
|
+
assert tag = ComfortableMexicanSofa::Tag::PageText.initialize_tag(
|
15
|
+
cms_pages(:default), '{{cms:page:content:text}}'
|
16
|
+
)
|
17
|
+
assert_equal 'content', tag.label
|
18
|
+
assert tag = ComfortableMexicanSofa::Tag::PageText.initialize_tag(
|
19
|
+
cms_pages(:default), '{{cms:page:dash-content}}'
|
20
|
+
)
|
21
|
+
assert_equal 'dash-content', tag.label
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_initialize_tag_failure
|
25
|
+
[
|
26
|
+
'{{cms:page:content:not_text}}',
|
27
|
+
'{{cms:not_page:content}}',
|
28
|
+
'{not_a_tag}'
|
29
|
+
].each do |tag_signature|
|
30
|
+
assert_nil ComfortableMexicanSofa::Tag::PageText.initialize_tag(
|
31
|
+
cms_pages(:default), tag_signature
|
32
|
+
)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_content_and_render
|
37
|
+
tag = ComfortableMexicanSofa::Tag::PageText.initialize_tag(
|
38
|
+
cms_pages(:default), '{{cms:page:content}}'
|
39
|
+
)
|
40
|
+
assert tag.content.blank?
|
41
|
+
tag.content = 'test_content'
|
42
|
+
assert_equal 'test_content', tag.content
|
43
|
+
assert_equal 'test_content', tag.render
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
@@ -3,16 +3,24 @@ require File.expand_path('../../test_helper', File.dirname(__FILE__))
|
|
3
3
|
class PartialTest < ActiveSupport::TestCase
|
4
4
|
|
5
5
|
def test_initialize_tag
|
6
|
-
assert tag =
|
6
|
+
assert tag = ComfortableMexicanSofa::Tag::Partial.initialize_tag(
|
7
|
+
cms_pages(:default), '{{ cms:partial:partial_name }}'
|
8
|
+
)
|
7
9
|
assert_equal 'partial_name', tag.label
|
8
|
-
assert tag =
|
10
|
+
assert tag = ComfortableMexicanSofa::Tag::Partial.initialize_tag(
|
11
|
+
cms_pages(:default), '{{cms:partial:path/to/partial}}'
|
12
|
+
)
|
9
13
|
assert_equal 'path/to/partial', tag.label
|
10
|
-
assert tag =
|
14
|
+
assert tag = ComfortableMexicanSofa::Tag::Partial.initialize_tag(
|
15
|
+
cms_pages(:default), '{{cms:partial:path/to/dashed-partial}}'
|
16
|
+
)
|
11
17
|
assert_equal 'path/to/dashed-partial', tag.label
|
12
18
|
end
|
13
19
|
|
14
20
|
def test_initialize_tag_with_parameters
|
15
|
-
assert tag =
|
21
|
+
assert tag = ComfortableMexicanSofa::Tag::Partial.initialize_tag(
|
22
|
+
cms_pages(:default), '{{cms:partial:path/to/partial:param1:param2}}'
|
23
|
+
)
|
16
24
|
assert tag.label = 'path/to/partial'
|
17
25
|
assert tag.params = 'param1:param2'
|
18
26
|
end
|
@@ -23,20 +31,28 @@ class PartialTest < ActiveSupport::TestCase
|
|
23
31
|
'{{cms:not_partial:label}}',
|
24
32
|
'{not_a_tag}'
|
25
33
|
].each do |tag_signature|
|
26
|
-
assert_nil
|
34
|
+
assert_nil ComfortableMexicanSofa::Tag::Partial.initialize_tag(
|
35
|
+
cms_pages(:default), tag_signature
|
36
|
+
)
|
27
37
|
end
|
28
38
|
end
|
29
39
|
|
30
40
|
def test_content_and_render
|
31
|
-
tag =
|
41
|
+
tag = ComfortableMexicanSofa::Tag::Partial.initialize_tag(
|
42
|
+
cms_pages(:default), '{{cms:partial:path/to/partial}}'
|
43
|
+
)
|
32
44
|
assert_equal "<%= render :partial => 'path/to/partial' %>", tag.content
|
33
45
|
assert_equal "<%= render :partial => 'path/to/partial' %>", tag.render
|
34
46
|
|
35
|
-
tag =
|
47
|
+
tag = ComfortableMexicanSofa::Tag::Partial.initialize_tag(
|
48
|
+
cms_pages(:default), '{{cms:partial:path/to/partial:param1}}'
|
49
|
+
)
|
36
50
|
assert_equal "<%= render :partial => 'path/to/partial', :locals => {:param_1 => 'param1'} %>", tag.content
|
37
51
|
assert_equal "<%= render :partial => 'path/to/partial', :locals => {:param_1 => 'param1'} %>", tag.render
|
38
52
|
|
39
|
-
tag =
|
53
|
+
tag = ComfortableMexicanSofa::Tag::Partial.initialize_tag(
|
54
|
+
cms_pages(:default), '{{cms:partial:path/to/partial:param1:param2}}'
|
55
|
+
)
|
40
56
|
assert_equal "<%= render :partial => 'path/to/partial', :locals => {:param_1 => 'param1', :param_2 => 'param2'} %>", tag.content
|
41
57
|
assert_equal "<%= render :partial => 'path/to/partial', :locals => {:param_1 => 'param1', :param_2 => 'param2'} %>", tag.render
|
42
58
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.expand_path('../../test_helper', File.dirname(__FILE__))
|
2
|
+
|
3
|
+
class SnippetTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
def test_initialize_tag
|
6
|
+
assert tag = ComfortableMexicanSofa::Tag::Snippet.initialize_tag(
|
7
|
+
cms_pages(:default), '{{ cms:snippet:label }}'
|
8
|
+
)
|
9
|
+
assert_equal 'label', tag.label
|
10
|
+
assert tag = ComfortableMexicanSofa::Tag::Snippet.initialize_tag(
|
11
|
+
cms_pages(:default), '{{cms:snippet:label}}'
|
12
|
+
)
|
13
|
+
assert_equal 'label', tag.label
|
14
|
+
assert tag = ComfortableMexicanSofa::Tag::Snippet.initialize_tag(
|
15
|
+
cms_pages(:default), '{{cms:snippet:dash-label}}'
|
16
|
+
)
|
17
|
+
assert_equal 'dash-label', tag.label
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_initialize_tag_failure
|
21
|
+
[
|
22
|
+
'{{cms:snippet}}',
|
23
|
+
'{{cms:not_snippet:label}}',
|
24
|
+
'{not_a_tag}'
|
25
|
+
].each do |tag_signature|
|
26
|
+
assert_nil ComfortableMexicanSofa::Tag::Snippet.initialize_tag(
|
27
|
+
cms_pages(:default), tag_signature
|
28
|
+
)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_content_and_render
|
33
|
+
tag = ComfortableMexicanSofa::Tag::Snippet.initialize_tag(
|
34
|
+
cms_pages(:default), '{{cms:snippet:default}}'
|
35
|
+
)
|
36
|
+
assert_equal 'default_snippet_content', tag.content
|
37
|
+
assert_equal 'default_snippet_content', tag.render
|
38
|
+
|
39
|
+
tag = ComfortableMexicanSofa::Tag::Snippet.initialize_tag(
|
40
|
+
cms_pages(:default), "{{cms:snippet:doesnot_exist}}"
|
41
|
+
)
|
42
|
+
assert_equal nil, tag.content
|
43
|
+
assert_equal '', tag.render
|
44
|
+
end
|
45
|
+
end
|
@@ -5,8 +5,8 @@ class ViewMethodsTest < ActiveSupport::TestCase
|
|
5
5
|
include ComfortableMexicanSofa::ViewMethods
|
6
6
|
|
7
7
|
def test_cms_snippet_content
|
8
|
-
assert_equal 'default_snippet_content', cms_snippet_content('default')
|
9
|
-
assert_equal '', cms_snippet_content('not_found')
|
8
|
+
assert_equal 'default_snippet_content', cms_snippet_content('default', cms_sites(:default))
|
9
|
+
assert_equal '', cms_snippet_content('not_found', cms_sites(:default))
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_cms_page_content
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: comfortable_mexican_sofa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.
|
5
|
+
version: 1.1.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Oleg Khabarov
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2011-
|
14
|
+
date: 2011-05-02 00:00:00 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
@@ -68,39 +68,6 @@ dependencies:
|
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: *id005
|
71
|
-
- !ruby/object:Gem::Dependency
|
72
|
-
name: rails
|
73
|
-
requirement: &id006 !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
|
-
requirements:
|
76
|
-
- - ">="
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version: 3.0.3
|
79
|
-
type: :runtime
|
80
|
-
prerelease: false
|
81
|
-
version_requirements: *id006
|
82
|
-
- !ruby/object:Gem::Dependency
|
83
|
-
name: active_link_to
|
84
|
-
requirement: &id007 !ruby/object:Gem::Requirement
|
85
|
-
none: false
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 0.0.6
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: *id007
|
93
|
-
- !ruby/object:Gem::Dependency
|
94
|
-
name: paperclip
|
95
|
-
requirement: &id008 !ruby/object:Gem::Requirement
|
96
|
-
none: false
|
97
|
-
requirements:
|
98
|
-
- - ">="
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
version: 2.3.8
|
101
|
-
type: :runtime
|
102
|
-
prerelease: false
|
103
|
-
version_requirements: *id008
|
104
71
|
description: ""
|
105
72
|
email: oleg@theworkinggroup.ca
|
106
73
|
executables: []
|
@@ -126,12 +93,12 @@ files:
|
|
126
93
|
- app/controllers/cms_admin/snippets_controller.rb
|
127
94
|
- app/controllers/cms_admin/uploads_controller.rb
|
128
95
|
- app/controllers/cms_content_controller.rb
|
129
|
-
- app/models/
|
130
|
-
- app/models/
|
131
|
-
- app/models/
|
132
|
-
- app/models/
|
133
|
-
- app/models/
|
134
|
-
- app/models/
|
96
|
+
- app/models/cms/block.rb
|
97
|
+
- app/models/cms/layout.rb
|
98
|
+
- app/models/cms/page.rb
|
99
|
+
- app/models/cms/site.rb
|
100
|
+
- app/models/cms/snippet.rb
|
101
|
+
- app/models/cms/upload.rb
|
135
102
|
- app/views/cms_admin/layouts/_form.html.erb
|
136
103
|
- app/views/cms_admin/layouts/_index_branch.html.erb
|
137
104
|
- app/views/cms_admin/layouts/edit.html.erb
|
@@ -157,6 +124,11 @@ files:
|
|
157
124
|
- app/views/cms_admin/uploads/_index.html.erb
|
158
125
|
- app/views/cms_admin/uploads/destroy.js.erb
|
159
126
|
- app/views/layouts/cms_admin.html.erb
|
127
|
+
- app/views/layouts/cms_admin/_body.html.erb
|
128
|
+
- app/views/layouts/cms_admin/_center.html.erb
|
129
|
+
- app/views/layouts/cms_admin/_head.html.erb
|
130
|
+
- app/views/layouts/cms_admin/_left.html.erb
|
131
|
+
- app/views/layouts/cms_admin/_right.html.erb
|
160
132
|
- comfortable_mexican_sofa.gemspec
|
161
133
|
- config.ru
|
162
134
|
- config/application.rb
|
@@ -171,37 +143,48 @@ files:
|
|
171
143
|
- config/initializers/paperclip.rb
|
172
144
|
- config/locales/en.yml
|
173
145
|
- config/routes.rb
|
174
|
-
- db/
|
175
|
-
- db/
|
176
|
-
- db/
|
177
|
-
- db/
|
178
|
-
- db/
|
179
|
-
- db/
|
146
|
+
- db/cms_fixtures/example.com/layouts/default/_default.yml
|
147
|
+
- db/cms_fixtures/example.com/layouts/default/content.html
|
148
|
+
- db/cms_fixtures/example.com/layouts/default/css.css
|
149
|
+
- db/cms_fixtures/example.com/layouts/default/js.js
|
150
|
+
- db/cms_fixtures/example.com/layouts/default/nested/_nested.yml
|
151
|
+
- db/cms_fixtures/example.com/layouts/default/nested/content.html
|
152
|
+
- db/cms_fixtures/example.com/layouts/default/nested/css.css
|
153
|
+
- db/cms_fixtures/example.com/layouts/default/nested/js.js
|
154
|
+
- db/cms_fixtures/example.com/pages/index/_index.yml
|
155
|
+
- db/cms_fixtures/example.com/pages/index/child/_child.yml
|
156
|
+
- db/cms_fixtures/example.com/pages/index/child/left.html
|
157
|
+
- db/cms_fixtures/example.com/pages/index/child/right.html
|
158
|
+
- db/cms_fixtures/example.com/pages/index/content.html
|
159
|
+
- db/cms_fixtures/example.com/snippets/default/_default.yml
|
160
|
+
- db/cms_fixtures/example.com/snippets/default/content.html
|
180
161
|
- db/migrate/01_create_cms.rb
|
162
|
+
- db/migrate/upgrades/02_upgrade_to_1_1_0.rb
|
181
163
|
- db/seeds.rb
|
182
164
|
- doc/page_editing.png
|
183
165
|
- doc/sofa.png
|
184
166
|
- lib/comfortable_mexican_sofa.rb
|
185
167
|
- lib/comfortable_mexican_sofa/acts_as_tree.rb
|
186
|
-
- lib/comfortable_mexican_sofa/cms_tag.rb
|
187
|
-
- lib/comfortable_mexican_sofa/cms_tag/field_datetime.rb
|
188
|
-
- lib/comfortable_mexican_sofa/cms_tag/field_integer.rb
|
189
|
-
- lib/comfortable_mexican_sofa/cms_tag/field_string.rb
|
190
|
-
- lib/comfortable_mexican_sofa/cms_tag/field_text.rb
|
191
|
-
- lib/comfortable_mexican_sofa/cms_tag/helper.rb
|
192
|
-
- lib/comfortable_mexican_sofa/cms_tag/page_datetime.rb
|
193
|
-
- lib/comfortable_mexican_sofa/cms_tag/page_integer.rb
|
194
|
-
- lib/comfortable_mexican_sofa/cms_tag/page_rich_text.rb
|
195
|
-
- lib/comfortable_mexican_sofa/cms_tag/page_string.rb
|
196
|
-
- lib/comfortable_mexican_sofa/cms_tag/page_text.rb
|
197
|
-
- lib/comfortable_mexican_sofa/cms_tag/partial.rb
|
198
|
-
- lib/comfortable_mexican_sofa/cms_tag/snippet.rb
|
199
168
|
- lib/comfortable_mexican_sofa/configuration.rb
|
200
169
|
- lib/comfortable_mexican_sofa/controller_methods.rb
|
201
170
|
- lib/comfortable_mexican_sofa/engine.rb
|
171
|
+
- lib/comfortable_mexican_sofa/fixtures.rb
|
202
172
|
- lib/comfortable_mexican_sofa/form_builder.rb
|
203
173
|
- lib/comfortable_mexican_sofa/http_auth.rb
|
204
174
|
- lib/comfortable_mexican_sofa/rails_extensions.rb
|
175
|
+
- lib/comfortable_mexican_sofa/tag.rb
|
176
|
+
- lib/comfortable_mexican_sofa/tags/field_datetime.rb
|
177
|
+
- lib/comfortable_mexican_sofa/tags/field_integer.rb
|
178
|
+
- lib/comfortable_mexican_sofa/tags/field_string.rb
|
179
|
+
- lib/comfortable_mexican_sofa/tags/field_text.rb
|
180
|
+
- lib/comfortable_mexican_sofa/tags/helper.rb
|
181
|
+
- lib/comfortable_mexican_sofa/tags/page_datetime.rb
|
182
|
+
- lib/comfortable_mexican_sofa/tags/page_integer.rb
|
183
|
+
- lib/comfortable_mexican_sofa/tags/page_rich_text.rb
|
184
|
+
- lib/comfortable_mexican_sofa/tags/page_string.rb
|
185
|
+
- lib/comfortable_mexican_sofa/tags/page_text.rb
|
186
|
+
- lib/comfortable_mexican_sofa/tags/partial.rb
|
187
|
+
- lib/comfortable_mexican_sofa/tags/snippet.rb
|
205
188
|
- lib/comfortable_mexican_sofa/view_hooks.rb
|
206
189
|
- lib/comfortable_mexican_sofa/view_methods.rb
|
207
190
|
- lib/generators/README
|
@@ -284,21 +267,12 @@ files:
|
|
284
267
|
- public/stylesheets/comfortable_mexican_sofa/structure.css
|
285
268
|
- public/stylesheets/comfortable_mexican_sofa/typography.css
|
286
269
|
- script/rails
|
287
|
-
- test/
|
288
|
-
- test/
|
289
|
-
- test/
|
290
|
-
- test/
|
291
|
-
- test/
|
292
|
-
- test/
|
293
|
-
- test/cms_seeds/test.host/pages/index.yml
|
294
|
-
- test/cms_seeds/test.host/snippets/broken.yml
|
295
|
-
- test/cms_seeds/test.host/snippets/default.yml
|
296
|
-
- test/fixtures/cms_blocks.yml
|
297
|
-
- test/fixtures/cms_layouts.yml
|
298
|
-
- test/fixtures/cms_pages.yml
|
299
|
-
- test/fixtures/cms_sites.yml
|
300
|
-
- test/fixtures/cms_snippets.yml
|
301
|
-
- test/fixtures/cms_uploads.yml
|
270
|
+
- test/fixtures/cms/blocks.yml
|
271
|
+
- test/fixtures/cms/layouts.yml
|
272
|
+
- test/fixtures/cms/pages.yml
|
273
|
+
- test/fixtures/cms/sites.yml
|
274
|
+
- test/fixtures/cms/snippets.yml
|
275
|
+
- test/fixtures/cms/uploads.yml
|
302
276
|
- test/fixtures/files/invalid_file.gif
|
303
277
|
- test/fixtures/files/valid_image.jpg
|
304
278
|
- test/fixtures/views/_nav_hook.html.erb
|
@@ -310,32 +284,32 @@ files:
|
|
310
284
|
- test/functional/cms_admin/uploads_controller_test.rb
|
311
285
|
- test/functional/cms_content_controller_test.rb
|
312
286
|
- test/integration/authentication_test.rb
|
313
|
-
- test/integration/
|
314
|
-
- test/integration/render_cms_seed_test.rb
|
287
|
+
- test/integration/fixtures_test.rb
|
315
288
|
- test/integration/render_cms_test.rb
|
316
289
|
- test/integration/sites_test.rb
|
317
290
|
- test/integration/view_hooks_test.rb
|
318
291
|
- test/test_helper.rb
|
319
|
-
- test/unit/
|
320
|
-
- test/unit/
|
321
|
-
- test/unit/
|
322
|
-
- test/unit/
|
323
|
-
- test/unit/
|
324
|
-
- test/unit/
|
325
|
-
- test/unit/
|
326
|
-
- test/unit/
|
327
|
-
- test/unit/
|
328
|
-
- test/unit/
|
329
|
-
- test/unit/
|
330
|
-
- test/unit/
|
331
|
-
- test/unit/
|
332
|
-
- test/unit/
|
333
|
-
- test/unit/
|
334
|
-
- test/unit/
|
335
|
-
- test/unit/
|
336
|
-
- test/unit/
|
337
|
-
- test/unit/
|
338
|
-
- test/unit/
|
292
|
+
- test/unit/configuration_test.rb
|
293
|
+
- test/unit/fixtures_test.rb
|
294
|
+
- test/unit/models/block_test.rb
|
295
|
+
- test/unit/models/layout_test.rb
|
296
|
+
- test/unit/models/page_test.rb
|
297
|
+
- test/unit/models/site_test.rb
|
298
|
+
- test/unit/models/snippet_test.rb
|
299
|
+
- test/unit/models/upload_test.rb
|
300
|
+
- test/unit/tag_test.rb
|
301
|
+
- test/unit/tags/field_datetime_test.rb
|
302
|
+
- test/unit/tags/field_integer_test.rb
|
303
|
+
- test/unit/tags/field_string_test.rb
|
304
|
+
- test/unit/tags/field_text_test.rb
|
305
|
+
- test/unit/tags/helper_test.rb
|
306
|
+
- test/unit/tags/page_datetime_test.rb
|
307
|
+
- test/unit/tags/page_integer_test.rb
|
308
|
+
- test/unit/tags/page_rich_text.rb
|
309
|
+
- test/unit/tags/page_string_test.rb
|
310
|
+
- test/unit/tags/page_text_test.rb
|
311
|
+
- test/unit/tags/partial_test.rb
|
312
|
+
- test/unit/tags/snippet_test.rb
|
339
313
|
- test/unit/view_methods_test.rb
|
340
314
|
homepage: http://github.com/twg/comfortable-mexican-sofa
|
341
315
|
licenses: []
|
@@ -350,7 +324,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
350
324
|
requirements:
|
351
325
|
- - ">="
|
352
326
|
- !ruby/object:Gem::Version
|
353
|
-
hash:
|
327
|
+
hash: -1749047691340110700
|
354
328
|
segments:
|
355
329
|
- 0
|
356
330
|
version: "0"
|
@@ -366,7 +340,7 @@ rubyforge_project:
|
|
366
340
|
rubygems_version: 1.7.2
|
367
341
|
signing_key:
|
368
342
|
specification_version: 3
|
369
|
-
summary: ComfortableMexicanSofa is a
|
343
|
+
summary: ComfortableMexicanSofa is a powerful micro CMS for Ruby on Rails 3 applications
|
370
344
|
test_files:
|
371
345
|
- test/functional/cms_admin/layouts_controller_test.rb
|
372
346
|
- test/functional/cms_admin/pages_controller_test.rb
|
@@ -375,30 +349,30 @@ test_files:
|
|
375
349
|
- test/functional/cms_admin/uploads_controller_test.rb
|
376
350
|
- test/functional/cms_content_controller_test.rb
|
377
351
|
- test/integration/authentication_test.rb
|
378
|
-
- test/integration/
|
379
|
-
- test/integration/render_cms_seed_test.rb
|
352
|
+
- test/integration/fixtures_test.rb
|
380
353
|
- test/integration/render_cms_test.rb
|
381
354
|
- test/integration/sites_test.rb
|
382
355
|
- test/integration/view_hooks_test.rb
|
383
356
|
- test/test_helper.rb
|
384
|
-
- test/unit/
|
385
|
-
- test/unit/
|
386
|
-
- test/unit/
|
387
|
-
- test/unit/
|
388
|
-
- test/unit/
|
389
|
-
- test/unit/
|
390
|
-
- test/unit/
|
391
|
-
- test/unit/
|
392
|
-
- test/unit/
|
393
|
-
- test/unit/
|
394
|
-
- test/unit/
|
395
|
-
- test/unit/
|
396
|
-
- test/unit/
|
397
|
-
- test/unit/
|
398
|
-
- test/unit/
|
399
|
-
- test/unit/
|
400
|
-
- test/unit/
|
401
|
-
- test/unit/
|
402
|
-
- test/unit/
|
403
|
-
- test/unit/
|
357
|
+
- test/unit/configuration_test.rb
|
358
|
+
- test/unit/fixtures_test.rb
|
359
|
+
- test/unit/models/block_test.rb
|
360
|
+
- test/unit/models/layout_test.rb
|
361
|
+
- test/unit/models/page_test.rb
|
362
|
+
- test/unit/models/site_test.rb
|
363
|
+
- test/unit/models/snippet_test.rb
|
364
|
+
- test/unit/models/upload_test.rb
|
365
|
+
- test/unit/tag_test.rb
|
366
|
+
- test/unit/tags/field_datetime_test.rb
|
367
|
+
- test/unit/tags/field_integer_test.rb
|
368
|
+
- test/unit/tags/field_string_test.rb
|
369
|
+
- test/unit/tags/field_text_test.rb
|
370
|
+
- test/unit/tags/helper_test.rb
|
371
|
+
- test/unit/tags/page_datetime_test.rb
|
372
|
+
- test/unit/tags/page_integer_test.rb
|
373
|
+
- test/unit/tags/page_rich_text.rb
|
374
|
+
- test/unit/tags/page_string_test.rb
|
375
|
+
- test/unit/tags/page_text_test.rb
|
376
|
+
- test/unit/tags/partial_test.rb
|
377
|
+
- test/unit/tags/snippet_test.rb
|
404
378
|
- test/unit/view_methods_test.rb
|