From 7c86f0109321d27d9c23983fe7ce98695b05730d Mon Sep 17 00:00:00 2001 From: LeandroNunes Date: Tue, 17 Jul 2007 18:11:17 +0000 Subject: [PATCH] ActionItem0: loadding the corrects boxes --- app/controllers/application.rb | 1 - app/controllers/edit_template_controller.rb | 5 +++++ test/functional/edit_template_controller_test.rb | 5 +++++ test/mocks/test/virtual_community.rb | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 1698202..96b7bbc 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -44,7 +44,6 @@ class ApplicationController < ActionController::Base end def boxes_by_template(template) - #f = YAML.load_file("#{TEMPLATE_DIR_PATH}/#{template}/#{template}.yml") f = YAML.load_file("#{RAILS_ROOT}/public/templates/default/default.yml") number_of_boxes = f[template.to_s]["number_of_boxes"] raise _("The file #{template}.yml it's not a valid template filename") if number_of_boxes.nil? diff --git a/app/controllers/edit_template_controller.rb b/app/controllers/edit_template_controller.rb index e6381a7..5970592 100644 --- a/app/controllers/edit_template_controller.rb +++ b/app/controllers/edit_template_controller.rb @@ -2,4 +2,9 @@ class EditTemplateController < ApplicationController uses_manage_template :edit => true + def test + @bli = true + render :action => 'index' + end + end diff --git a/test/functional/edit_template_controller_test.rb b/test/functional/edit_template_controller_test.rb index 066251d..6121b34 100644 --- a/test/functional/edit_template_controller_test.rb +++ b/test/functional/edit_template_controller_test.rb @@ -13,6 +13,11 @@ class EditTemplateControllerTest < Test::Unit::TestCase # Replace this with your real tests. def test_truth + get :test + assert_response :success + assert_template 'index' + assert true + assert !assigns(:leo) end end diff --git a/test/mocks/test/virtual_community.rb b/test/mocks/test/virtual_community.rb index db23b5f..f907c1e 100644 --- a/test/mocks/test/virtual_community.rb +++ b/test/mocks/test/virtual_community.rb @@ -1,4 +1,4 @@ -require 'app/models/virtual_community' +require File.expand_path(File.dirname(__FILE__) + "/../../../app/models/virtual_community") class VirtualCommunity < ActiveRecord::Base def self.available_features -- libgit2 0.21.2