comfortable_mexican_sofa 1.6.23 → 1.6.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. data/VERSION +1 -1
  2. data/app/assets/javascripts/comfortable_mexican_sofa/application.js +17 -16
  3. data/app/assets/stylesheets/comfortable_mexican_sofa/form.css +48 -0
  4. data/app/controllers/cms_admin/files_controller.rb +1 -1
  5. data/app/models/cms/file.rb +2 -1
  6. data/app/models/cms/page.rb +26 -6
  7. data/app/views/cms_admin/categories/_show.html.erb +1 -1
  8. data/app/views/cms_admin/files/_file.html.erb +1 -1
  9. data/app/views/cms_admin/files/index.html.erb +1 -1
  10. data/app/views/cms_admin/layouts/_index_branch.html.erb +1 -1
  11. data/app/views/cms_admin/pages/_form.html.erb +1 -0
  12. data/app/views/cms_admin/pages/_form_blocks.html.erb +29 -5
  13. data/app/views/cms_admin/pages/_index_branch.html.erb +1 -1
  14. data/app/views/cms_admin/pages/form_blocks.js.erb +2 -1
  15. data/app/views/cms_admin/sites/index.html.erb +1 -1
  16. data/app/views/cms_admin/snippets/index.html.erb +1 -1
  17. data/comfortable_mexican_sofa.gemspec +4 -3
  18. data/config/locales/ru.yml +235 -0
  19. data/lib/comfortable_mexican_sofa/configuration.rb +24 -23
  20. data/lib/comfortable_mexican_sofa/tag.rb +6 -1
  21. data/lib/comfortable_mexican_sofa/tags/asset.rb +1 -1
  22. data/lib/comfortable_mexican_sofa/tags/collection.rb +1 -1
  23. data/lib/comfortable_mexican_sofa/tags/field_datetime.rb +1 -1
  24. data/lib/comfortable_mexican_sofa/tags/field_integer.rb +1 -1
  25. data/lib/comfortable_mexican_sofa/tags/field_rich_text.rb +1 -1
  26. data/lib/comfortable_mexican_sofa/tags/field_string.rb +1 -1
  27. data/lib/comfortable_mexican_sofa/tags/field_text.rb +1 -1
  28. data/lib/comfortable_mexican_sofa/tags/file.rb +1 -1
  29. data/lib/comfortable_mexican_sofa/tags/page_datetime.rb +1 -1
  30. data/lib/comfortable_mexican_sofa/tags/page_file.rb +1 -1
  31. data/lib/comfortable_mexican_sofa/tags/page_files.rb +1 -1
  32. data/lib/comfortable_mexican_sofa/tags/page_integer.rb +1 -1
  33. data/lib/comfortable_mexican_sofa/tags/page_rich_text.rb +1 -1
  34. data/lib/comfortable_mexican_sofa/tags/page_string.rb +1 -1
  35. data/lib/comfortable_mexican_sofa/tags/page_text.rb +1 -1
  36. data/lib/comfortable_mexican_sofa/view_methods.rb +10 -1
  37. data/test/functional/cms_admin/pages_controller_test.rb +18 -18
  38. data/test/functional/cms_content_controller_test.rb +6 -6
  39. data/test/gemfiles/Gemfile.rails.3.0 +1 -1
  40. data/test/gemfiles/Gemfile.rails.3.1 +1 -1
  41. data/test/gemfiles/Gemfile.rails.3.2 +1 -1
  42. data/test/integration/fixtures_test.rb +1 -1
  43. data/test/integration/mirrors_test.rb +1 -1
  44. data/test/integration/render_cms_test.rb +7 -7
  45. data/test/integration/sites_test.rb +3 -3
  46. data/test/test_helper.rb +15 -0
  47. data/test/unit/fixtures_test.rb +10 -10
  48. data/test/unit/mirrors_test.rb +1 -1
  49. data/test/unit/models/block_test.rb +3 -3
  50. data/test/unit/models/categorization_test.rb +2 -2
  51. data/test/unit/models/file_test.rb +1 -1
  52. data/test/unit/models/layout_test.rb +3 -3
  53. data/test/unit/models/page_test.rb +21 -3
  54. data/test/unit/models/site_test.rb +1 -1
  55. data/test/unit/models/snippet_test.rb +1 -1
  56. data/test/unit/revisions_test.rb +5 -5
  57. data/test/unit/tag_test.rb +27 -1
  58. data/test/unit/tags/collection_test.rb +7 -0
  59. data/test/unit/tags/field_datetime_test.rb +6 -0
  60. data/test/unit/tags/field_integer_test.rb +6 -0
  61. data/test/unit/tags/field_rich_text_test.rb +6 -0
  62. data/test/unit/tags/field_string_test.rb +6 -0
  63. data/test/unit/tags/field_text_test.rb +6 -0
  64. data/test/unit/tags/page_datetime_test.rb +6 -0
  65. data/test/unit/tags/page_file_test.rb +10 -2
  66. data/test/unit/tags/page_files_test.rb +9 -1
  67. data/test/unit/tags/page_integer_test.rb +6 -0
  68. data/test/unit/tags/page_rich_text_test.rb +6 -0
  69. data/test/unit/tags/page_string_test.rb +6 -0
  70. data/test/unit/tags/page_text_test.rb +6 -0
  71. data/test/unit/view_methods_test.rb +21 -3
  72. metadata +5 -4
