From 19945d2e1bd0d80cc9ba71a53ecac17123e42993 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Thu, 30 Jan 2014 11:30:12 -0300 Subject: [PATCH] rails3: fix some functional tests --- app/helpers/application_helper.rb | 2 +- app/helpers/boxes_helper.rb | 2 +- app/views/categories/_form.html.erb | 2 +- app/views/cms/_blog.html.erb | 6 +++--- app/views/manage_products/_edit_image.html.erb | 2 +- app/views/manage_products/_form.html.erb | 2 +- app/views/memberships/new_community.html.erb | 2 +- app/views/profile_editor/edit.html.erb | 2 +- app/views/shared/_lead_and_body.html.erb | 2 +- app/views/tasks/_task.html.erb | 2 +- test/functional/cms_controller_test.rb | 2 +- test/functional/themes_controller_test.rb | 4 ++-- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a07ec9b..ee55da0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -641,7 +641,7 @@ module ApplicationHelper cat.full_name_without_leading(1, " → "), "#{object_name}[category_ids][]", cat.id, object.category_ids.include?(cat.id), :id => checkbox_id, - :onchange => 'this.parentNode.className=(this.checked?"cat_checked":"")' ), + :onchange => j('this.parentNode.className=(this.checked?"cat_checked":"")') ), :class => ( object.category_ids.include?(cat.id) ? 'cat_checked' : '' ) ) + "\n" end end diff --git a/app/helpers/boxes_helper.rb b/app/helpers/boxes_helper.rb index dd67d4d..f6323e5 100644 --- a/app/helpers/boxes_helper.rb +++ b/app/helpers/boxes_helper.rb @@ -227,7 +227,7 @@ module BoxesHelper # DEPRECATED. Do not use this. def import_blocks_stylesheets(options = {}) - @blocks_css_files ||= current_blocks.map{|b|'blocks/' + block.class.name.to_css_class}.uniq + @blocks_css_files ||= current_blocks.map{|block|'blocks/' + block.class.name.to_css_class}.uniq stylesheet_import(@blocks_css_files, options) end def block_css_classes(block) diff --git a/app/views/categories/_form.html.erb b/app/views/categories/_form.html.erb index 93318d0..b0fac34 100644 --- a/app/views/categories/_form.html.erb +++ b/app/views/categories/_form.html.erb @@ -19,7 +19,7 @@ <%= labelled_check_box(_('Display in the menu'), 'category[display_in_menu]', '1', @category.display_in_menu) %> - <% f.fields_for :image_builder, @category.image do |i| %> + <%= f.fields_for :image_builder, @category.image do |i| %> <%= file_field_or_thumbnail(_('Image:'), @category.image, i) %> <% end %> diff --git a/app/views/cms/_blog.html.erb b/app/views/cms/_blog.html.erb index bece474..4625207 100644 --- a/app/views/cms/_blog.html.erb +++ b/app/views/cms/_blog.html.erb @@ -54,7 +54,7 @@ <%= labelled_form_field(_('Description:'), text_area(:article, :body, :rows => 10)) %> -<% f.fields_for :image_builder, @article.image do |i| %> +<%= f.fields_for :image_builder, @article.image do |i| %> <%= file_field_or_thumbnail(_('Cover image:'), @article.image, i)%> <%= _("Max size: %s (.jpg, .gif, .png)")% Image.max_size.to_humanreadable %> <% end %> @@ -69,12 +69,12 @@ <%= labelled_check_box(_("List only translated posts"), 'article[display_posts_in_current_language]', '1', @article.display_posts_in_current_language?) %> -<% f.fields_for 'feed', @article.feed do |feed| %> +<%= f.fields_for 'feed', @article.feed do |feed| %> <%= labelled_form_field(_('Limit of posts in RSS Feed'), feed.select(:limit, [5, 10, 20, 50])) %> <%= labelled_form_field(_('Include in RSS Feed only posts from language:'), feed.select(:language, [[_('All'), nil ]] + environment.locales.map { |k,v| [v, k]})) %> <% end %> -<% f.fields_for 'external_feed_builder', @article.external_feed do |efeed| %> +<%= f.fields_for 'external_feed_builder', @article.external_feed do |efeed| %>
<% enabled = @article.external_feed && @article.external_feed.enabled %> <% only_once = @article.external_feed ? @article.external_feed.only_once : true %> diff --git a/app/views/manage_products/_edit_image.html.erb b/app/views/manage_products/_edit_image.html.erb index 5b554e1..55f8097 100644 --- a/app/views/manage_products/_edit_image.html.erb +++ b/app/views/manage_products/_edit_image.html.erb @@ -3,7 +3,7 @@
<%= form_for(:product, :url => { :controller => 'manage_products', :action => 'edit', :id => @product, :field => 'image' }, :html => { :method => 'post', :id => 'uploadForm', :multipart => true}) do |f| %> - <% f.fields_for :image_builder, @product.image do |i| %> + <%= f.fields_for :image_builder, @product.image do |i| %> <%= i.file_field( :uploaded_data, { :size => 10 } ) %>

