similar to: ActionController::TestRequest bug?

Displaying 20 results from an estimated 20000 matches similar to: "ActionController::TestRequest bug?"

2006 Jul 06
6
Problem with gettext and functional tests
Hi, I am using gettext to let my web application know several languages. All works fine, but since I integrated it, my functional tests don''t work any more. I keep getting the error message: NoMethodError: undefined method `cgi'' for #<ActionController::TestRequest:0xb77f7f88>. All right, TestRequest doesn''t have a cgi method. Therefore I just included this into
2007 Apr 06
0
Setting headers in TestRequest
Hi. I''m using HTTP Basic auth for some of my REST interfaces, so I want to run tests setting the HTTP AUTHORIZATION header. But I can''t find a way to do it in the functional test. I can see the response headers in @response.headers, but there''s no analogous hash in @request. Any hints? Also, I can''t find any API documentation for
2006 Mar 27
0
Where is ActionController::TestRequest documentation ?
Hi, I didn''t found any doc about this class - I''m looking for a solution to include a multipart uploaded file in a post request for testing purpose. How can I do ? Thanks -- Posted via http://www.ruby-forum.com/.
2006 Jan 14
0
testing template components
Hi, I''m plowing through the template section of "Agile Rails", specifically the stuff starting on P. 364. What is a good strategy for testing components? My initial thought is to mimic the Rails application "test" directory. No problem. Next copy the setup method, and set it up like so - class SidebarControllerTest < Test::Unit::TestCase def setup
2008 Feb 08
0
Challenge! How can I write a test to test the methods in ApplicationController?
Hi all, I''ve been Googling this one for a while now, and haven''t found a satisfactory answer. It has been posted here before by someone else, but it seems to have got forgotten, so here goes - perhaps someone can think up a way around the problem? In ApplicationController, I have the following method: class ApplicationController < ActionController::Base <snip>
2006 Feb 07
0
scope problems testing a helper method that calls link_to()
We''ve been having problems writing functional tests for helper methods that rely on ActionView methods. Here''s a specific example. In application_helper.rb I''ve got a method called ''party_link()ยจ: def party_link(party) link_to party.full_name, { :controller => ''contacts'', :action =>
2008 Mar 01
0
Fixtures in ActionController::TestCase
Hi guys, Need some help. I am using Rails 2.0 and while writing functional test, I encountered the following problem class UserControllerTest < ActionController::TestCase fixtures :users ... def do_something attempt_login(users(:valid_user)) # assuming valid_user is a proper line in ... end def attempt_login(user) post :login, :user => { :login => user.login, :password
2006 Feb 01
3
Testing components
I''m using template components to modularize an application I''m working on and am really happy with the way it''s going. Unfortunately, all my attempts at writing functional tests for them fail. Trying to duplicate my normal controller tests I have: require File.dirname(__FILE__) + ''/../test_helper'' require File.dirname(__FILE__) +
2009 Apr 06
9
setup method in functional tests and instance variables
I have the following in my functional test file. class UserControllerTest < ActionController::TestCase fixtures :users def setup @controller = UserController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new @invalid_user = user(:invalid_user) @valid_user = users(:valid_user) end def test_login_success
2006 Jun 16
0
rake spec controller test output hideus.
Is there any way to change the output of rake spec fails? The errors are just totally over the top ugly and not helpful. First of all the ruby -Ilib line always comes before each test and I find it distracting. But if an error occurs on something that is not nil it just gives me the entire contents of that object and that is no small matter when the object is a HTTP request response. Here is
2006 Jun 25
1
Having Trouble Using ActsAsTaggable
I''ve installed the acts_as_taggable plugin and modifed it according to the tutorial form making it user specific (http://www.slashdotdash.net/blog/articles/2006/04/29/acts_as_taggable-per-user-tagging ). I keep getting errors when I try to tag things, however, and have traced the problem to the line of the tag_with function that calls the find_or_create_by_name function. So I fired
2006 Apr 14
8
Error with Web Service tests after upgrading to Rails 1.1.2
Hello. I hope this is the right place to describe my problem ? After upgrading to Rails version 1.1.2 from rails version 1.0.0, Web Service functional tests seem broken. I upgraded rails (as the root user / administrator) with: # gem update rails --include-dependencies then I upgraded my application (as myself) with: ? rake rails:update % rake rails:update:configs After these steps,
2006 Jan 09
1
testing UrlHelper in ActionMailer
Hi All, So I found a helpful web page that explained how I could use things like url_for in my mails: http://wiki.rubyonrails.com/rails/pages/HowtoUseUrlHelpersWithActionMailer However, I can''t test them properly. The problem is that when I create a controller in my unit tests and pass it into the ActionMailer, it''s not a real controller, set up as a controller is when it is
2006 Jan 10
4
Problem creating MockController
Hi there, I''m trying to create a mock controller to test the use of UrlHelper in ActionMailer. I''m trying this: require ''d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller'' # Re-raise errors caught by the controller. #class DiscussionsController; def rescue_action(e) raise e end; end class MockController < ActionController::Base def
2006 Apr 27
6
Functional Test Problem. Nubee, please help
ALl my controllers require the user to be logged in. SO they will be redirected to my "login" controller. How do i login first in a functional test? Im assuming i use the setup method to login the controller. This is the setup method for the Activities controller functional test: def setup @controller = ActivitiesController.new @request =
2007 Mar 28
3
respond.should be_successful
I''m wondering: Does it make more sense to add on successful? as an alias for success? in ActionController:TestRequest? I keep getting these two mixed up in my specs and was wondering if it would be helpful to anyone as a small patch to rspec. Best, Scott
2009 Apr 05
3
Error reverting back to a previous version of rails
I want to revert back to a previous version of rails (1.2.3) but the project I want to work on was created in 2.0.2. I have uninstalled 2.0.2 and gem installed 1.2.3 but when I run script\server I get the following error. (I''m guessing its to do with my environment file but I''m pretty new to Rails so Im not sure.)
2008 Mar 03
0
Overriding ActionController method in an app
i can''t seem to get this working... basically, i want to use a patch that was added to rails: http://dev.rubyonrails.org/changeset/8785 but i don''t want to have to upgrade past 2.0.2, and i don''t want to have to freeze rails inside the app. so i was hoping to override the methods in ActionController required to make the patch to my app only. i created a file called
2008 Jan 12
0
Can't test application controller methods in functional tests?
I have two methods in application controller that I want to test from ForumController: ----------------------- class ApplicationController < ActionController::Base ... def logout session[:username] = nil session[:admin] = nil redirect_to(request.request_uri) end ... def home redirect_to(:controller => ''forum'', :action =>
2006 Oct 12
2
Test should fail !
Hello, a very strange thing is happening : the test below pass but it should fail I had a syntax error which produced an exception in the browser and http 500 in the script/console (using app.get ''/'') But with rake test:functionals it passes - How is it possible ? Of course this file is really executed by the test suite, I can see it in the screen output of rake Which