Displaying 20 results from an estimated 100000 matches similar to: "Functional Tests and Login Engine"
2006 Jul 03
2
Login Engine & Functional Tests
Hello,
I''m creating some functional tests form my controler, and most actions
require
login. I''m using login engine to manage the login functionalities.
I would like to know how can I login a user in a functional test. This
is, the first thing that I would like to do is to login a user. This way
the response will return :success instead of :redirect.
Thanks in advance.
--
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 +-
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:
2006 Feb 27
0
Functional Tests when using the User Engine
Hi all,
I''m trying to write a functional test for a controller. In my app I''m using
the users engine, so of course the test needs to login. However, I can''t use
follow_redirect since that gives an error. What is the proper way to do the
login in the test?
Thanks in advance,
Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Jun 29
1
Problems getting past authentication using functional tests
Hi,
I''m having a problem getting past the authentication mechanism in rails
using my controller functional tests.
my functional tests look like this
def test_4
$stdout.puts ''TEST 4: cookies is '' + cookies.to_s
# :user => {:id => users(:testuser).id}
cookies[:user_id] = ''2222''
$stdout.puts ''1. cookies is ''
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
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
2006 May 10
0
Ezra''s acl_system2 and flash not getting populated in functional tests
Hi all,
I am using the LoginGenerator and Ezra''s acl_system2 to protect
certain actions in my controllers. I have written some functional
tests to check for correct handling of redirects, flashes, etc. The
flashes however only get populated on the first get action in any
given test. Here is what I have so far:
In the controller:
class PageController < AC
before_filter
2006 Jul 04
1
Select Box problem in the controler with Ajax
Hi,
I have a selectbox that updates a given span area when a user selects a
value. The selectbox has the option :include_blank => true. The
controler will fetch the ID of the selected option in the combo box and
sends the description of the item with the same ID.
The problem is that the user is able to select the empty option, and the
controler will not be able to fecth the ID. This
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
2007 Apr 21
0
Issues with Functional Tests
I''m running rails-1.2.3 under Ubuntu 6.06, and I''ve come across a few issues
I''d like to raise.
(1) If a controller sets flash.now[:notice] = "message", then in a
functional test I don''t seem to be able to match it.
flash.inspect shows "{}" and flash.now.inspect shows
"#<ActionController::Flash::FlashNow:0xb63c4ecc
2007 Apr 10
1
backgroundrb and functional testing
Hi,
I have a backgroundrb task initiated through the front-end.
I also have an action in my controller I poll every second or so to see
whether the task has completed, so that I can redirect to a confirm page
on completion.
How do I functional and unit test this scenario?
Joerg
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this
2009 Jul 01
1
[PATCH server] fixed expected status messages that were failing unit/functional tests.
---
.../functional/cloud/instance_controller_test.rb | 2 +-
src/test/unit/vm_service_test.rb | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/test/functional/cloud/instance_controller_test.rb b/src/test/functional/cloud/instance_controller_test.rb
index 71d132b..0d713d4 100644
--- a/src/test/functional/cloud/instance_controller_test.rb
+++
2005 Jul 05
2
Salted hash login generator (verification problem?)
Hi all,
I hope someone can help with what is probably a simple newb
installation mistake on my part. I''m having a couple of problems with
the salted hash login generator. I installed it following the
quickstart guide, and the unit tests work like a charm. There are two
errors and a failure on the function tests, though; the verified field
seems to be involved in at least one of
2006 Jul 06
1
Laszlo DHTML on Rails?
Hi,
I''m trying to get a big picture about what can be done with the mix of
these two technologies.
My idea would be to use the power of Rails to provide the model and
controller functionalities, and use Open Laszlo for the view design.
This would provide a better abstraction level for the development of the
GUI.
Can someone provide me an idea if this is possible what are the
2006 Jan 30
5
Functional tests and dealing with login before_filter
Hi all,
I''m curious as to how you do functional testing on the controllers if, within
the ApplicationController, I have a before_filter :authorize, :except =>
:login, where the private authorize method checks for session[:user].
I can''t do "post :login", because that method is in a different controller.
I tried setting session[:user] directly in the setup
2013 Sep 23
1
redirect on browser success, but redirect on functional test is error
line_items.yml:
one:
product_id: 1
cart_id: 1
quantity: 1
carts.yml:
one: {}
product.rb:
has_many :line_items
cart.rb:
has_many :line_items, dependent: :destroy
line_item.rb:
belongs_to :product
belongs_to :cart
line_item_controller.rb:
def destroy
@line_item = LineItem.find(params[:id])
@cart = @line_item.cart
@line_item.destroy
respond_to do |format|
format.html
2005 Jul 15
1
How do you do functional tests?
Hi,
I''m just wondering: how do people do their functional tests?
I see two possible versions:
1. You test every controller, and every action, in isolation and with
varying criteria. For example, you might have a
''test_login_with_valid_details'' and a ''test_login_with_invalid_details'';
both test the same action but under different circumstances.
2.
2009 Jan 19
1
in functional test, assert_redirected_to w prefix
I had to use sub-URI deployment (could not use subdomains..), and when
running my functional tests, I the redirected_to assertion embed the
prefix.. quite normal ;-))
is there a way to stipulate this prefix in the test setup to avoid
hard-coding in all the tests ?
Expected response to be a redirect to <http://test.host/my/page>
but was a redirect to
2006 May 27
0
Problem with Rcov and Functional Tests
I''m having a problem with Rcov 0.40 and Rails 1.1.2. When I run all my
tests (unit, functional and integration) with rcov weird things happen
with some but not all of my functional tests. The tests will blow up
with an ''ActionController::UnknownAction - no action responsed to
my_action'' error. After investigating and adding some print statements,
it turns out