diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 7a231d1..44baae7 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -1,4 +1,9 @@ class AccountController < ApplicationController + + + + uses_flexible_template :owner => 'owner' + # Be sure to include AuthenticationSystem in Application Controller instead include AuthenticatedSystem # If you want "remember me" functionality, add this before_filter to Application Controller diff --git a/app/controllers/edit_template_controller.rb b/app/controllers/edit_template_controller.rb index bf1ae2e..ea65d1b 100644 --- a/app/controllers/edit_template_controller.rb +++ b/app/controllers/edit_template_controller.rb @@ -1,6 +1,6 @@ class EditTemplateController < ApplicationController - uses_flexible_template(:edit => true, :owner => 'owner') + uses_flexible_template :edit => true, :owner => 'owner' def flexible_template_owner Profile.find(1) diff --git a/app/controllers/features_controller.rb b/app/controllers/features_controller.rb index ab4faa2..ebeac69 100644 --- a/app/controllers/features_controller.rb +++ b/app/controllers/features_controller.rb @@ -1,4 +1,8 @@ class FeaturesController < ApplicationController + + uses_flexible_template :owner => 'owner' + + acts_as_virtual_community_admin_controller def index diff --git a/app/controllers/manage_tags_controller.rb b/app/controllers/manage_tags_controller.rb index 5541b35..9e5cad4 100644 --- a/app/controllers/manage_tags_controller.rb +++ b/app/controllers/manage_tags_controller.rb @@ -2,6 +2,10 @@ require 'extended_tag.rb' # Manage tags stored by the acts-as_taggable_on_steroids plugin by providing an interface to create, destroy, update and list them class ManageTagsController < ApplicationController + + uses_flexible_template :owner => 'owner' + + # Index redirects to list action without modifing the url def index redirect_to :action => 'list' diff --git a/app/views/layouts/account.rhtml b/app/views/layouts/account.rhtml index 170f74e..4bc2fde 100644 --- a/app/views/layouts/account.rhtml +++ b/app/views/layouts/account.rhtml @@ -1,8 +1,8 @@ <%= javascript_include_tag :defaults %> - <%= javascript_include_tag_template @chosen_template %> - <%= stylesheet_link_tag_template @chosen_template %> + <%= javascript_include_tag_template %> + <%= stylesheet_link_tag_template %> diff --git a/app/views/layouts/virtual_community_admin.rhtml b/app/views/layouts/virtual_community_admin.rhtml index 8be0f29..1d93d0c 100644 --- a/app/views/layouts/virtual_community_admin.rhtml +++ b/app/views/layouts/virtual_community_admin.rhtml @@ -1,8 +1,8 @@ <%= javascript_include_tag :defaults %> - <%= javascript_include_tag_template @chosen_template %> - <%= stylesheet_link_tag_template @chosen_template %> + <%= javascript_include_tag_template %> + <%= stylesheet_link_tag_template %> diff --git a/lib/extended_tag.rb b/lib/extended_tag.rb index 8078135..c15b0ab 100644 --- a/lib/extended_tag.rb +++ b/lib/extended_tag.rb @@ -13,7 +13,7 @@ class Tag end end - acts_as_ferret :fields => [:name] +# acts_as_ferret :fields => [:name] # Return all the tags that were suggested but not yet approved diff --git a/test/functional/application_controller_test.rb b/test/functional/application_controller_test.rb index 468b850..63681df 100644 --- a/test/functional/application_controller_test.rb +++ b/test/functional/application_controller_test.rb @@ -24,20 +24,6 @@ class ApplicationControllerTest < Test::Unit::TestCase assert_tag :tag => 'span', :content => 'post_only' end - - def test_load_template_default - get :index - assert_equal assigns(:chosen_template), 'default' - end - - def test_load_template_other - p = Profile.find(1) - p.template = "other" - p.save - get :index - assert_equal assigns(:chosen_template), 'other' - end - def test_exist_owner get :index assert_not_nil assigns(:owner) @@ -45,12 +31,16 @@ class ApplicationControllerTest < Test::Unit::TestCase def test_exist_chosen_theme get :index - assert_not_nil assigns(:chosen_theme) + assert_not_nil assigns(:ft_config) + conf = assigns(:ft_config) + assert_not_nil conf[:theme] end def test_exist_chosen_icons_theme get :index - assert_not_nil assigns(:chosen_icons_theme) + assert_not_nil assigns(:ft_config) + conf = assigns(:ft_config) + assert_not_nil conf[:icons_theme] end def test_should_generate_help_box_when_passing_string diff --git a/test/functional/edit_template_controller_test.rb b/test/functional/edit_template_controller_test.rb index 0c76e07..955da59 100644 --- a/test/functional/edit_template_controller_test.rb +++ b/test/functional/edit_template_controller_test.rb @@ -5,15 +5,19 @@ require 'edit_template_controller' class EditTemplateController; def rescue_action(e) raise e end; end class EditTemplateControllerTest < Test::Unit::TestCase + def setup @controller = EditTemplateController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new + @rejected_dirs = ['.', '..', '.svn'] + @theme_dir_path = "#{RAILS_ROOT}/public/themes" + @icons_dir_path = "#{RAILS_ROOT}/public/icons" end def test_select_theme_html get :index - available_themes = Dir.new(ApplicationHelper::THEME_DIR_PATH).to_a - ApplicationHelper::REJECTED_DIRS + available_themes = Dir.new(@theme_dir_path).to_a - @rejected_dirs available_themes.collect do |t| assert_tag :tag => 'select', :attributes => {:id => 'theme_name', :name => 'theme_name'}, :child => {:tag =>"option", :attributes => {:value => t}} end @@ -22,7 +26,7 @@ class EditTemplateControllerTest < Test::Unit::TestCase def test_select_icons_theme_html get :index - available_icons = Dir.new(ApplicationHelper::ICONS_DIR_PATH).to_a - ApplicationHelper::REJECTED_DIRS + available_icons = Dir.new(@icons_dir_path).to_a - @rejected_dirs available_icons.collect do |t| assert_tag :tag => 'select', :attributes => {:id => 'icons_theme_name', :name => 'icons_theme_name'}, :child => {:tag =>"option", :attributes => {:value => t}} end diff --git a/test/mocks/test/test_controller.rb b/test/mocks/test/test_controller.rb index 8beb290..03ad537 100644 --- a/test/mocks/test/test_controller.rb +++ b/test/mocks/test/test_controller.rb @@ -1,4 +1,7 @@ class TestController < ApplicationController + + uses_flexible_template :owner => 'owner' + def index render :text => 'index' end -- libgit2 0.21.2