<%= _("Max size: %s (.jpg, .gif, .png)")% Image.max_size.to_humanreadable %>

<% end %> diff --git a/app/views/manage_products/_form.html.erb b/app/views/manage_products/_form.html.erb index 0519f48..29a77a8 100644 --- a/app/views/manage_products/_form.html.erb +++ b/app/views/manage_products/_form.html.erb @@ -7,7 +7,7 @@ <%= display_form_field( _('Price:'), f.text_field(:price) ) %> <%= display_form_field( _('Description:'), f.text_area(:description, :rows => 10, :class => 'mceEditor') ) %> <%= labelled_form_field(f.check_box(:highlighted) + _('Highlight this product'),'') %> - <% f.fields_for :image_builder, @product.image do |i| %> + <%= f.fields_for :image_builder, @product.image do |i| %> <%= file_field_or_thumbnail(_('Image:'), @product.image, i) %> <% end %> diff --git a/app/views/memberships/new_community.html.erb b/app/views/memberships/new_community.html.erb index 69a834c..a7f8f66 100644 --- a/app/views/memberships/new_community.html.erb +++ b/app/views/memberships/new_community.html.erb @@ -24,7 +24,7 @@ <%= render :partial => 'shared/organization_custom_fields', :locals => { :f => f, :object_name => 'community', :profile => @community } %> - <% f.fields_for :image_builder, @community.image do |i| %> + <%= f.fields_for :image_builder, @community.image do |i| %> <%= file_field_or_thumbnail(_('Image:'), @community.image, i) %> <% end %> diff --git a/app/views/profile_editor/edit.html.erb b/app/views/profile_editor/edit.html.erb index bc6c0d0..1105082 100644 --- a/app/views/profile_editor/edit.html.erb +++ b/app/views/profile_editor/edit.html.erb @@ -17,7 +17,7 @@ <%= unchangeable_privacy_field @profile %>
- <% f.fields_for :image_builder, @profile.image do |i| %> + <%= f.fields_for :image_builder, @profile.image do |i| %> <%= file_field_or_thumbnail(_('Image:'), @profile.image, i) %><%= _("Max size: %s (.jpg, .gif, .png)")% Image.max_size.to_humanreadable %> <% end %>
diff --git a/app/views/shared/_lead_and_body.html.erb b/app/views/shared/_lead_and_body.html.erb index 0cf4962..b8b8130 100644 --- a/app/views/shared/_lead_and_body.html.erb +++ b/app/views/shared/_lead_and_body.html.erb @@ -8,7 +8,7 @@ <% f ||= false%> <% if @article %> - <% fields_for 'article[image_builder]', @article.image do |i| %> + <%= fields_for 'article[image_builder]', @article.image do |i| %> <%= file_field_or_thumbnail(_('Image:'), @article.image, i) %> <% end %> <% end %> diff --git a/app/views/tasks/_task.html.erb b/app/views/tasks/_task.html.erb index 6c15fe5..babec6f 100644 --- a/app/views/tasks/_task.html.erb +++ b/app/views/tasks/_task.html.erb @@ -28,7 +28,7 @@ <%= task_information(task) %> - <% fields_for "tasks[#{task.id}][task]", task do |f| %> + <%= fields_for "tasks[#{task.id}][task]", task do |f| %> <% if task.accept_details %>