Displaying 20 results from an estimated 700 matches similar to: "Functional Testing - page actions"
2007 Jun 15
2
Is it still possible to use should_have_rjs
Hi
I''ve come back to a Rails project after about a month doing other
work, and there''s a lot of changes. I was on the 0.7 branch before
and I''ve upgraded to RSpec 1.0.5. I used the spec translator, fixed
the cases where it barfed on unusual line contents, and all my model
and controller specs now pass. But I''m getting 53 failures on my view
specs,
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
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
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 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
2012 May 13
1
is assert_select_rjs deprecated in Rails 3.1 ?
I have seen it in 3.0.9 doc (
http://apidock.com/rails/v3.0.9/ActionDispatch/Assertions/SelectorAssertions/assert_select_rjs
)
but it''s not mentioned in the latest guide (
http://guides.rubyonrails.org/testing.html#integration-testing-examples)
if deprecated how can I check the view from an Ajax call
( assert_match + gsub could work ? ... )
am I missing any doc ?
xhr :get, :change_area,
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 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 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
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
2006 Jul 06
6
Functional tsts
Hi all,
I have created projects module in my application using scaffold,
and it created me everything, and all the modules are working except the
functional test. This is the error
1) Failure:
test_create(ProjectsControllerTest)
[test/functional/projects_controller_test.rb
:55]:
Expected response to be a <:redirect>, but was <200>
8 tests, 25 assertions, 1 failures, 0
2006 Apr 04
1
integration tests - 1.1
I?m using the new 1.1 integration test facility? I?m trying to write a
test that sees if a controller redirects to the correct place and
preserves the query string.
Here?s the code:
class LoginRedirectTest < ActionController::IntegrationTest
def test_non_admin_auth
request_uri = "/datafeed/event/report?blah=blah"
get(request_uri)
follow_redirect!
2007 Jan 26
0
Problems with assert_select in integration tests
I''ve been battling with assert_select in my integration tests for
several evenings now. I''m testing a multi-step form, and after
submitting the first step, my assert_selects fail on the attempts to
find the form on the next page. However if I print out the response
object, it has the exact text of what I''m trying to match.
Here is the complete integration test. The
2009 Apr 21
2
validates_uniqueness_of
hello all,
i am new to RoR programming and am struck with the functional test whole
checking for uniqeness of carriers. If it is not unique,the the bin
shudn''t be created.Can someone help me in correcting my code.
def test_create_failure_cycle_unique
begin
num_bins = Bin.count
post :create, {:bin => { :carrier => carriers(:A), :cycle =>
cycles(:one), :name =>
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
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 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 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