Displaying 20 results from an estimated 200000 matches similar to: "Status code 0 on functional test"
2009 May 18
0
[PATCH server] fixed functional tests after recent controller refactoring and managed node controller fixes.
Signed-off-by: Scott Seago <sseago at redhat.com>
---
src/test/functional/host_controller_test.rb | 41 --------------------
.../functional/managed_node_configuration_test.rb | 14 ++++---
src/test/functional/nic_controller_test.rb | 8 ----
src/test/functional/permission_controller_test.rb | 15 ++++---
src/test/functional/quota_controller_test.rb | 2 +-
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 Sep 26
0
some help with functional testing of nested routes
I have the following functional test in test/functional for testing my
products_controller:
require File.dirname(__FILE__) + ''/../test_helper''
require ''products_controller''
# Re-raise errors caught by the controller.
class ProductsController
def rescue_action(e)
raise e
end
end
class ProductsControllerTest < Test::Unit::TestCase
fixtures
2007 Jan 11
0
Functional tests with actions that send files
I have a number of actions that use the spreadsheet/excel library to
generate an Excel spreadsheet based on model data and send it to the
user using the send_file method.
For a while, I''ve been testing these methods with assert_response
:success, and then checking the response headers to make sure the file
at least looks like what I should be getting. But it occurred to me
recently that
2006 Jun 29
0
@response.body accumulating in functional tests?
I have two functional tests for my user controller:
def test_bad_registration
post :register, :email => "tester1@foo.com"
assert_response :success
assert_not_nil @response.body =~ /^\<error/
assert_nil assigns[''user'']
end
def test_good_registration
@response.body = nil
post :register, :username => "tester",
2006 Jul 05
2
How to write get functional test when there is no action by that name
I have following line in route.rb
#event info for an event name
map.connect ''event/:name_url'',:controller => ''home'',:action =>
''event_info''
It causes a URL like http://localhost:3000/event/_jewels_exhibition_ to be
sent to the home controller with action as ''event_info''.
I am trying to test this action. My first
2006 Jun 14
0
Functional test problem
Embarrassingly late (apps already well advanced), have decided top get
to grips with testing and am having a week hopefully covering everything
I''ve already coded (so far it''s been worth it -- found a couple of bugs
might not have found otherwise).
But having a bit of a prob with a functional test. I''m trying to
enumerate through through a list of users in a
2006 Aug 04
2
Functional Testing Anomoly
I have a test method (below).
def test_save_failed
post( :edit, :record => StatusChanger.invalid_data_hash)
assert_response :success
assert_template ''edit''
assert assigns(:record)
assert_equal false, assigns(:record).valid?
end
This particular method is part of a larger set of functional tests. If
I run,
$ ruby controller_test.rb -n
2009 Oct 14
6
Reinstantiate controller during functional testing
... ok, I may be going about this the wrong way, or perhaps, a less
efficient way than is optimal, but I would like to test a little bit
of AJAX on one of my web pages. When I test this by hand, I bring up
the page which shows a select box, I select an item from the drop down
list, see another select box show up, go back to the first select box,
select a different item, and see something
2008 Jul 24
0
Re: Simple functional test fails
Quoting txapelgorri <ibon.castilla-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
>
> Hi there:
>
> I''m starting with rails and I founded and issue that I can''t figure
> out how to solve:
>
> - This is the controller:
> class StoriesController < ApplicationController
> def index
> @current_time = Time.now
> @story =
2008 Apr 01
2
Functional Testing - page actions
Pretty simple question, I''ve tried to ajaxify some actions and the first
one I did was a delete -
def delete_job
.....
render :update do |page|
page.remove "job_#{id}"
end
....
end
and in my functional test I call this function via post
def test....
post :delete_job, :id => 1
assert_response :success
......
end
after the assert_response, how do I test that the page
2010 Aug 09
0
Exceptions in functional tests (rescue_action_in_public! broken?)
In 2.3, exceptions raised by controllers under functional tests were by
default propagated to the test, but by using rescue_action_in_public! a test
could trigger the production, public behavior and then use assert_response
or similar to test the expected result. This was implemented via
coordination between ActionController::Rescue and
ActionController::TestCase::RaiseActionExceptions.
This
2006 Nov 04
0
Functional test issue for testing newbie
Hi there
I''m having difficulty succesfully updating attributes via a post
request in a functional test.
Here''s some pastes:
######################################
# account_controller.rb
def edit_details
@user = User.find(self.current_user.id)
return unless request.post?
if @user.update_attributes(params[:user])
flash[:notice_good] = ''Your account details
2006 Feb 27
1
Functional test problem with environments variables
Hi guys,
i have been experiencing this problem once i put in some constant
declarations in /config/environments/development.rb. I declared it very
normally like this :
USER_DETAILS = {
:name => ''abc'',
:password => ''123''}
it works in the controller and when i run the application, i managed to
get the values out from the development.rb by using some
2006 Jun 15
5
[Fwd: Functional test problem]
Anyone?
-------- Original Message --------
Subject: Functional test problem
Date: Wed, 14 Jun 2006 19:49:03 +0100
From: Chris T <ctmailinglists@gmail.com>
Reply-To: ctmailinglists@gmail.com
To: rails@lists.rubyonrails.org
Embarrassingly late (apps already well advanced), have decided top get
to grips with testing and am having a week hopefully covering everything
I''ve
2006 May 05
3
posting xml in functional test
Hello,
I''m trying to write a functional test for a simple CRUD controller which
accepts / emits xml in a REST- like fashion. However the following code
won''t work for me - an exception is generated
def test_create
post :create, ''<person><name>john</name></person>'',
2006 Mar 30
2
Functional test confusion
I have been reading about testing in RoR for what seems like hours now
in search of the answer to what is probably a simple problem. Where is
the best place to test the second action explained below?
I have a controller (NetworkingController) with a method
(create_network_segment) that makes use of two models (NetworkSegment
and NetworkIpaddress). This particular method does two actions:
1.
2007 Jun 07
0
Functional Tests Fail - No URL can be generated for hash
Hi,
I''m just learning Ruby and Rails. I have developed a Rails application,
but not using the creation scripts that come with the rails
distribution. Consequently, no test scaffolding is available to me, and
I''m trying to write my functional tests from scratch.
I have what might be considered a standard plain old controller
(dashboard_controller.rb) that I''m trying
2007 Jun 25
1
Functional tests and active scaffold: unexpected assertion failure.
Hello,
I''m writing a functional test for a controller that uses active
scaffold.
def test_presence_of_field
login_as(:peter)
profile = Profile.find :first
get :edit, {:id => profile.id}
assert_response 200
assert_select "textarea#record_free_text_ec"
end
I was expecting the first ''assert 200'' to give me a green bar,
but added it for
2014 Mar 31
0
Rails Engine ActionController::UrlGenerationError on functional tests
Hi,
I'm looking for a way to solve an error I get each times I run my
functional tests. I have a Rails Engine gem (isolated), I have a JSON
action with a route declared. But each times I use the method get in a test
I get an ActionController::UrlGenerationError exception.
Here an example of code with the problem:
# config/routes.rbMyEngine::Engine.routes.draw do
resources :cats, only: