Displaying 3 results from an estimated 3 matches for "controllertest".
Did you mean:
controller_test
2006 Feb 01
3
Testing components
...uplicate
my normal controller tests I have:
require File.dirname(__FILE__) + ''/../test_helper''
require File.dirname(__FILE__) + ''news_controller''
# Re-raise errors caught by the controller.
class NewsController; def rescue_action(e) raise e end; end
class NewsControllerTest < Test::Unit::TestCase
def setup
@controller = NewsController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
end
# Replace this with your real tests.
def test_content
get :content
assert_response :success
asse...
2007 May 30
0
DRYing up controller tests and mailer tests using superclasses
...we don''t explicitly setup the @request and @response objects
anymore, we should probably show how to use them in the dummy test_foo
method. Could be something like:
def test_foo
@request.host = "foo.bar.com"
assert true
...
end
* The creation of the method_added-method in ControllerTest and
MailerTest should probably be DRYed up and put into RailsTest.
In any case, feedback on this is appreciated.
Thanks!
Ciao!
Florian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core"...
2006 Oct 28
2
where is the "record" method??? i.e. which is used in generators (e.g. scaffold_generator.rb)
...like in the scaffold generator. An extract from it is below (taken from
scaffold_generator.rb):
def manifest
record do |m|
# Check for class naming collisions.
m.class_collisions controller_class_path,
"#{controller_class_name}Controller",
"#{controller_class_name}ControllerTest", "#{controller_class_name}Helper"
Thanks
Greg
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5T...