Displaying 20 results from an estimated 100000 matches similar to: "Where is ActionController::TestRequest documentation ?"
2008 Dec 14
0
ActionController::TestRequest bug?
Hi, while starting to setup functional tests for my application I
received the following error:
NoMethodError: undefined method `server_name'' for
#<ActionController::TestRequest
which is coming from an instance variable I''m setting up in my
application controller.
@domain = Domain.find_or_create_by_name(request.server_name)
I''m using rails 2.0.2, any guidance
2006 Mar 26
4
A unit test that should pass
Hi, I wonder why this unit test fails.
The model :
class Article < ActiveRecord::Base
set_table_name "publish_articles"
belongs_to :category
validates_presence_of :title, :excerpt
#snip
end
The test :
def test_validate
@article.title = nil
@article.excerpt = nil
assert !@article.save
assert_equal 2, !@article.errors.count
end
!@article.errors.count returns
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
2007 Mar 02
5
ActionController::RoutingError
plz give me the solution to solve the below error
ActionController::RoutingError
ActionController::RoutingError in Issues#new
Showing app/views/issues/_issue.rhtml where line #1 raised:
issue_url failed to generate from {:controller=>"issues",
:action=>"show", :id=>nil}, expected: {:controller=>"issues",
:action=>"show"}, diff:
2006 Aug 06
1
Where is ActionController::InPlaceEditing?
I can''t find this doc anywhere, but the JavaScriptMacrosHelper doc
mentions it.
Jose
--
Posted via http://www.ruby-forum.com/.
2006 Jul 04
0
ActionController::UnknownAction hangs application
I''m trying to override rescue_action_in_public() using the PP example,
but my application hangs every time I generate an error.
def rescue_action_in_public(exception)
case exception.class
when ActiveRecord::RecordNotFound,
ActionController::UnknownAction
render( :file => "#{RAILS_ROOT}/public/404.html",
:status => "404 Not
2010 Jan 20
0
(2.3.5) ActionController::Base.session_options[:expire_after] + Error 422/Authenticity Token Issue
I''m getting ready to put an app into production and I''ve found a
strange issue that, as far as I know, shouldn''t be happening. To me
this looks like it could be a bug, but I''m not sure and I''m hoping
some one here can tell me if they''ve seen this before, or can idiot-
check me in that hopefully it''s just something I''ve missed
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 Mar 24
2
before_destroy not called
Hello, I''m trying to intercept delete call in my model but
before_destroy callback is never called...
Somebody knows why ?
Thanks
The controller :
def delete
Image.delete(params[:id])
redirect_to :action => "list"
end
The model :
class Image < ActiveRecord::Base
set_table_name "publish_images"
belongs_to :article
before_destroy :on_destroy
2007 Aug 17
1
Testing webservices in Integration Tests with Jamis Buck's recipe?
Hello,
I''m using Jamis Buck''s recipe to do integration tests on an
application, but I got a nil.recycle! error while doing a webservice
call.
This is the situation.
def test_uploading_data
invoke :upload, data
invoke :upload, even_more_data
real_user_session = new_session_as @real_user
real_user_session.press_magic_button_to_enable_more_uploads
invoke :upload,
2005 Aug 29
2
Where to point the browser to for appdoc documentation
Under windows XP I created a batch file in the depot directory this takes care
of generating the application documentation. The default rake appdoc isn''t
working under windows right now (remove the -T option).
So, where do I point my browser to (so that I can view the new generated
application documentation)? Running gem_server didn''t help so far...
listing doc.bat
rdoc -o
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 Apr 01
1
set_table_name and fixtures
Hello, I''ve encountered a fixtures really frustrating bug : model, YAML
file and db table names must be the same because of the fixture library
ignoring the set_table_name provided in the model.
Is there anything to do ?
Thanks
--
Posted via http://www.ruby-forum.com/.
2007 Jan 03
0
`ActionController::Base#render :nothing => true` still whines about "missing template"
In FooController, I put method #bar whose only purpose is to run some
logic in the background and return a status 204 [1].
So in order to return only the 204 status code, I put at the end of
#bar:
`render :nothing => true, :status => 204`
But then when surfing to /foo/bar, I get an error about "missing
template bar.rhtml". Is this a bug?
(The solution eventually was `render
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 Jun 07
1
What is class TestController < ActionController::Base
What are the different parts of; class TestController <
ActionController::Base?
I look at the http://api.rubyonrails.org/ and try to understand but I
don''t. Could someone give me a hint?
I get the part of Test being the "folder", def and all that, but I can''t
find an explanation of the basic stuff.
--
Posted via http://www.ruby-forum.com/.
2007 Apr 16
4
Web Flow and the session method in ActionController
Hi there,
I''m writing a port of Spring Webflow to Ruby on rails and I''ve
encountered quite a lot of difficulty finding how to override the
session[] method which is accessed via any ActionController.
I have my pseudo-code ready to implement, but I can''t find the method
declaration to copy it''s signature.
Also, if anyone wants to collaborate on this particular
2006 Jun 07
5
File is nil
I don''t understand why my program does not get the file that I try to
upload.
It returns the following error when I try to upload a small file:
NoMethodError in LogfileController#create
You have a nil object when you didn''t expect it!
The error occured while evaluating nil.original_filename
#{RAILS_ROOT}/app/models/logfile.rb:9:in `file=''
2010 Oct 05
0
Ruby with apache ActionController::RoutingError (No route matches "/"):
Hi!
I an trying to setup ruby on rails with apache server on ubuntu server
10.04. I have followed toe guid on the ubuntu page.
My main app is located in:
/home/jonas/ruby/apps/rtest1/public
and I created a symlink to /var/www/app using the following command:
sudo ln -s /home/jonas/ruby/apps/rtest1/public /var/www/app
I have also reconfigured the owner of the /home/jonas/ruby/apps/rtest1/
2011 Jan 24
0
ActionController is not missing constant Assertions!
I have an error : "ActionController is not missing constant
Assertions!" when launch rspec on controller.
Solution: remove from - /usr/lib/ruby/1.8 action_controller file.
--
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