Commit 7c86f0109321d27d9c23983fe7ce98695b05730d

Authored by LeandroNunes
1 parent cf5172f0

ActionItem0: loadding the corrects boxes

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@90 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/controllers/application.rb
@@ -44,7 +44,6 @@ class ApplicationController < ActionController::Base @@ -44,7 +44,6 @@ class ApplicationController < ActionController::Base
44 end 44 end
45 45
46 def boxes_by_template(template) 46 def boxes_by_template(template)
47 - #f = YAML.load_file("#{TEMPLATE_DIR_PATH}/#{template}/#{template}.yml")  
48 f = YAML.load_file("#{RAILS_ROOT}/public/templates/default/default.yml") 47 f = YAML.load_file("#{RAILS_ROOT}/public/templates/default/default.yml")
49 number_of_boxes = f[template.to_s]["number_of_boxes"] 48 number_of_boxes = f[template.to_s]["number_of_boxes"]
50 raise _("The file #{template}.yml it's not a valid template filename") if number_of_boxes.nil? 49 raise _("The file #{template}.yml it's not a valid template filename") if number_of_boxes.nil?
app/controllers/edit_template_controller.rb
@@ -2,4 +2,9 @@ class EditTemplateController < ApplicationController @@ -2,4 +2,9 @@ class EditTemplateController < ApplicationController
2 2
3 uses_manage_template :edit => true 3 uses_manage_template :edit => true
4 4
  5 + def test
  6 + @bli = true
  7 + render :action => 'index'
  8 + end
  9 +
5 end 10 end
test/functional/edit_template_controller_test.rb
@@ -13,6 +13,11 @@ class EditTemplateControllerTest < Test::Unit::TestCase @@ -13,6 +13,11 @@ class EditTemplateControllerTest < Test::Unit::TestCase
13 13
14 # Replace this with your real tests. 14 # Replace this with your real tests.
15 def test_truth 15 def test_truth
  16 + get :test
  17 + assert_response :success
  18 + assert_template 'index'
  19 +
16 assert true 20 assert true
  21 + assert !assigns(:leo)
17 end 22 end
18 end 23 end
test/mocks/test/virtual_community.rb
1 -require 'app/models/virtual_community' 1 +require File.expand_path(File.dirname(__FILE__) + "/../../../app/models/virtual_community")
2 2
3 class VirtualCommunity < ActiveRecord::Base 3 class VirtualCommunity < ActiveRecord::Base
4 def self.available_features 4 def self.available_features