@@ -23,7 +23,7 @@ class CmsContentControllerTest < ActionController::TestCase
23
23
  end
24
24
 
25
25
  def test_render_page_with_app_layout
26
- cms_layouts(:default).update_attribute(:app_layout, 'cms_admin')
26
+ cms_layouts(:default).update_column(:app_layout, 'cms_admin')
27
27
  get :render_html, :cms_path => ''
28
28
  assert_response :success
29
29
  assert assigns(:cms_page)
@@ -31,7 +31,7 @@ class CmsContentControllerTest < ActionController::TestCase
31
31
  end
32
32
 
33
33
  def test_render_page_with_xhr
34
- cms_layouts(:default).update_attribute(:app_layout, 'cms_admin')
34
+ cms_layouts(:default).update_column(:app_layout, 'cms_admin')
35
35
  xhr :get, :render_html, :cms_path => ''
36
36
  assert_response :success
37
37
  assert assigns(:cms_page)
@@ -81,7 +81,7 @@ class CmsContentControllerTest < ActionController::TestCase
81
81
  end
82
82
 
83
83
  def test_render_page_with_redirect
84
- cms_pages(:child).update_attribute(:target_page, cms_pages(:default))
84
+ cms_pages(:child).update_column(:target_page_id, cms_pages(:default).id)
85
85
  assert_equal cms_pages(:default), cms_pages(:child).target_page
86
86
  get :render_html, :cms_path => 'child-page'
87
87
  assert_response :redirect
@@ -90,7 +90,7 @@ class CmsContentControllerTest < ActionController::TestCase
90
90
 
91
91
  def test_render_page_unpublished
92
92
  page = cms_pages(:default)
93
- page.update_attribute(:is_published, false)
93
+ page.update_column(:is_published, false)
94
94
 
95
95
  assert_exception_raised ActionController::RoutingError, 'Page Not Found' do
96
96
  get :render_html, :cms_path => ''
@@ -167,7 +167,7 @@ class CmsContentControllerTest < ActionController::TestCase
167
167
 
168
168
  def test_render_sitemap_with_path
169
169
  site = cms_sites(:default)
170
- site.update_attribute(:path, 'en')
170
+ site.update_column(:path, 'en')
171
171
 
172
172
  get :render_sitemap, :cms_path => site.path, :format => :xml
173
173
  assert_response :success
@@ -177,7 +177,7 @@ class CmsContentControllerTest < ActionController::TestCase
177
177
 
178
178
  def test_render_sitemap_with_path_invalid_with_single_site
179
179
  site = cms_sites(:default)
180
- site.update_attribute(:path, 'en')
180
+ site.update_column(:path, 'en')
181
181
 
182
182
  get :render_sitemap, :cms_path => 'fr', :format => :xml
183
183
  assert_response :success
@@ -1,6 +1,6 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem 'rails', '3.0.12'
3
+ gem 'rails', '3.0.16'
4
4
  gem 'active_link_to', '1.0.0'
5
5
  gem 'paperclip', '>= 2.3.0'
6
6
 
