search for: test_upd

Displaying 15 results from an estimated 15 matches for "test_upd".

Did you mean: test_ud
2005 Sep 18
5
NameError: uninitialized constant Addres
...dress, :per_page => 10 end I''m guessing pluralization bug? Or did I create the scaffolding wrong? Also (probably unrelated), I''ve generated scaffolding for Orders and Strategies. I''m getting the following exceptions when running the functional tests: 3) Error: test_update(OrdersControllerTest): ActiveRecord::StatementInvalid: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''WHERE id = 1'' at line 1: UPDATE orders SET WHERE id = 1 4) Error: test_update(Strat...
2006 Feb 22
3
Unit test failure - nil object?
I''m following instructions in the Agile book, page 146 for testing an object update to the database. Here''s my code: def test_update assert_equal "jack@smiths.com", @user.email @user.email = "jack@smiths.org" assert @user.save, @user.errors.full_messages.join("; ") @user.reload assert_equal @user.email, "lindsay.boyd@ntlworld.co.uk" end An error is generated when...
2008 Feb 12
4
Funny behavior with Fixtures... on Ubuntu..
...and I even have the following two method calls at the top of my test class to make doubly sure... class TaskTest < Test::Unit::TestCase self.use_transactional_fixtures = true self.use_instantiated_fixtures = false When I run my tests individually... as in: ruby unit/task_test.rb --name test_update The tests run successfully to completion. However, when I try to run the entire test file in one go, I get failures. As in: ruby unit/task_test.rb > 8) Error: > test_update(TaskTest): > ActiveRecord::RecordNotFound: Couldn''t find Task with ID=2 I query the data...
2006 Jan 20
10
1st attempt at rails testing - could really use some help...
Howdy, I''m attempting my first rails test & I could use some help... I have the test posted at http://rafb.net/paste/results/YjWkIh45.html... when I run it, the test fails, but the db table is never restored & it seems that the fixtures file was never loaded... Any ideas as to what I''m doing wrong? Thanks! -- Posted via http://www.ruby-forum.com/.
2006 Feb 21
0
DB not being repopulated prior to Unit test execution
...just started the testing chapter. The first two unit tests run as expected. When I add the test for the ''destroy'' function to product_test.rb, however, I''m getting a failure I don''t understand. The error I''m getting says that in the setup method for test_update, it "couldn''t find Product with ID=1". When I run product_test.rb without the test_destroy test case, the other two methods (test_create & test_update) find that record fine. When I add the test_destroy case in, though, it appears that the database isn''t being...
2007 Jan 10
3
ActiveRecord Error?
...belongs_to :gadget def save gadget.save super end end ------------------------------------------- and the following test.... ------------------------------------------- class WidgetTest < Test::Unit::TestCase fixtures :widgets, :gadgets # Replace this with your real tests. def test_update w = Widget.find(1) assert_equal(w,w.gadget.widget) w.save end end ------------------------------------------- Obviously this is a contrived example (why would anyone every want to call w.gadget.widget?). However, it''s a greatly boiled down version of our problem app that...
2005 Dec 22
1
How to write unit tests with respect to model callbacks?
...est_helper' class ClientTest < Test::Unit::TestCase fixtures :clients def setup @client = Client.find(1) end def test_create assert_kind_of Client, @client assert_equal 1, @client.id assert_equal clients(:elasto_client).name, @client.name end def test_update assert_equal clients(:elasto_client).description, @client.description @client.description = "TEST UPDATE DESCRIPTION" assert @client.save, @client.errors.full_messages.join("; ") @client.reload assert_equal "TEST UPDATE DESCRIPTION", @c...
2006 Jun 02
0
Problem updating child row from parent model
...;, "Update" and "Destroy" for my model"Order". My problem is that on the "Update" I try to update a quantity which is a field of my table "line_items" which is a child of my table "orders". For that test I used the following code: def test_update assert_equal 2, @order.line_items.first.quantity @order.line_items.first.quantity = 4 assert @order.save, @order.errors.full_messages.join("; ") @order.reload assert_equal 4, @order.line_items.first.quantity end And I get the following result: 1> Failure:...
2006 Jul 06
0
problema con i test automatizzati
...ollo di versione", @product.descrizione         assert_equal 29.95, @product.prezzo         assert_equal "http://www.alfonsomartone.itb.it/yescna.jpg", @product.image_url         assert_equal "2005-01-26 00:00:00", @product.date_available_before_type_cast   end     def test_update         assert_equal 29.95, @product.prezzo         @product.prezzo = 99.99         assert @product.save, @product.errors.full_messages.join("; ")         @product.reload         assert_equal 99.99, @product.prezzo     end     def test_destroy         @product.destroy     end...
2006 Apr 21
2
destory Test Case Messes up all tests
...be reloaded between tests right? Here is my testcase : require File.dirname(__FILE__) + ''/../test_helper'' class UserTest < Test::Unit::TestCase fixtures :users def setup # get grant_speelman user @first_user = User.find(1) end # Test updating of a user def test_update assert_equal @grant_speelman.firstname, @first_user.firstname assert_equal @grant_speelman.surname, @first_user.surname assert_equal @grant_speelman.email, @first_user.email @first_user.firstname = "Gavin" @first_user.surname = "Steenkamp" @first_user...
2006 May 05
7
Testing model: test becomes dependent on previous test
Im having trouble with Testing models. im following the tutorials in the book Agile Web Development with Rails. if i execute the code product_test.rb, i get this error: ============================================================ 1) Failure: test_update2(ProductTest) [test/unit/product_test.rb:30]: <29.95> expected but was <99.95>. 3 tests, 11 assertions, 1 failures, 0 errors ============================================================ and heres the product_test.rb code: ===========================================================...
2005 Dec 15
4
Order of tests matters???
I have a problem with tests. I always thought that the order of tests doesn''t matter because the fixtures are reloaded before every test method. However, I''ve just discovered that this isn''t true. This is a quote from the "Guide to testing the rails" howto: "... if we had another test method, we wouldn’t have 10 users on the 2nd test because they would
2009 May 18
0
[PATCH server] fixed functional tests after recent controller refactoring and managed node controller fixes.
...; - - assert_equal num_hosts, Host.count - end - - def test_edit - get :edit, :id => @host_id - - assert_response :redirect - assert_redirected_to :action => 'show', :id => @host_id - - assert_not_nil assigns(:host) - assert assigns(:host).valid? - end - - def test_update - post :update, :id => @host_id - assert_response :redirect - assert_redirected_to :action => 'show', :id => @host_id - end - - def test_destroy - #FIXME: this controller method does nothing, do we even need it or a test? - post :destroy, :id => @host_id -...
2006 Apr 05
5
duplicate search results
i''m using Ferret 0.9.0 with acts_as_ferret (the one from svn.jkraemer.net), and i''m getting duplicate results, as described in this thread: http://rubyforge.org/pipermail/ferret-talk/2005-December/000048.html is there a way to configure the indexes created by acts_as_ferret to use :key => :id, as described in that thread? i''ve poked around in the code, and had
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