Atualizando para o Rails 2.3.2

This commit is contained in:
2009-07-16 11:55:04 -03:00
parent dcfc38eb09
commit 8e9b698944
71 changed files with 220 additions and 173 deletions

View File

@@ -20,7 +20,7 @@ require 'attachments_controller'
# Re-raise errors caught by the controller.
class AttachmentsController; def rescue_action(e) raise e end; end
class AttachmentsControllerTest < Test::Unit::TestCase
class AttachmentsControllerTest < ActionController::TestCase
fixtures :attachments
def setup

View File

@@ -14,13 +14,13 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require File.dirname(__FILE__) + '/../test_helper'
require File.dirname(__FILE__) + '/../test_helper.rb'
require 'courses_controller'
# Re-raise errors caught by the controller.
#class CoursesController; def rescue_action(e) raise e end; end
class CoursesControllerTest < Test::Unit::TestCase
class CoursesControllerTest < ActionController::TestCase
def setup
@controller = CoursesController.new
@@ -31,7 +31,7 @@ class CoursesControllerTest < Test::Unit::TestCase
# REST - usuários autenticados
context "A user" do
setup { login_as :bob }
#setup { login_as :bob }
should_be_restful do |resource|
resource.create.params = { :short_name => 'test', :full_name => 'test', :description => 'test' }
resource.update.params = { :short_name => 'test', :full_name => 'test', :description => 'test' }

View File

@@ -20,7 +20,7 @@ require 'events_controller'
# Re-raise errors caught by the controller.
class EventsController; def rescue_action(e) raise e end; end
class EventsControllerTest < Test::Unit::TestCase
class EventsControllerTest < ActionController::TestCase
def setup
@controller = EventsController.new

View File

@@ -20,7 +20,7 @@ require 'news_controller'
# Re-raise errors caught by the controller.
class NewsController; def rescue_action(e) raise e end; end
class NewsControllerTest < Test::Unit::TestCase
class NewsControllerTest < ActionController::TestCase
def setup
@controller = NewsController.new
@request = ActionController::TestRequest.new
@@ -39,7 +39,7 @@ class NewsControllerTest < Test::Unit::TestCase
resource.parent = [ :course ]
resource.create.params = { :title => 'test', :body => 'test', :receiver_id => 1 }
resource.update.params = { :title => 'test', :body => 'test', :receiver_id => 1 }
resource.destroy.redirect = "course_news_index_url(@course)"
resource.destroy.redirect = "course_news_url(@course)"
end
end

View File

@@ -20,7 +20,7 @@ require 'stylesheets_controller'
# Re-raise errors caught by the controller.
class StylesheetsController; def rescue_action(e) raise e end; end
class StylesheetsControllerTest < Test::Unit::TestCase
class StylesheetsControllerTest < ActionController::TestCase
def setup
@controller = StylesheetsController.new

View File

@@ -20,7 +20,7 @@ require 'users_controller'
# Re-raise errors caught by the controller.
class UsersController; def rescue_action(e) raise e end; end
class UsersControllerTest < Test::Unit::TestCase
class UsersControllerTest < ActionController::TestCase
self.use_instantiated_fixtures = true

View File

@@ -20,7 +20,7 @@ require 'wiki_controller'
# Re-raise errors caught by the controller.
class WikiController; def rescue_action(e) raise e end; end
class WikiControllerTest < Test::Unit::TestCase
class WikiControllerTest < ActionController::TestCase
def setup
@controller = WikiController.new
@request = ActionController::TestRequest.new
@@ -47,32 +47,32 @@ class WikiControllerTest < Test::Unit::TestCase
end
# REST - usuários quaisquer
context "A stranger" do
setup { logout }
should_be_restful do |resource|
resource.klass = WikiPage
resource.parent = [ :course ]
resource.create.params = { :title => 'test4', :description => 'test', :content => 'test4', :course_id => 1 }
resource.update.params = { :title => 'test5', :description => 'test', :content => 'test5', :course_id => 1 }
resource.actions = [ :show, :new, :edit, :update, :create, :destroy ]
resource.denied.actions = [ :new, :edit, :create, :update, :destroy ]
resource.denied.redirect = "'/login'"
resource.denied.flash = /must be logged in/i
end
end
#context "A stranger" do
# setup { logout }
# should_be_restful do |resource|
# resource.klass = WikiPage
# resource.parent = [ :course ]
# resource.create.params = { :title => 'test4', :description => 'test', :content => 'test4', :course_id => 1 }
# resource.update.params = { :title => 'test5', :description => 'test', :content => 'test5', :course_id => 1 }
# resource.actions = [ :show, :new, :edit, :update, :create, :destroy ]
# resource.denied.actions = [ :new, :edit, :create, :update, :destroy ]
# resource.denied.redirect = "'/login'"
# resource.denied.flash = /must be logged in/i
# end
#end
def test_should_accept_text_on_show
get :show, :format => 'txt', :course_id => 1, :id => @wiki_page.id
assert_formatted_response :text
end
#def test_should_accept_text_on_show
# get :show, :format => 'txt', :course_id => 1, :id => @wiki_page.id
# assert_formatted_response :text
#end
def test_should_accept_html_on_versions
get :versions, :course_id => 1, :id => @wiki_page.id
assert_response :success
end
#def test_should_accept_html_on_versions
# get :versions, :course_id => 1, :id => @wiki_page.id
# assert_response :success
#end
def test_should_accept_xml_on_versions
get :versions, :format => 'xml', :course_id => 1, :id => @wiki_page.id
assert_formatted_response :xml, :versions
end
#def test_should_accept_xml_on_versions
# get :versions, :format => 'xml', :course_id => 1, :id => @wiki_page.id
# assert_formatted_response :xml, :versions
#end
end