1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00
thoughtbot--shoulda-matchers/test/functional/users_controller_test.rb
tsaleh 3a8b77d1a1 - completely refactored the test system to use a fake rails_root
- added XML tests
- renamed should_be_a_resource to should_be_restful



git-svn-id: https://svn.thoughtbot.com/plugins/shoulda/trunk@132 7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
2007-07-14 18:35:51 +00:00

25 lines
780 B
Ruby

require File.dirname(__FILE__) + '/../test_helper'
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
load_all_fixtures
def setup
@controller = UsersController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
@user = User.find(:first)
end
should_be_restful do |resource|
resource.create.params = { :name => "bob", :email => 'bob@bob.com', :age => 13}
resource.update.params = { :name => "sue" }
resource.create.redirect = "user_url(record)"
resource.update.redirect = "user_url(record)"
resource.destroy.redirect = "users_url"
end
end