Displaying 20 results from an estimated 700 matches similar to: "Testing How To Question"
2006 May 04
6
second assert_tag failling in rails integration test
Hi all,
I''m fairly new to rails and ruby, but I''ve come across an interesting
glitch and I''m not sure whether I''ve just got something wrong with my
assumptions or if it really is an error in the underlying framework...
I''ve created a bare-bones set of tests to show you where the problem is.
What follows are the steps I went through to reproduce the
2006 Oct 21
6
test_create gets 200 instead of :success
Help!
I have a new/create process that works fine in the actual app. But when
I test I always get a failure in the test_create section. Here''s some
controller code:
def new
end
def create
begin
@borrower = Borrower.new(params[:borrower])
if @borrower.save
flash[:notice] = ''Borrower '' + @borrower.FirstName + '' '' +
2006 Jul 17
5
Functional Tests misbehaving with Globalize
Howdy all
Apologies to the folks subscribed to the globalize list for dual
posting this message...
I''ve got a project running globalize and rails 1.1.4, and I''ve only
recently adopted a strong love for testing. Now my models are 100%
tested (I must note that I do not make use of any translations in the
database yet), and I''ve now started with functional tests before
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 +-
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
2005 Dec 18
1
assert_template fails?
Hi All,
I have a seemingly simple problem - but can''t figure out the problem. I
have a simple functional test like so:
def test_should_show_search_dropdown
get :index
assert_response :success
assert_template :search
end
Inspite of having search.rhtml in /app/views/layout, it fails with an error:
1) Error:
test_should_show_search_dropdown(SearchControllerTest):
2006 Jul 13
10
Problem with flashes staying on between pages
I have a login page that redirects to itself if the login is
incorrect. The browser does:
get login
post login, with wrong username and password
redirect back to login
When the post action redirects back to login it sets a flash telling
the user it failed. So far so good. The problem is that if I get
another page after that, the flash is still there. It only disapears
on the second.
2012 Mar 22
1
Rspec not loading fixtures
I am taking over a code base and am trying to run the tests. I am
somewhat new to RSpec so this might be a trivial problem.
Basically I can tell that the fixtures are not getting loaded. All 100
tests fail with a similar error.
But I don''t know why. Below is the code, with my narrative with ***
before it... Can you see anything or give me a clue where to look. So
far I am coming up
2005 Nov 23
2
functional tests, assert_tag and tables
I''ve run into another functional testing issue. Odds are I''m taking the
wrong approach, so I''m back to this list again in the hopes of finding
the true path.
with assert_tag, I''d like to check the values of various table cells and
ensure that the proper values are placed in the appropriate places. I
written some tests that make good sense to me, and in
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 Jul 07
2
Testing views with Hpricot
assert_tag smells bad. Hpricot smells nice (apricotty!).
Testing your views with Hpricot:
http://www.lukeredpath.co.uk/index.php/2006/07/07/testing-your-rails-
views-with-hpricot/
Big thanks to _why for a great little library!
Feedback is appreciated. rSpec integration coming soon (hopefully!).
Cheers,
Luke Redpath
contact@lukeredpath.co.uk
-------------- next part --------------
An HTML
2006 May 06
1
depot test-driven development exercise
(I posted this yesterday but within 20 minutes my thread was hijacked
so I''m not sure anyone really saw this.)
I''ve been working my way through the Agile book and just completed
the depot sample application. I learned quite a bit along the way.
On page 171 we are led through the creation of a test (that fails)
for new code. The new code (a search function) is left as an
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 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
2006 Feb 01
3
Test data life cycle confusion
Hi,
It states on page 140 of Agile Web Development with Rails:
Here?s the bottom line: even if a test method updates the test database,
the database is put back to its default state before the next test method is
run. This is important because we don?t want tests to become dependent
on the results of previous tests.
Well, I''ve been running into a brick wall with some functional tests
2006 Feb 18
1
Should assert_tag be used to test rxml views?
I''m getting strange errors attempting to test an rxml view with
assert_tag. I can see that what the view is producing is correct but I
get an error like "ignoring attempt to close foo with bar" (where bar is
a tag which is meant to be nested in foo). Is asssert_tag meant for xml,
or just html?
Cheers, Robert.
--
Posted via http://www.ruby-forum.com/.
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 Aug 02
1
REST and functional tests
Just playing around with converting an apps to the new REST goodness in
edge rails, and I''m trying to work out how to convert/write the
functional tests.
Is the recommended way to explicitly use the actions (e.g. get :show,
:id => ...; post :create,..., etc) and test the routes separately, or
duplicate the request, in which case how is that done get "/", :id => 5
2006 Feb 06
9
tests fine, but fail under rake
Hi there,
So I have an odd error at the moment that only occurs when I run tests
via rake. It''s happening with two tests now. Under a simple ruby run,
the tests are fine, e.g.:
D:\User\Code\ruby\prometheus>ruby
test\functional\story_comments_controller_test
.rb
Loaded suite test/functional/story_comments_controller_test
Started
.........
Finished in 2.37 seconds.
9 tests, 65
2012 Nov 26
8
why functional test does not get failure?
The test:
test "should get new" do
get :new, :room_id => @room.name
assert_template(:ne)
end
the template new does not exists but the test does not get failure.
Why?
--
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