From 01c0f48380f6b3e3aff4947641261ca86647f892 Mon Sep 17 00:00:00 2001 From: Joenio Costa Date: Tue, 26 Aug 2014 17:59:14 -0300 Subject: [PATCH] adding some functional tests --- app/controllers/my_profile/cms_controller.rb | 2 +- app/helpers/article_helper.rb | 2 +- app/helpers/layout_helper.rb | 1 + app/views/cms/edit.html.erb | 3 +-- test/functional/cms_controller_test.rb | 17 +++++++++++++++++ 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/app/controllers/my_profile/cms_controller.rb b/app/controllers/my_profile/cms_controller.rb index bb192e4..9748164 100644 --- a/app/controllers/my_profile/cms_controller.rb +++ b/app/controllers/my_profile/cms_controller.rb @@ -7,7 +7,7 @@ class CmsController < MyProfileController def search_tags arg = params[:term].downcase result = ActsAsTaggableOn::Tag.find(:all, :conditions => ['LOWER(name) LIKE ?', "%#{arg}%"]) - render :text => prepare_to_token_input2(result).to_json + render :text => prepare_to_token_input_by_label(result).to_json, :content_type => 'application/json' end def self.protect_if(*args) diff --git a/app/helpers/article_helper.rb b/app/helpers/article_helper.rb index afcc572..567de43 100644 --- a/app/helpers/article_helper.rb +++ b/app/helpers/article_helper.rb @@ -83,7 +83,7 @@ module ArticleHelper array.map { |object| {:id => object.id, :name => object.name} } end - def prepare_to_token_input2(array) + def prepare_to_token_input_by_label(array) array.map { |object| {:label => object.name, :value => object.name} } end diff --git a/app/helpers/layout_helper.rb b/app/helpers/layout_helper.rb index 64d0541..e2db756 100644 --- a/app/helpers/layout_helper.rb +++ b/app/helpers/layout_helper.rb @@ -27,6 +27,7 @@ module LayoutHelper 'thickbox', 'lightbox', 'colorbox', + 'inputosaurus', pngfix_stylesheet_path, ] + tokeninput_stylesheets plugins_stylesheets = @plugins.select(&:stylesheet?).map { |plugin| plugin.class.public_path('style.css') } diff --git a/app/views/cms/edit.html.erb b/app/views/cms/edit.html.erb index ba4ed80..2508a60 100644 --- a/app/views/cms/edit.html.erb +++ b/app/views/cms/edit.html.erb @@ -33,9 +33,8 @@
- <%= stylesheet_link_tag('inputosaurus') %> - <%= f.text_field('tag_list', :size => 64) %> + <%= content_tag( 'small', _('Separate tags with commas') ) %>