@@ -1,6 +1,6 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem 'rails', '3.1.4'
3
+ gem 'rails', '3.1.7'
4
4
  gem 'active_link_to', '1.0.0'
5
5
  gem 'paperclip', '>= 2.3.0'
6
6
 
@@ -1,6 +1,6 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem 'rails', '3.2.2'
3
+ gem 'rails', '3.2.7'
4
4
  gem 'active_link_to', '1.0.0'
5
5
  gem 'paperclip', '>= 2.3.0'
6
6
 
@@ -6,7 +6,7 @@ class FixturesTest < ActionDispatch::IntegrationTest
6
6
 
7
7
  def setup
8
8
  host! 'example.com'
9
- cms_sites(:default).update_attribute(:hostname, 'example.com')
9
+ cms_sites(:default).update_column(:hostname, 'example.com')
10
10
  end
11
11
 
12
12
  def test_fixtures_disabled
@@ -4,7 +4,7 @@ class MirrorsTest < ActionDispatch::IntegrationTest
4
4
 
5
5
  def setup
6
6
  @site_a = cms_sites(:default)
7
- @site_a.update_attribute(:is_mirrored, true)
7
+ @site_a.update_column(:is_mirrored, true)
8
8
  @site_b = Cms::Site.create!(:identifier => 'test_b', :hostname => 'test-b.host', :is_mirrored => true)
9
9
  # making mirrors
10
10
  Cms::Layout.all.each{ |l| l.save! }
@@ -8,8 +8,8 @@ class RenderCmsTest < ActionDispatch::IntegrationTest
8
8
  get '/render-page' => 'render_test#render_page'
9
9
  get '/render-layout' => 'render_test#render_layout'
10
10
  end
