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.
Files changed (144) hide show
  1. data/README.md +8 -18
  2. data/Rakefile +1 -4
  3. data/VERSION +1 -1
  4. data/app/controllers/cms_admin/base_controller.rb +8 -9
  5. data/app/controllers/cms_admin/layouts_controller.rb +5 -5
  6. data/app/controllers/cms_admin/pages_controller.rb +14 -14
  7. data/app/controllers/cms_admin/sites_controller.rb +4 -4
  8. data/app/controllers/cms_admin/snippets_controller.rb +4 -4
  9. data/app/controllers/cms_admin/uploads_controller.rb +2 -2
  10. data/app/controllers/cms_content_controller.rb +21 -8
  11. data/app/models/cms/block.rb +13 -0
  12. data/app/models/{cms_layout.rb → cms/layout.rb} +16 -44
  13. data/app/models/{cms_page.rb → cms/page.rb} +26 -57
  14. data/app/models/{cms_site.rb → cms/site.rb} +8 -6
  15. data/app/models/cms/snippet.rb +36 -0
  16. data/app/models/{cms_upload.rb → cms/upload.rb} +5 -3
  17. data/app/views/cms_admin/layouts/_form.html.erb +2 -2
  18. data/app/views/cms_admin/pages/_form.html.erb +5 -5
  19. data/app/views/cms_admin/pages/_form_blocks.html.erb +3 -3
  20. data/app/views/cms_admin/uploads/_index.html.erb +1 -1
  21. data/app/views/layouts/cms_admin.html.erb +2 -38
  22. data/app/views/layouts/cms_admin/_body.html.erb +17 -0
  23. data/app/views/layouts/cms_admin/_center.html.erb +6 -0
  24. data/app/views/layouts/cms_admin/_head.html.erb +11 -0
  25. data/app/views/layouts/cms_admin/_left.html.erb +7 -0
  26. data/app/views/layouts/cms_admin/_right.html.erb +1 -0
  27. data/comfortable_mexican_sofa.gemspec +94 -96
  28. data/config/environments/development.rb +1 -1
  29. data/config/environments/production.rb +1 -1
  30. data/config/environments/test.rb +1 -1
  31. data/config/initializers/comfortable_mexican_sofa.rb +10 -12
  32. data/db/cms_fixtures/example.com/layouts/default/_default.yml +1 -0
  33. data/db/cms_fixtures/example.com/layouts/default/content.html +5 -0
  34. data/db/cms_fixtures/example.com/layouts/default/css.css +1 -0
  35. data/db/cms_fixtures/example.com/layouts/default/js.js +1 -0
  36. data/db/cms_fixtures/example.com/layouts/default/nested/_nested.yml +1 -0
  37. data/db/cms_fixtures/example.com/layouts/default/nested/content.html +2 -0
  38. data/db/cms_fixtures/example.com/layouts/default/nested/css.css +1 -0
  39. data/db/cms_fixtures/example.com/layouts/default/nested/js.js +1 -0
  40. data/db/cms_fixtures/example.com/pages/index/_index.yml +2 -0
  41. data/db/cms_fixtures/example.com/pages/index/child/_child.yml +2 -0
  42. data/db/cms_fixtures/example.com/pages/index/child/left.html +1 -0
  43. data/db/cms_fixtures/example.com/pages/index/child/right.html +1 -0
  44. data/db/cms_fixtures/example.com/pages/index/content.html +2 -0
  45. data/db/cms_fixtures/example.com/snippets/default/_default.yml +1 -0
  46. data/db/cms_fixtures/example.com/snippets/default/content.html +1 -0
  47. data/db/migrate/01_create_cms.rb +11 -11
  48. data/db/migrate/upgrades/02_upgrade_to_1_1_0.rb +19 -0
  49. data/lib/comfortable_mexican_sofa.rb +6 -13
  50. data/lib/comfortable_mexican_sofa/configuration.rb +21 -20
  51. data/lib/comfortable_mexican_sofa/controller_methods.rb +3 -4
  52. data/lib/comfortable_mexican_sofa/engine.rb +1 -1
  53. data/lib/comfortable_mexican_sofa/fixtures.rb +155 -0
  54. data/lib/comfortable_mexican_sofa/form_builder.rb +7 -15
  55. data/lib/comfortable_mexican_sofa/{cms_tag.rb → tag.rb} +42 -23
  56. data/lib/comfortable_mexican_sofa/{cms_tag → tags}/field_datetime.rb +4 -5
  57. data/lib/comfortable_mexican_sofa/{cms_tag → tags}/field_integer.rb +4 -5
  58. data/lib/comfortable_mexican_sofa/{cms_tag → tags}/field_string.rb +4 -5
  59. data/lib/comfortable_mexican_sofa/{cms_tag → tags}/field_text.rb +4 -5
  60. data/lib/comfortable_mexican_sofa/{cms_tag → tags}/helper.rb +2 -5
  61. data/lib/comfortable_mexican_sofa/{cms_tag → tags}/page_datetime.rb +4 -5
  62. data/lib/comfortable_mexican_sofa/{cms_tag → tags}/page_integer.rb +4 -5
  63. data/lib/comfortable_mexican_sofa/{cms_tag → tags}/page_rich_text.rb +4 -5
  64. data/lib/comfortable_mexican_sofa/{cms_tag → tags}/page_string.rb +4 -5
  65. data/lib/comfortable_mexican_sofa/{cms_tag → tags}/page_text.rb +4 -5
  66. data/lib/comfortable_mexican_sofa/{cms_tag → tags}/partial.rb +2 -5
  67. data/lib/comfortable_mexican_sofa/tags/snippet.rb +13 -0
  68. data/lib/comfortable_mexican_sofa/view_methods.rb +4 -3
  69. data/lib/generators/cms_generator.rb +1 -1
  70. data/lib/tasks/comfortable_mexican_sofa.rake +12 -272
  71. data/public/javascripts/comfortable_mexican_sofa/cms.js +1 -1
  72. data/test/fixtures/{cms_blocks.yml → cms/blocks.yml} +2 -2
  73. data/test/fixtures/{cms_layouts.yml → cms/layouts.yml} +3 -3
  74. data/test/fixtures/{cms_pages.yml → cms/pages.yml} +4 -4
  75. data/test/fixtures/{cms_sites.yml → cms/sites.yml} +0 -0
  76. data/test/fixtures/{cms_snippets.yml → cms/snippets.yml} +1 -1
  77. data/test/fixtures/{cms_uploads.yml → cms/uploads.yml} +1 -1
  78. data/test/functional/cms_admin/layouts_controller_test.rb +6 -6
  79. data/test/functional/cms_admin/pages_controller_test.rb +64 -64
  80. data/test/functional/cms_admin/sites_controller_test.rb +5 -5
  81. data/test/functional/cms_admin/snippets_controller_test.rb +6 -6
  82. data/test/functional/cms_admin/uploads_controller_test.rb +4 -4
  83. data/test/functional/cms_content_controller_test.rb +27 -11
  84. data/test/integration/fixtures_test.rb +43 -0
  85. data/test/integration/sites_test.rb +23 -13
  86. data/test/test_helper.rb +9 -8
  87. data/test/unit/{cms_configuration_test.rb → configuration_test.rb} +5 -3
  88. data/test/unit/fixtures_test.rb +198 -0
  89. data/test/unit/models/block_test.rb +33 -0
  90. data/test/unit/models/layout_test.rb +129 -0
  91. data/test/unit/models/page_test.rb +199 -0
  92. data/test/unit/models/site_test.rb +41 -0
  93. data/test/unit/models/snippet_test.rb +32 -0
  94. data/test/unit/models/upload_test.rb +32 -0
  95. data/test/unit/{cms_tag_test.rb → tag_test.rb} +61 -44
  96. data/test/unit/tags/field_datetime_test.rb +44 -0
  97. data/test/unit/tags/field_integer_test.rb +43 -0
  98. data/test/unit/tags/field_string_test.rb +46 -0
  99. data/test/unit/tags/field_text_test.rb +42 -0
  100. data/test/unit/{cms_tags → tags}/helper_test.rb +18 -6
  101. data/test/unit/tags/page_datetime_test.rb +44 -0
  102. data/test/unit/tags/page_integer_test.rb +43 -0
  103. data/test/unit/tags/page_rich_text.rb +43 -0
  104. data/test/unit/{cms_tags → tags}/page_string_test.rb +15 -5
  105. data/test/unit/tags/page_text_test.rb +46 -0
  106. data/test/unit/{cms_tags → tags}/partial_test.rb +24 -8
  107. data/test/unit/tags/snippet_test.rb +45 -0
  108. data/test/unit/view_methods_test.rb +2 -2
  109. metadata +95 -121
  110. data/app/models/cms_block.rb +0 -28
  111. data/app/models/cms_snippet.rb +0 -69
  112. data/db/cms_seeds/example.local/layouts/default.yml +0 -8
  113. data/db/cms_seeds/example.local/layouts/nested.yml +0 -6
  114. data/db/cms_seeds/example.local/pages/child.yml +0 -10
  115. data/db/cms_seeds/example.local/pages/child/subchild.yml +0 -14
  116. data/db/cms_seeds/example.local/pages/index.yml +0 -11
  117. data/db/cms_seeds/example.local/snippets/example.yml +0 -4
  118. data/lib/comfortable_mexican_sofa/cms_tag/snippet.rb +0 -18
  119. data/test/cms_seeds/test.host/layouts/broken.yml +0 -1
  120. data/test/cms_seeds/test.host/layouts/default.yml +0 -3
  121. data/test/cms_seeds/test.host/layouts/nested.yml +0 -4
  122. data/test/cms_seeds/test.host/pages/broken.yml +0 -1
  123. data/test/cms_seeds/test.host/pages/child.yml +0 -10
  124. data/test/cms_seeds/test.host/pages/child/subchild.yml +0 -10
  125. data/test/cms_seeds/test.host/pages/index.yml +0 -10
  126. data/test/cms_seeds/test.host/snippets/broken.yml +0 -1
  127. data/test/cms_seeds/test.host/snippets/default.yml +0 -3
  128. data/test/integration/rake_tasks_test.rb +0 -65
  129. data/test/integration/render_cms_seed_test.rb +0 -34
  130. data/test/unit/cms_block_test.rb +0 -43
  131. data/test/unit/cms_layout_test.rb +0 -179
  132. data/test/unit/cms_page_test.rb +0 -257
  133. data/test/unit/cms_site_test.rb +0 -41
  134. data/test/unit/cms_snippet_test.rb +0 -77
  135. data/test/unit/cms_tags/field_datetime_test.rb +0 -34
  136. data/test/unit/cms_tags/field_integer_test.rb +0 -33
  137. data/test/unit/cms_tags/field_string_test.rb +0 -34
  138. data/test/unit/cms_tags/field_text_test.rb +0 -32
  139. data/test/unit/cms_tags/page_datetime_test.rb +0 -34
  140. data/test/unit/cms_tags/page_integer_test.rb +0 -33
  141. data/test/unit/cms_tags/page_rich_text.rb +0 -33
  142. data/test/unit/cms_tags/page_text_test.rb +0 -34
  143. data/test/unit/cms_tags/snippet_test.rb +0 -33
  144. 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 = CmsTag::PageString.initialize_tag(cms_pages(:default), '{{ cms:page:content:string }}')
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 = CmsTag::PageString.initialize_tag(cms_pages(:default), '{{cms:page:content:string}}')
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 = CmsTag::PageString.initialize_tag(cms_pages(:default), '{{cms:page:dash-content:string}}')
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 CmsTag::PageString.initialize_tag(cms_pages(:default), tag_signature)
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 = CmsTag::PageString.initialize_tag(cms_pages(:default), '{{cms:page:content:string}}')
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 = CmsTag::Partial.initialize_tag(cms_pages(:default), '{{ cms:partial:partial_name }}')
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 = CmsTag::Partial.initialize_tag(cms_pages(:default), '{{cms:partial:path/to/partial}}')
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 = CmsTag::Partial.initialize_tag(cms_pages(:default), '{{cms:partial:path/to/dashed-partial}}')
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 = CmsTag::Partial.initialize_tag(cms_pages(:default), '{{cms:partial:path/to/partial:param1:param2}}')
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 CmsTag::Partial.initialize_tag(cms_pages(:default), tag_signature)
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 = CmsTag::Partial.initialize_tag(cms_pages(:default), '{{cms:partial:path/to/partial}}')
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 = CmsTag::Partial.initialize_tag(cms_pages(:default), '{{cms:partial:path/to/partial:param1}}')
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 = CmsTag::Partial.initialize_tag(cms_pages(:default), '{{cms:partial:path/to/partial:param1:param2}}')
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.0.51
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-04-13 00:00:00 Z
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/cms_block.rb
130
- - app/models/cms_layout.rb
131
- - app/models/cms_page.rb
132
- - app/models/cms_site.rb
133
- - app/models/cms_snippet.rb
134
- - app/models/cms_upload.rb
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/cms_seeds/example.local/layouts/default.yml
175
- - db/cms_seeds/example.local/layouts/nested.yml
176
- - db/cms_seeds/example.local/pages/child.yml
177
- - db/cms_seeds/example.local/pages/child/subchild.yml
178
- - db/cms_seeds/example.local/pages/index.yml
179
- - db/cms_seeds/example.local/snippets/example.yml
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/cms_seeds/test.host/layouts/broken.yml
288
- - test/cms_seeds/test.host/layouts/default.yml
289
- - test/cms_seeds/test.host/layouts/nested.yml
290
- - test/cms_seeds/test.host/pages/broken.yml
291
- - test/cms_seeds/test.host/pages/child.yml
292
- - test/cms_seeds/test.host/pages/child/subchild.yml
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/rake_tasks_test.rb
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/cms_block_test.rb
320
- - test/unit/cms_configuration_test.rb
321
- - test/unit/cms_layout_test.rb
322
- - test/unit/cms_page_test.rb
323
- - test/unit/cms_site_test.rb
324
- - test/unit/cms_snippet_test.rb
325
- - test/unit/cms_tag_test.rb
326
- - test/unit/cms_tags/field_datetime_test.rb
327
- - test/unit/cms_tags/field_integer_test.rb
328
- - test/unit/cms_tags/field_string_test.rb
329
- - test/unit/cms_tags/field_text_test.rb
330
- - test/unit/cms_tags/helper_test.rb
331
- - test/unit/cms_tags/page_datetime_test.rb
332
- - test/unit/cms_tags/page_integer_test.rb
333
- - test/unit/cms_tags/page_rich_text.rb
334
- - test/unit/cms_tags/page_string_test.rb
335
- - test/unit/cms_tags/page_text_test.rb
336
- - test/unit/cms_tags/partial_test.rb
337
- - test/unit/cms_tags/snippet_test.rb
338
- - test/unit/cms_upload_test.rb
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: 3791197822029962853
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 Rails Engine CMS gem
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/rake_tasks_test.rb
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/cms_block_test.rb
385
- - test/unit/cms_configuration_test.rb
386
- - test/unit/cms_layout_test.rb
387
- - test/unit/cms_page_test.rb
388
- - test/unit/cms_site_test.rb
389
- - test/unit/cms_snippet_test.rb
390
- - test/unit/cms_tag_test.rb
391
- - test/unit/cms_tags/field_datetime_test.rb
392
- - test/unit/cms_tags/field_integer_test.rb
393
- - test/unit/cms_tags/field_string_test.rb
394
- - test/unit/cms_tags/field_text_test.rb
395
- - test/unit/cms_tags/helper_test.rb
396
- - test/unit/cms_tags/page_datetime_test.rb
397
- - test/unit/cms_tags/page_integer_test.rb
398
- - test/unit/cms_tags/page_rich_text.rb
399
- - test/unit/cms_tags/page_string_test.rb
400
- - test/unit/cms_tags/page_text_test.rb
401
- - test/unit/cms_tags/partial_test.rb
402
- - test/unit/cms_tags/snippet_test.rb
403
- - test/unit/cms_upload_test.rb
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