comfortable_mexican_sofa 1.12.9 → 1.12.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +11 -6
- data/Gemfile +6 -3
- data/LICENSE +1 -1
- data/README.md +4 -5
- data/Rakefile +1 -0
- data/app/assets/javascripts/comfy/admin/cms/base.js.coffee +3 -3
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/ar.js +76 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/az.js +75 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/ba.js +79 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/bg.js +77 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/by.js +77 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/ca.js +75 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/cs.js +2 -1
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/da.js +2 -1
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/de.js +2 -1
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/el.js +76 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/en.js +75 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/eo.js +76 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/es.js +2 -1
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/es_AR.js +76 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/fa.js +76 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/fi.js +75 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/fr.js +2 -1
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/ge.js +75 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/he.js +75 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/hr.js +76 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/hu.js +77 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/id.js +76 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/it.js +2 -1
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/ja.js +2 -1
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/kn.js +75 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/ko.js +76 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/lt.js +75 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/lv.js +75 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/mk.js +75 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/nb.js +2 -1
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/nl.js +2 -1
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/pl.js +18 -17
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/pt-BR.js +74 -73
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/pt.js +75 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/ro.js +76 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/ru.js +2 -1
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/sk.js +76 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/sl.js +79 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/sq.js +79 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/sr-CIR.js +79 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/sr-LAT.js +79 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/sv.js +72 -74
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/th.js +74 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/tr.js +75 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/ua.js +77 -0
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/uk.js +76 -75
- data/app/assets/javascripts/comfy/admin/cms/lib/redactor/i18n/vi.js +74 -0
- data/app/assets/stylesheets/comfy/admin/cms/redactor_overrides.sass +2 -0
- data/app/controllers/comfy/admin/cms/categories_controller.rb +3 -3
- data/app/controllers/comfy/admin/cms/files_controller.rb +13 -5
- data/app/controllers/comfy/admin/cms/layouts_controller.rb +1 -1
- data/app/controllers/comfy/admin/cms/pages_controller.rb +1 -1
- data/app/controllers/comfy/admin/cms/snippets_controller.rb +1 -1
- data/app/controllers/comfy/cms/assets_controller.rb +3 -3
- data/app/controllers/comfy/cms/content_controller.rb +1 -1
- data/app/models/comfy/cms/layout.rb +6 -4
- data/app/models/comfy/cms/page.rb +1 -2
- data/app/models/comfy/cms/site.rb +6 -3
- data/app/views/comfy/admin/cms/files/index.html.haml +1 -1
- data/app/views/comfy/admin/cms/layouts/_form.html.haml +1 -1
- data/app/views/comfy/admin/cms/sites/_mirrors.html.haml +1 -1
- data/comfortable_mexican_sofa.gemspec +4 -4
- data/config/environments/test.rb +8 -3
- data/config/locales/sk.yml +243 -0
- data/config/locales/tr.yml +243 -0
- data/lib/comfortable_mexican_sofa/configuration.rb +2 -0
- data/lib/comfortable_mexican_sofa/routes/cms.rb +3 -2
- data/lib/comfortable_mexican_sofa/version.rb +1 -1
- data/test/controllers/comfy/admin/cms/files_controller_test.rb +20 -2
- data/test/controllers/comfy/admin/cms/pages_controller_test.rb +1 -0
- data/test/controllers/comfy/admin/cms/revisions_controller_test.rb +1 -1
- data/test/controllers/comfy/admin/cms/snippets_controller_test.rb +4 -1
- data/test/controllers/comfy/cms/content_controller_test.rb +3 -3
- data/test/gemfiles/Gemfile.rails.4.1 +1 -1
- data/test/gemfiles/Gemfile.rails.4.2 +1 -1
- data/test/gemfiles/{Gemfile.rails.4.0 → Gemfile.rails.5.0} +4 -3
- data/test/gemfiles/Gemfile.rails.master +1 -0
- data/test/integration/access_control_test.rb +4 -5
- data/test/integration/render_cms_test.rb +1 -1
- data/test/integration/routing_test.rb +1 -1
- data/test/lib/configuration_test.rb +6 -6
- data/test/lib/fixtures/files_test.rb +1 -1
- data/test/lib/fixtures/pages_test.rb +1 -1
- data/test/lib/tag_test.rb +21 -21
- data/test/lib/tags/helper_test.rb +2 -2
- data/test/lib/tags/page_file_test.rb +2 -2
- data/test/lib/tags/page_files_test.rb +2 -2
- data/test/lib/tags/partial_test.rb +1 -1
- data/test/lib/tags/snippet_test.rb +1 -1
- data/test/lib/tags/template_test.rb +1 -1
- data/test/models/block_test.rb +3 -3
- data/test/models/file_test.rb +1 -1
- data/test/models/layout_test.rb +14 -3
- data/test/models/site_test.rb +5 -5
- metadata +44 -9
@@ -107,7 +107,9 @@ class ComfortableMexicanSofa::Configuration
|
|
107
107
|
'pl' => 'Polski',
|
108
108
|
'pt-BR' => 'Português Brasileiro',
|
109
109
|
'ru' => 'Русский',
|
110
|
+
'sk' => 'Slovensky',
|
110
111
|
'sv' => 'Svenska',
|
112
|
+
'tr' => 'Türkçe',
|
111
113
|
'uk' => 'Українська',
|
112
114
|
'zh-CN' => '简体中文',
|
113
115
|
'zh-TW' => '正體中文'
|
@@ -16,8 +16,9 @@ class ActionDispatch::Routing::Mapper
|
|
16
16
|
:format => :xml
|
17
17
|
end
|
18
18
|
|
19
|
-
get '
|
19
|
+
get '(*cms_path)' => 'content#show', :as => 'render_page', action: '/:format'
|
20
|
+
|
20
21
|
end
|
21
22
|
end
|
22
23
|
end
|
23
|
-
end
|
24
|
+
end
|
@@ -157,6 +157,24 @@ class Comfy::Admin::Cms::FilesControllerTest < ActionController::TestCase
|
|
157
157
|
assert_response :unprocessable_entity
|
158
158
|
end
|
159
159
|
end
|
160
|
+
|
161
|
+
def test_create_as_plupload_with_selected_category
|
162
|
+
category = comfy_cms_categories(:default)
|
163
|
+
|
164
|
+
assert_difference 'Comfy::Cms::File.count' do
|
165
|
+
post :create,
|
166
|
+
:source => 'plupload',
|
167
|
+
:site_id => @site,
|
168
|
+
:file => {
|
169
|
+
:file => fixture_file_upload('files/image.jpg', 'image/jpeg')
|
170
|
+
},
|
171
|
+
:category => [category.label]
|
172
|
+
assert_response :success
|
173
|
+
|
174
|
+
file = Comfy::Cms::File.last
|
175
|
+
assert_equal [category], file.categories
|
176
|
+
end
|
177
|
+
end
|
160
178
|
|
161
179
|
def test_update
|
162
180
|
put :update, :site_id => @site, :id => @file, :file => {
|
@@ -173,9 +191,8 @@ class Comfy::Admin::Cms::FilesControllerTest < ActionController::TestCase
|
|
173
191
|
end
|
174
192
|
|
175
193
|
def test_update_failure
|
176
|
-
file = comfy_cms_files(:default)
|
177
194
|
put :update, :site_id => @site, :id => @file, :file => {
|
178
|
-
:
|
195
|
+
:file_file_name => ""
|
179
196
|
}
|
180
197
|
assert_response :success
|
181
198
|
assert_template :edit
|
@@ -216,4 +233,5 @@ class Comfy::Admin::Cms::FilesControllerTest < ActionController::TestCase
|
|
216
233
|
assert_equal 1, file_one.position
|
217
234
|
assert_equal 0, file_two.position
|
218
235
|
end
|
236
|
+
|
219
237
|
end
|
@@ -17,7 +17,10 @@ class Comfy::Admin::Cms::SnippetsControllerTest < ActionController::TestCase
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_get_index_with_category
|
20
|
-
category = comfy_cms_sites(:default).categories.create!(
|
20
|
+
category = comfy_cms_sites(:default).categories.create!(
|
21
|
+
:label => 'Test Category',
|
22
|
+
:categorized_type => 'Comfy::Cms::Snippet'
|
23
|
+
)
|
21
24
|
category.categorizations.create!(:categorized => comfy_cms_snippets(:default))
|
22
25
|
|
23
26
|
get :index, :site_id => comfy_cms_sites(:default), :category => category.label
|
@@ -61,10 +61,10 @@ class Comfy::Cms::ContentControllerTest < ActionController::TestCase
|
|
61
61
|
assert_equal page.id, json_response['id']
|
62
62
|
assert_equal page.site.id, json_response['site_id']
|
63
63
|
assert_equal page.layout.id, json_response['layout_id']
|
64
|
-
|
65
|
-
|
64
|
+
assert_nil json_response['parent_id']
|
65
|
+
assert_nil json_response['target_page_id']
|
66
66
|
assert_equal 'Default Page', json_response['label']
|
67
|
-
|
67
|
+
assert_nil json_response['slug']
|
68
68
|
assert_equal '/', json_response['full_path']
|
69
69
|
assert_equal content, json_response['content_cache']
|
70
70
|
assert_equal 0, json_response['position']
|
@@ -3,7 +3,7 @@ source 'http://rubygems.org'
|
|
3
3
|
gem 'rails', '~> 4.1.0'
|
4
4
|
gem 'bootstrap_form', '>= 2.2.0'
|
5
5
|
gem 'active_link_to', '>= 1.0.0'
|
6
|
-
gem 'paperclip', '>= 3.4.0'
|
6
|
+
gem 'paperclip', '>= 3.4.0', '< 5'
|
7
7
|
gem 'kramdown', '>= 1.0.0'
|
8
8
|
gem 'jquery-rails', '>= 3.0.0'
|
9
9
|
gem 'jquery-ui-rails', '>= 5.0.0'
|
@@ -3,7 +3,7 @@ source 'http://rubygems.org'
|
|
3
3
|
gem 'rails', '~> 4.2.0'
|
4
4
|
gem 'bootstrap_form', '>= 2.2.0'
|
5
5
|
gem 'active_link_to', '>= 1.0.0'
|
6
|
-
gem 'paperclip', '>= 3.4.0'
|
6
|
+
gem 'paperclip', '>= 3.4.0', '< 5'
|
7
7
|
gem 'kramdown', '>= 1.0.0'
|
8
8
|
gem 'jquery-rails', '>= 3.0.0'
|
9
9
|
gem 'jquery-ui-rails', '>= 5.0.0'
|
@@ -1,11 +1,11 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
|
-
gem 'rails', '~>
|
3
|
+
gem 'rails', '~> 5.0.0'
|
4
4
|
gem 'bootstrap_form', '>= 2.2.0'
|
5
5
|
gem 'active_link_to', '>= 1.0.0'
|
6
|
-
gem 'paperclip', '>= 3.4.0'
|
6
|
+
gem 'paperclip', '>= 3.4.0', '< 5'
|
7
7
|
gem 'kramdown', '>= 1.0.0'
|
8
|
-
gem 'jquery-rails', '>= 3.0.0'
|
8
|
+
gem 'jquery-rails', '>= 3.0.0'
|
9
9
|
gem 'jquery-ui-rails', '>= 5.0.0'
|
10
10
|
gem 'haml-rails', '>= 0.3.0'
|
11
11
|
gem 'sass-rails', '>= 4.0.3'
|
@@ -19,4 +19,5 @@ group :test do
|
|
19
19
|
gem 'sqlite3'
|
20
20
|
gem 'coveralls', :require => false
|
21
21
|
gem 'mocha', :require => false
|
22
|
+
gem 'rails-controller-testing'
|
22
23
|
end
|
@@ -5,7 +5,7 @@ class AccessControlTest < ActionDispatch::IntegrationTest
|
|
5
5
|
module TestAuthentication
|
6
6
|
module Authenticate
|
7
7
|
def authenticate
|
8
|
-
render :
|
8
|
+
render :plain => 'Test Login Denied', :status => :unauthorized
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
@@ -19,7 +19,7 @@ class AccessControlTest < ActionDispatch::IntegrationTest
|
|
19
19
|
module Authorize
|
20
20
|
def authorize
|
21
21
|
@authorization_vars = self.instance_variables
|
22
|
-
render :
|
22
|
+
render :plain => 'Test Access Denied', :status => :forbidden
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -140,7 +140,7 @@ class AccessControlTest < ActionDispatch::IntegrationTest
|
|
140
140
|
def test_public_authentication_custom
|
141
141
|
with_routing do |routes|
|
142
142
|
routes.draw do
|
143
|
-
get
|
143
|
+
get "(*cms_path)" => 'access_control_test/test_authentication/content#show'
|
144
144
|
end
|
145
145
|
|
146
146
|
get '/'
|
@@ -152,7 +152,7 @@ class AccessControlTest < ActionDispatch::IntegrationTest
|
|
152
152
|
def test_public_authorization_custom
|
153
153
|
with_routing do |routes|
|
154
154
|
routes.draw do
|
155
|
-
get
|
155
|
+
get "(*cms_path)" => 'access_control_test/test_authorization/content#show'
|
156
156
|
end
|
157
157
|
|
158
158
|
get '/'
|
@@ -160,5 +160,4 @@ class AccessControlTest < ActionDispatch::IntegrationTest
|
|
160
160
|
assert_equal 'Test Access Denied', response.body
|
161
161
|
end
|
162
162
|
end
|
163
|
-
|
164
163
|
end
|
@@ -8,7 +8,7 @@ class RoutingIntergrationTest < ActionDispatch::IntegrationTest
|
|
8
8
|
|
9
9
|
def test_cms_public_prefix
|
10
10
|
|
11
|
-
|
11
|
+
assert_nil ComfortableMexicanSofa.config.public_cms_path
|
12
12
|
|
13
13
|
Rails.application.routes.draw do
|
14
14
|
comfy_route :cms, :path => '/custom'
|
@@ -19,14 +19,14 @@ class ConfigurationTest < ActiveSupport::TestCase
|
|
19
19
|
'en' => 'English',
|
20
20
|
'es' => 'Español'
|
21
21
|
}), config.locales
|
22
|
-
|
22
|
+
assert_nil config.admin_locale
|
23
23
|
assert_equal ({}), config.upload_file_options
|
24
|
-
|
24
|
+
assert_nil config.admin_cache_sweeper
|
25
25
|
assert_equal false, config.allow_irb
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
assert_nil config.allowed_helpers
|
27
|
+
assert_nil config.allowed_partials
|
28
|
+
assert_nil config.allowed_templates
|
29
|
+
assert_nil config.hostname_aliases
|
30
30
|
end
|
31
31
|
|
32
32
|
def test_initialization_overrides
|
@@ -83,7 +83,7 @@ class FixtureFilesTest < ActiveSupport::TestCase
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def test_export
|
86
|
-
comfy_cms_files(:default).
|
86
|
+
comfy_cms_files(:default).update_attribute(:block, comfy_cms_blocks(:default_field_text))
|
87
87
|
|
88
88
|
host_path = File.join(ComfortableMexicanSofa.config.fixtures_path, 'test-site')
|
89
89
|
attr_path = File.join(host_path, 'files/_sample.jpg.yml')
|
@@ -90,7 +90,7 @@ class FixturePagesTest < ActiveSupport::TestCase
|
|
90
90
|
ComfortableMexicanSofa::Fixture::Page::Importer.new('sample-site', 'default-site').import!
|
91
91
|
page.reload
|
92
92
|
|
93
|
-
|
93
|
+
assert_nil page.slug
|
94
94
|
assert_equal 'Test', page.label
|
95
95
|
block = page.blocks.where(:identifier => 'content').first
|
96
96
|
assert_equal 'test content', block.content
|
data/test/lib/tag_test.rb
CHANGED
@@ -6,55 +6,55 @@ class TagTest < ActiveSupport::TestCase
|
|
6
6
|
regex = ComfortableMexicanSofa::Tag::TOKENIZER_REGEX
|
7
7
|
|
8
8
|
tokens = 'text { text } text'.scan(regex)
|
9
|
-
|
9
|
+
assert_nil tokens[0][0]
|
10
10
|
assert_equal 'text { text } text', tokens[0][1]
|
11
11
|
|
12
12
|
tokens = 'content<{{cms:some_tag content'.scan(regex)
|
13
|
-
|
13
|
+
assert_nil tokens[0][0]
|
14
14
|
assert_equal 'content<', tokens[0][1]
|
15
|
-
|
15
|
+
assert_nil tokens[1][0]
|
16
16
|
assert_equal '{{', tokens[1][1]
|
17
|
-
|
17
|
+
assert_nil tokens[2][0]
|
18
18
|
assert_equal 'cms:some_tag content', tokens[2][1]
|
19
19
|
|
20
20
|
tokens = 'content<{{cms some_tag}}>content'.scan(regex)
|
21
|
-
|
21
|
+
assert_nil tokens[0][0]
|
22
22
|
assert_equal 'content<', tokens[0][1]
|
23
|
-
|
23
|
+
assert_nil tokens[1][0]
|
24
24
|
assert_equal '{{', tokens[1][1]
|
25
|
-
|
25
|
+
assert_nil tokens[2][0]
|
26
26
|
assert_equal 'cms some_tag}}>content',tokens[2][1]
|
27
27
|
|
28
28
|
tokens = 'content<{{cms:some_tag}}>content'.scan(regex)
|
29
|
-
|
29
|
+
assert_nil tokens[0][0]
|
30
30
|
assert_equal 'content<', tokens[0][1]
|
31
31
|
assert_equal '{{cms:some_tag}}', tokens[1][0]
|
32
|
-
|
33
|
-
|
32
|
+
assert_nil tokens[1][1]
|
33
|
+
assert_nil tokens[2][0]
|
34
34
|
assert_equal '>content', tokens[2][1]
|
35
35
|
|
36
36
|
tokens = 'content<{{cms:type:label}}>content'.scan(regex)
|
37
|
-
|
37
|
+
assert_nil tokens[0][0]
|
38
38
|
assert_equal 'content<', tokens[0][1]
|
39
39
|
assert_equal '{{cms:type:label}}', tokens[1][0]
|
40
|
-
|
41
|
-
|
40
|
+
assert_nil tokens[1][1]
|
41
|
+
assert_nil tokens[2][0]
|
42
42
|
assert_equal '>content', tokens[2][1]
|
43
43
|
|
44
44
|
tokens = 'content<{{cms:type:label }}>content'.scan(regex)
|
45
|
-
|
45
|
+
assert_nil tokens[0][0]
|
46
46
|
assert_equal 'content<', tokens[0][1]
|
47
47
|
assert_equal '{{cms:type:label }}', tokens[1][0]
|
48
|
-
|
49
|
-
|
48
|
+
assert_nil tokens[1][1]
|
49
|
+
assert_nil tokens[2][0]
|
50
50
|
assert_equal '>content', tokens[2][1]
|
51
51
|
|
52
52
|
tokens = 'content<{{ cms:type:la/b el }}>content'.scan(regex)
|
53
|
-
|
53
|
+
assert_nil tokens[0][0]
|
54
54
|
assert_equal 'content<', tokens[0][1]
|
55
55
|
assert_equal '{{ cms:type:la/b el }}',tokens[1][0]
|
56
|
-
|
57
|
-
|
56
|
+
assert_nil tokens[1][1]
|
57
|
+
assert_nil tokens[2][0]
|
58
58
|
assert_equal '>content', tokens[2][1]
|
59
59
|
end
|
60
60
|
|
@@ -62,7 +62,7 @@ class TagTest < ActiveSupport::TestCase
|
|
62
62
|
string = '<p>text</p>' * 400
|
63
63
|
tokens = string.scan(ComfortableMexicanSofa::Tag::TOKENIZER_REGEX)
|
64
64
|
assert_equal 1, tokens.count
|
65
|
-
|
65
|
+
assert_nil tokens[0][0]
|
66
66
|
assert_equal string, tokens[0][1]
|
67
67
|
end
|
68
68
|
|
@@ -285,7 +285,7 @@ class TagTest < ActiveSupport::TestCase
|
|
285
285
|
comfy_cms_pages(:default), '{{ cms:page:content:string }}'
|
286
286
|
)
|
287
287
|
assert_equal 'content', tag.identifier
|
288
|
-
|
288
|
+
assert_nil tag.namespace
|
289
289
|
|
290
290
|
assert tag = ComfortableMexicanSofa::Tag::PageString.initialize_tag(
|
291
291
|
comfy_cms_pages(:default), '{{ cms:page:home.content:string }}'
|
@@ -62,7 +62,7 @@ class HelperTagTest < ActiveSupport::TestCase
|
|
62
62
|
comfy_cms_pages(:default), "{{ cms:helper:#{method}:Rails.env }}"
|
63
63
|
)
|
64
64
|
assert_equal "<%= #{method}('Rails.env') %>", tag.content
|
65
|
-
|
65
|
+
assert_nil tag.render
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
@@ -80,7 +80,7 @@ class HelperTagTest < ActiveSupport::TestCase
|
|
80
80
|
comfy_cms_pages(:default), "{{ cms:helper:invalid:Rails.env }}"
|
81
81
|
)
|
82
82
|
assert_equal "<%= invalid('Rails.env') %>", tag.content
|
83
|
-
|
83
|
+
assert_nil tag.render
|
84
84
|
end
|
85
85
|
|
86
86
|
end
|
@@ -9,7 +9,7 @@ class PageFileTagTest < ActiveSupport::TestCase
|
|
9
9
|
assert_equal 'label', tag.identifier
|
10
10
|
assert_nil tag.namespace
|
11
11
|
assert 'url', tag.type
|
12
|
-
|
12
|
+
assert_nil tag.dimensions
|
13
13
|
|
14
14
|
assert tag = ComfortableMexicanSofa::Tag::PageFile.initialize_tag(
|
15
15
|
comfy_cms_pages(:default), '{{ cms:page_file:label:partial }}'
|
@@ -50,7 +50,7 @@ class PageFileTagTest < ActiveSupport::TestCase
|
|
50
50
|
assert_equal "<%= render :partial => 'partials/page_file', :locals => {:identifier => nil} %>", tag.render
|
51
51
|
|
52
52
|
assert tag = ComfortableMexicanSofa::Tag::PageFile.initialize_tag(page, '{{ cms:page_file:file }}')
|
53
|
-
|
53
|
+
assert_nil tag.content
|
54
54
|
assert_equal '', tag.render
|
55
55
|
|
56
56
|
page.update_attributes!(
|
@@ -8,8 +8,8 @@ class PageFilesTagTest < ActiveSupport::TestCase
|
|
8
8
|
)
|
9
9
|
assert 'url', tag.type
|
10
10
|
assert_equal 'label', tag.identifier
|
11
|
-
|
12
|
-
|
11
|
+
assert_nil tag.namespace
|
12
|
+
assert_nil tag.dimensions
|
13
13
|
|
14
14
|
assert tag = ComfortableMexicanSofa::Tag::PageFiles.initialize_tag(
|
15
15
|
comfy_cms_pages(:default), '{{ cms:page_files:label:partial }}'
|
@@ -39,7 +39,7 @@ class SnippetTagTest < ActiveSupport::TestCase
|
|
39
39
|
tag = ComfortableMexicanSofa::Tag::Snippet.initialize_tag(
|
40
40
|
comfy_cms_pages(:default), "{{cms:snippet:doesnot_exist}}"
|
41
41
|
)
|
42
|
-
|
42
|
+
assert_nil tag.content
|
43
43
|
assert_equal '', tag.render
|
44
44
|
end
|
45
45
|
end
|
data/test/models/block_test.rb
CHANGED
@@ -31,7 +31,7 @@ class CmsBlockTest < ActiveSupport::TestCase
|
|
31
31
|
block = Comfy::Cms::Block.new
|
32
32
|
|
33
33
|
block.content = fixture_file_upload('files/image.jpg', 'image/jpeg')
|
34
|
-
|
34
|
+
assert_nil block.content
|
35
35
|
assert_equal 1, block.temp_files.size
|
36
36
|
end
|
37
37
|
|
@@ -125,7 +125,7 @@ class CmsBlockTest < ActiveSupport::TestCase
|
|
125
125
|
assert_equal 1, page.blocks.count
|
126
126
|
block = page.blocks.first
|
127
127
|
assert_equal 'file', block.identifier
|
128
|
-
|
128
|
+
assert_nil block.content
|
129
129
|
assert_equal 1, block.files.count
|
130
130
|
assert_equal 'image.jpg', block.files.first.file_file_name
|
131
131
|
|
@@ -173,7 +173,7 @@ class CmsBlockTest < ActiveSupport::TestCase
|
|
173
173
|
assert_equal 1, page.blocks.count
|
174
174
|
block = page.blocks.first
|
175
175
|
assert_equal 'files', block.identifier
|
176
|
-
|
176
|
+
assert_nil block.content
|
177
177
|
assert_equal 2, block.files.count
|
178
178
|
assert_equal ['image.jpg', 'image.gif'], block.files.collect(&:file_file_name)
|
179
179
|
end
|