11
- cms_layouts(:default).update_attribute(:content, '{{cms:page:content}}')
12
- cms_pages(:child).update_attribute(:blocks_attributes, [
11
+ cms_layouts(:default).update_column(:content, '{{cms:page:content}}')
12
+ cms_pages(:child).update_attributes(:blocks_attributes => [
13
13
  { :identifier => 'content', :content => 'TestBlockContent' }
14
14
  ])
15
15
  super
@@ -108,7 +108,7 @@ class RenderCmsTest < ActionDispatch::IntegrationTest
108
108
  # -- Page Render Test -----------------------------------------------------
109
109
  def test_implicit_cms_page
110
110
  page = cms_pages(:child)
111
- page.update_attribute(:slug, 'render-basic')
111
+ page.update_attributes(:slug => 'render-basic')
112
112
  get '/render-basic?type=page_implicit'
113
113
  assert_response :success
114
114
  assert assigns(:cms_site)
@@ -120,7 +120,7 @@ class RenderCmsTest < ActionDispatch::IntegrationTest
120
120
 
121
121
  def test_explicit_cms_page
122
122
  page = cms_pages(:child)
123
- page.update_attribute(:slug, 'test-page')
123
+ page.update_attributes(slug: 'test-page')
124
124
  get '/render-page?type=page_explicit'
125
125
  assert_response :success
126
126
  assert assigns(:cms_site)
@@ -132,7 +132,7 @@ class RenderCmsTest < ActionDispatch::IntegrationTest
132
132
 
133
133
  def test_explicit_cms_page_with_status
134
134
  page = cms_pages(:child)
135
- page.update_attribute(:slug, 'test-page')
135
+ page.update_attributes(:slug => 'test-page')
136
136
  get '/render-page?type=page_explicit_with_status'
137
137
  assert_response 404
138
138
  assert assigns(:cms_site)
@@ -144,7 +144,7 @@ class RenderCmsTest < ActionDispatch::IntegrationTest
144
144
 
145
145
  def test_explicit_cms_page_failure
146
146
  page = cms_pages(:child)
147
- page.update_attribute(:slug, 'invalid')
147
+ page.update_attributes(:slug => 'invalid')
148
148
  assert_exception_raised ComfortableMexicanSofa::MissingPage do
149
149
  get '/render-page?type=page_explicit'
150
150
  end
@@ -176,7 +176,7 @@ class RenderCmsTest < ActionDispatch::IntegrationTest
176
176
  end
177
177
 
178
178
  def test_cms_layout
179
- cms_layouts(:default).update_attribute(:content, '{{cms:page:content}} {{cms:page:content_b}} {{cms:page:content_c}}')
179
+ cms_layouts(:default).update_column(:content, '{{cms:page:content}} {{cms:page:content_b}} {{cms:page:content_c}}')
180
180
  get '/render-layout?type=layout'
181
181
  assert_response :success
182
182
  assert_equal 'TestText TestPartial TestValue TestTemplate TestValue', response.body
@@ -66,7 +66,7 @@ class SitesTest < ActionDispatch::IntegrationTest
66
66
  assert assigns(:cms_site)
67
67
  assert_equal :en, I18n.locale
68
68
 
69
- cms_sites(:default).update_attribute(:locale, 'fr')
69
+ cms_sites(:default).update_column(:locale, 'fr')
70
70
  get '/'
71
71
  assert_response :success
72
72
  assert assigns(:cms_site)
@@ -78,7 +78,7 @@ class SitesTest < ActionDispatch::IntegrationTest
78
78
  assert_response :success
79
79
  assert_equal :en, I18n.locale
80
80
 
81
- cms_sites(:default).update_attribute(:locale, 'fr')
81
+ cms_sites(:default).update_column(:locale, 'fr')
82
82
  http_auth :get, cms_admin_site_pages_path(cms_sites(:default))
83
83
  assert_response :success
84
84
  assert_equal :fr, I18n.locale
@@ -87,7 +87,7 @@ class SitesTest < ActionDispatch::IntegrationTest
87
87
  def test_get_admin_with_forced_locale
88
88
  ComfortableMexicanSofa.config.admin_locale = :en
89
89
 
90
- cms_sites(:default).update_attribute(:locale, 'fr')
90
+ cms_sites(:default).update_column(:locale, 'fr')
91
91
  http_auth :get, cms_admin_site_pages_path(cms_sites(:default))
92
92
  assert_response :success
93
93
  assert_equal :en, I18n.locale
data/test/test_helper.rb CHANGED
@@ -122,3 +122,18 @@ class ActionDispatch::IntegrationTest
122
122
  send(method, path, options, {'HTTP_AUTHORIZATION' => "Basic #{Base64.encode64(username + ':' + password)}"})
123
123
  end
124
124
  end
125
+
126
+
127
+ # Injecting `update_column` for installs on Rails < 3.1
128
+ module ComfortableMexicanSofa
129
+ module Deprication
130
+ module ActiveRecord
131
+ def update_column(name, value)
132
+ update_attribute(name, value)
133
+ end
134
+ end
135
+ end
136
+ end
137
+ unless Cms::Page.new.respond_to?(:update_column)
138
+ ActiveRecord::Base.send :include, ComfortableMexicanSofa::Deprication::ActiveRecord
139
+ end
@@ -29,9 +29,9 @@ class FixturesTest < ActiveSupport::TestCase
29
29
  layout = cms_layouts(:default)
30
30
  nested_layout = cms_layouts(:nested)
31
31
  child_layout = cms_layouts(:child)
32
- layout.update_attribute(:updated_at, 10.years.ago)
33
- nested_layout.update_attribute(:updated_at, 10.years.ago)
34
- child_layout.update_attribute(:updated_at, 10.years.ago)
32
+ layout.update_column(:updated_at, 10.years.ago)
33
+ nested_layout.update_column(:updated_at, 10.years.ago)
34
+ child_layout.update_column(:updated_at, 10.years.ago)
35
35
 
36
36
  assert_difference 'Cms::Layout.count', -1 do
37
37
  ComfortableMexicanSofa::Fixtures.import_layouts('test.host', 'example.com')
@@ -81,10 +81,10 @@ class FixturesTest < ActiveSupport::TestCase
81
81
  Cms::Page.delete_all
82
82
 
83
83
  layout = cms_layouts(:default)
84
- layout.update_attribute(:content, '<html>{{cms:page:content}}</html>')
84
+ layout.update_column(:content, '<html>{{cms:page:content}}</html>')
85
85
 
86
86
  nested = cms_layouts(:nested)
87
- nested.update_attribute(:content, '<html>{{cms:page:left}}<br/>{{cms:page:right}}</html>')
87
+ nested.update_column(:content, '<html>{{cms:page:left}}<br/>{{cms:page:right}}</html>')
88
88
 
89
89
  assert_difference 'Cms::Page.count', 2 do
90
90
  ComfortableMexicanSofa::Fixtures.import_pages('test.host', 'example.com')
@@ -107,11 +107,11 @@ class FixturesTest < ActiveSupport::TestCase
107
107
 
108
108
  def test_import_pages_updating_and_deleting
109
109
  page = cms_pages(:default)
110
- page.update_attribute(:updated_at, 10.years.ago)
110
+ page.update_column(:updated_at, 10.years.ago)
111
111
  assert_equal 'Default Page', page.label
112
112
 
113
113
  child = cms_pages(:child)
114
- child.update_attribute(:slug, 'old')
114
+ child.update_column(:slug, 'old')
115
115
 
116
116
  assert_no_difference 'Cms::Page.count' do
117
117
  ComfortableMexicanSofa::Fixtures.import_pages('test.host', 'example.com')
@@ -156,7 +156,7 @@ class FixturesTest < ActiveSupport::TestCase
156
156
  :layout => cms_layouts(:default),
157
157
  :blocks_attributes => [ { :identifier => 'to_delete', :content => 'test content' } ]
158
158
  )
159
- page.update_attribute(:updated_at, 10.years.ago)
159
+ page.update_column(:updated_at, 10.years.ago)
160
160
 
161
161
  ComfortableMexicanSofa::Fixtures.import_pages('test.host', 'example.com')
162
162
  page.reload
@@ -182,7 +182,7 @@ class FixturesTest < ActiveSupport::TestCase
182
182
 
183
183
  def test_import_snippets_updating
184
184
  snippet = cms_snippets(:default)
185
- snippet.update_attribute(:updated_at, 10.years.ago)
185
+ snippet.update_column(:updated_at, 10.years.ago)
186
186
  assert_equal 'default', snippet.identifier
187
187
  assert_equal 'Default Snippet', snippet.label
188
188
  assert_equal 'default_snippet_content', snippet.content
@@ -198,7 +198,7 @@ class FixturesTest < ActiveSupport::TestCase
198
198
 
199
199
  def test_import_snippets_deleting
200
200
  snippet = cms_snippets(:default)
201
- snippet.update_attribute(:identifier, 'old')
201
+ snippet.update_column(:identifier, 'old')
202
202
 
203
203
  assert_no_difference 'Cms::Snippet.count' do
204
204
  ComfortableMexicanSofa::Fixtures.import_snippets('test.host', 'example.com')
@@ -198,7 +198,7 @@ class MirrorsTest < ActiveSupport::TestCase
198
198
  assert_difference 'mirror.pages.count', 1 do
199
199
  assert_difference 'mirror.snippets.count', 1 do
200
200
 
201
- mirror.update_attribute(:is_mirrored, true)
201
+ mirror.update_attributes(:is_mirrored => true)
202
202
 
203
203
  site.reload
204
204
  assert site.layouts.where(:identifier => 'mirror_layout').present?
@@ -83,7 +83,7 @@ class CmsBlockTest < ActiveSupport::TestCase
83
83
 
84
84
  def test_creation_and_update_via_nested_attributes_with_file
85
85
  layout = cms_layouts(:default)
86
- layout.update_attribute(:content, '{{cms:page_file:file}}')
86
+ layout.update_column(:content, '{{cms:page_file:file}}')
87
87
 
88
88
  page = nil
89
89
  assert_difference ['Cms::Page.count', 'Cms::Block.count', 'Cms::File.count'] do
@@ -125,7 +125,7 @@ class CmsBlockTest < ActiveSupport::TestCase
125
125
 
126
126
  def test_creation_and_update_via_nested_attributes_with_files
127
127
  layout = cms_layouts(:default)
128
- layout.update_attribute(:content, '{{cms:page_files:files}}')
128
+ layout.update_column(:content, '{{cms:page_files:files}}')
129
129
 
130
130
  page = nil
131
131
  assert_difference ['Cms::Page.count', 'Cms::Block.count'] do
@@ -168,7 +168,7 @@ class CmsBlockTest < ActiveSupport::TestCase
168
168
 
169
169
  def test_creation_via_nested_attributes_with_file
170
170
  layout = cms_layouts(:default)
171
- layout.update_attribute(:content, '{{cms:page:header}}{{cms:page_file:file}}{{cms:page:footer}}')
171
+ layout.update_column(:content, '{{cms:page:header}}{{cms:page_file:file}}{{cms:page:footer}}')
172
172
 
173
173
  assert_difference 'Cms::Page.count' do
174
174
  assert_difference 'Cms::Block.count', 3 do
@@ -45,14 +45,14 @@ class CmsCategorizationTest < ActiveSupport::TestCase
45
45
  snippet = cms_snippets(:default)
46
46
  assert_equal 0, snippet.categories.count
47
47
 
48
- snippet.update_attribute(:category_ids, {
48
+ snippet.update_attributes(:category_ids => {
49
49
  cms_categories(:default).id => 1,
50
50
  'invalid' => 1
51
51
  })
52
52
  snippet.reload
53
53
  assert_equal 1, snippet.categories.count
54
54
 
55
- snippet.update_attribute(:category_ids, {
55
+ snippet.update_attributes(:category_ids => {
56
56
  cms_categories(:default).id => 0,
57
57
  'invalid' => 0
58
58
  })
@@ -75,7 +75,7 @@ class CmsFileTest < ActiveSupport::TestCase
75
75
  assert_equal 1, Cms::File.images.count
76
76
  assert_equal 0, Cms::File.not_images.count
77
77
 
78
- file.update_attribute(:file_content_type, 'application/pdf')
78
+ file.update_column(:file_content_type, 'application/pdf')
79
79
  assert_equal 0, Cms::File.images.count
80
80
  assert_equal 1, Cms::File.not_images.count
81
81
  end
@@ -72,10 +72,10 @@ class CmsLayoutTest < ActiveSupport::TestCase
72
72
  assert_equal "{{cms:page:left_column}}\n{{cms:page:right_column}}", child_layout.content
73
73
  assert_equal "{{cms:page:header}}\n{{cms:page:left_column}}\n{{cms:page:right_column}}", child_layout.merged_content
74
74
 
75
- child_layout.update_attribute(:content, '{{cms:page:content}}')
75
+ child_layout.update_column(:content, '{{cms:page:content}}')
76
76
  assert_equal "{{cms:page:header}}\n{{cms:page:content}}", child_layout.merged_content
77
77
 
78
- parent_layout.update_attribute(:content, '{{cms:page:whatever}}')
78
+ parent_layout.update_column(:content, '{{cms:page:whatever}}')
79
79
  child_layout.reload
80
80
  assert_equal '{{cms:page:content}}', child_layout.merged_content
81
81
  end
@@ -114,7 +114,7 @@ class CmsLayoutTest < ActiveSupport::TestCase
114
114
  assert_equal "header_content\ncontent_content", page_1.content
115
115
  assert_equal "header_content\nleft_column_content\nleft_column_content", page_2.content
116
116
 
117
- layout_1.update_attribute(:content, "Updated {{cms:page:content}}")
117
+ layout_1.update_attributes(:content => "Updated {{cms:page:content}}")
118
118
  page_1.reload
119
119
  page_2.reload
120
120
 
@@ -55,6 +55,24 @@ class CmsPageTest < ActiveSupport::TestCase
55
55
 
56
56
  page.slug = 'acción'
57
57
  assert page.valid?
58
+
59
+ page.slug = 'a'*256
60
+ assert page.invalid?
61
+ assert page.errors[:slug].present?
62
+
63
+ page.slug = 'a'*254
64
+ assert page.valid?
65
+ end
66
+
67
+
68
+ def test_validation_of_full_path
69
+ page = cms_pages(:child)
70
+ page.slug = 'a'*255
71
+ assert page.invalid?
72
+ assert page.errors[:full_path].present?
73
+
74
+ page.slug = 'a'*254
75
+ assert page.valid?
58
76
  end
59
77
 
60
78
  def test_validation_of_slug_allows_unicode_accent_characters
@@ -195,7 +213,7 @@ class CmsPageTest < ActiveSupport::TestCase
195
213
  assert_equal page.read_attribute(:content), page.content
196
214
  assert_equal page.read_attribute(:content), page.content(true)
197
215
 
198
- page.update_attribute(:content, 'changed')
216
+ page.update_attributes(:content => 'changed')
199
217
  assert_equal page.read_attribute(:content), page.content
200
218
  assert_equal page.read_attribute(:content), page.content(true)
201
219
  assert_not_equal 'changed', page.read_attribute(:content)
@@ -203,7 +221,7 @@ class CmsPageTest < ActiveSupport::TestCase
203
221
 
204
222
  def test_scope_published
205
223
  assert_equal 2, Cms::Page.published.count
206
- cms_pages(:child).update_attribute(:is_published, false)
224
+ cms_pages(:child).update_column(:is_published, false)
207
225
  assert_equal 1, Cms::Page.published.count
208
226
  end
209
227
 
@@ -218,7 +236,7 @@ class CmsPageTest < ActiveSupport::TestCase
218
236
  assert_equal 'http://test.host/', cms_pages(:default).url
219
237
  assert_equal 'http://test.host/child-page', cms_pages(:child).url
220
238
 
221
- site.update_attribute(:path, '/en/site')
239
+ site.update_column(:path, '/en/site')
222
240
  cms_pages(:default).reload
223
241
  cms_pages(:child).reload
224
242
 
@@ -91,7 +91,7 @@ class CmsSiteTest < ActiveSupport::TestCase
91
91
  site = cms_sites(:default)
92
92
  assert !site.is_mirrored
93
93
  assert_equal 0, Cms::Site.mirrored.count
94
- site.update_attribute(:is_mirrored, true)
94
+ site.update_column(:is_mirrored, true)
95
95
  assert_equal 1, Cms::Site.mirrored.count
96
96
  end
97
97
 
@@ -41,7 +41,7 @@ class CmsSnippetTest < ActiveSupport::TestCase
41
41
  snippet = cms_snippets(:default)
42
42
  page = cms_pages(:default)
43
43
  assert_match snippet.content, page.content
44
- snippet.update_attribute(:content, 'new_snippet_content')
44
+ snippet.update_attributes(:content => 'new_snippet_content')
45
45
  page.reload
46
46
  assert_match /new_snippet_content/, page.content
47
47
  end
@@ -49,7 +49,7 @@ class RevisionsTest < ActiveSupport::TestCase
49
49
  def test_creation_for_layout_ignore
50
50
  layout = cms_layouts(:default)
51
51
  assert_no_difference 'layout.revisions.count' do
52
- layout.update_attribute(:label, 'new label')
52
+ layout.update_attributes(:label => 'new label')
53
53
  end
54
54
  end
55
55
 
@@ -79,7 +79,7 @@ class RevisionsTest < ActiveSupport::TestCase
79
79
  def test_creation_for_page_ignore
80
80
  page = cms_pages(:default)
81
81
  assert_no_difference 'page.revisions.count' do
82
- page.update_attribute(:label, 'new label')
82
+ page.update_attributes(:label => 'new label')
83
83
  end
84
84
  end
85
85
 
@@ -88,7 +88,7 @@ class RevisionsTest < ActiveSupport::TestCase
88
88
  old_attributes = snippet.attributes.slice('content')
89
89
 
90
90
  assert_difference 'snippet.revisions.count' do
91
- snippet.update_attribute(:content, 'new content')
91
+ snippet.update_attributes(:content => 'new content')
92
92
  snippet.reload
93
93
  assert_equal 2, snippet.revisions.count
94
94
  revision = snippet.revisions.first
@@ -99,7 +99,7 @@ class RevisionsTest < ActiveSupport::TestCase
99
99
  def test_creation_for_snippet_ignore
100
100
  snippet = cms_snippets(:default)
101
101
  assert_no_difference 'snippet.revisions.count' do
102
- snippet.update_attribute(:label, 'new label')
102
+ snippet.update_attributes(:label => 'new label')
103
103
  end
104
104
  end
105
105
 
@@ -173,7 +173,7 @@ class RevisionsTest < ActiveSupport::TestCase
173
173
  assert_equal 1, snippet.revisions.count
174
174
 
175
175
  assert_no_difference 'snippet.revisions.count' do
176
- snippet.update_attribute(:content, 'new content')
176
+ snippet.update_attributes(:content => 'new content')
177
177
  assert_nil Cms::Revision.find_by_id(revision.id)
178
178
 
179
179
  snippet.reload