Commit d0737aa108ae0494cf2a6926ed2655dadc00f4a8

Authored by AntonioTerceiro
1 parent b1512131

ActionItem8: trying to make all tests pass

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@294 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/models/link_block.rb
1 -class LinkBlock < Block 1 +class LinkBlock < Design::Block
2 2
3 def content 3 def content
4 Profile.find(:all).map{|p| p.name} 4 Profile.find(:all).map{|p| p.name}
test/functional/manage_tags_controller_test.rb
@@ -6,7 +6,7 @@ class ManageTagsController; def rescue_action(e) raise e end; end @@ -6,7 +6,7 @@ class ManageTagsController; def rescue_action(e) raise e end; end
6 6
7 class ManageTagsControllerTest < Test::Unit::TestCase 7 class ManageTagsControllerTest < Test::Unit::TestCase
8 8
9 - fixtures :profiles, :boxes, :blocks, :domains 9 + fixtures :profiles, :design_boxes, :design_blocks, :domains
10 10
11 def setup 11 def setup
12 @controller = ManageTagsController.new 12 @controller = ManageTagsController.new
test/integration/manage_tags_test.rb
1 require "#{File.dirname(__FILE__)}/../test_helper" 1 require "#{File.dirname(__FILE__)}/../test_helper"
2 2
3 class ManageTagsTest < ActionController::IntegrationTest 3 class ManageTagsTest < ActionController::IntegrationTest
4 - fixtures :tags, :profiles, :boxes, :blocks 4 + fixtures :tags, :profiles, :design_boxes, :design_blocks
5 5
6 def test_tags_create_edit_destroy 6 def test_tags_create_edit_destroy
7 get '/admin/manage_tags' 7 get '/admin/manage_tags'
test/mocks/test/test_controller.rb
1 class TestController < ApplicationController 1 class TestController < ApplicationController
2 2
3 - uses_flexible_template :owner => 'owner'  
4 -  
5 def index 3 def index
6 render :text => 'index' 4 render :text => 'index'
7 end 5 end
test/unit/block_test.rb
@@ -1,62 +0,0 @@ @@ -1,62 +0,0 @@
1 -require File.dirname(__FILE__) + '/../test_helper'  
2 -  
3 -class BlockTest < Test::Unit::TestCase  
4 - fixtures :design_blocks, :profiles  
5 -  
6 - def setup  
7 - @profile = Profile.find(1)  
8 - end  
9 -  
10 - def test_setup_assumptions  
11 - assert @profile.valid?  
12 - end  
13 -#TODO remove it this tests are now on design plugin  
14 -# # Replace this with your real tests.  
15 -# def test_create  
16 -# count = Block.count  
17 -# b = Block.new  
18 -# assert !b.valid?  
19 -# assert b.errors.invalid?(:box_id)  
20 -# assert b.errors.invalid?(:position)  
21 -#  
22 -# box = Box.new  
23 -# box.owner = @profile  
24 -# box.number = 1000  
25 -# assert box.save  
26 -# b.box = box  
27 -# assert !b.valid?  
28 -# assert b.errors.invalid?(:position)  
29 -#  
30 -# b.position=1  
31 -# assert b.save  
32 -#  
33 -# assert_equal count + 1, Block.count  
34 -# end  
35 -#  
36 -# def test_box_presence  
37 -# b = Block.new  
38 -# b.position = 1000  
39 -# assert !b.valid?  
40 -# assert b.errors.invalid?(:box_id)  
41 -#  
42 -# box = Box.new  
43 -# box.owner = @profile  
44 -# box.number = 1000  
45 -# assert box.save  
46 -# b.box = box  
47 -# assert b.valid?  
48 -#  
49 -# end  
50 -#  
51 -# def test_destroy  
52 -# b = Block.find(1)  
53 -# assert b.destroy  
54 -# end  
55 -#  
56 -# def test_valid_fixtures  
57 -# Block.find(:all).each do |b|  
58 -# assert b.valid?  
59 -# end  
60 -# end  
61 -  
62 -end  
test/unit/box_test.rb
@@ -1,64 +0,0 @@ @@ -1,64 +0,0 @@
1 -require File.dirname(__FILE__) + '/../test_helper'  
2 -  
3 -class BoxTest < Test::Unit::TestCase  
4 - fixtures :design_boxes, :design_blocks, :profiles  
5 -  
6 - def setup  
7 - @owner = Profile.find(1)  
8 - end  
9 -  
10 - def test_setup  
11 - assert @owner.valid?  
12 - end  
13 -#TODO remove this file these tests are now on desgin plugin  
14 -# def test_destroy  
15 -# count = Box.count  
16 -# assert Box.find(1).destroy  
17 -# assert_equal count - 1, Box.count  
18 -# end  
19 -#  
20 -# def test_create  
21 -# count = Box.count  
22 -# b = Box.new  
23 -# b.owner = @owner  
24 -# assert b.save  
25 -# assert count + 1, Box.count  
26 -# end  
27 -#  
28 -#  
29 -# def test_number_format  
30 -# b = Box.new  
31 -# b.number = "none"  
32 -# assert !b.valid?  
33 -# assert b.errors.invalid?(:number)  
34 -#  
35 -# b = Box.new  
36 -# b.number = 10.2  
37 -# assert !b.save  
38 -#  
39 -# b = Box.new  
40 -# b.owner = @owner  
41 -# assert b.save  
42 -#  
43 -# end  
44 -#  
45 -# def test_unique_number  
46 -# assert Box.delete_all  
47 -# b = Box.new  
48 -# b.owner = @owner  
49 -# assert b.save  
50 -#  
51 -# b = Box.new  
52 -# b.owner = @owner  
53 -# b.number = 1  
54 -# assert !b.valid?  
55 -# assert b.errors.invalid?(:number)  
56 -# end  
57 -#  
58 -# def test_presence_number  
59 -# b = Box.new(:number => nil)  
60 -# assert !b.valid?  
61 -# assert b.errors.invalid?(:number)  
62 -# end  
63 -  
64 -end