fixes for rails 3.0

Oleg committed Aug 26, 2011
commit 648b011a3b5f472909072a03e0aeaa6f741ed685
Showing 5 changed files with 5 additions and 5 deletions
app/views/cms_admin/files/_index.html.erb +1 -1
@@ @@ -1,6 +1,6 @@
<div id='file_uploads' class='box'>
- <%= form_for :file, :url => cms_admin_site_files_path(@site) do |form| %>
+ <%= form_for :file, :url => cms_admin_site_files_path(@site), :html => {:multipart => true} do |form| %>
<a id='uploader_button' href='#' class='big button'><%= t('.button') %></a>
<%= form.file_field :file, :multiple => true %>
<% end %>
app/views/cms_admin/files/edit.html.erb +1 -1
@@ @@ -1,4 +1,4 @@
- <h1><%= t('.title')%></h1>
+ <h1><%= t('.title') %></h1>
<%= cms_form_for @file, :as => :file, :url => {:action => :update} do |form| %>
<%= render :partial => 'form', :object => form %>
app/views/cms_admin/files/new.html.erb +1 -1
@@ @@ -1,5 +1,5 @@
<h1><%= t('.title') %></h1>
- <%= cms_form_for @file, :as => :file, :url => {:action => :create} do |form| %>
+ <%= cms_form_for @file, :as => :file, :url => {:action => :create}, :html => {:multipart => true} do |form| %>
<%= render :partial => 'form', :object => form %>
<% end %>
test/functional/cms_admin/files_controller_test.rb +1 -1
@@ @@ -37,7 +37,7 @@ class CmsAdmin::FilesControllerTest < ActionController::TestCase
assert_response :success
assert assigns(:file)
assert_template :new
- assert_select "form[action=/cms-admin/sites/#{site.id}/files]"
+ assert_select "form[action=/cms-admin/sites/#{site.id}/files][enctype=multipart/form-data]"
end
def test_get_edit
test/unit/models/categorization_test.rb +1 -1
@@ @@ -70,7 +70,7 @@ class CmsCategorizationTest < ActiveSupport::TestCase
new_category = Cms::Category.create!(:label => 'Test Category', :categorized_type => 'Cms::File')
new_category.categorizations.create!(:categorized => cms_files(:default))
assert_equal 1, Cms::File.for_category(category.label, new_category.label).all.size
- assert_equal 1, Cms::File.for_category(category.label, new_category.label).count(:distinct => true)
+ assert_equal 1, Cms::File.for_category(category.label, new_category.label).count('cms_files.id', :distinct => true)
end
end
\ No newline at end of file