search for: test_created

Displaying 20 results from an estimated 43 matches for "test_created".

Did you mean: test_create
2006 Aug 11
5
Unit tests - NilClass problem
Hi! Yesterday I started to write my unit tests for the fist time using rails. I''m using this method: http://blog.codahale.com/2005/12/23/a-rails-howto-simplify-your-unit-tests/ My customer_test.rb looks like this: require File.dirname(__FILE__) + ''/../test_helper'' class CustomerTest < Test::Unit::TestCase fixtures :customers # Replace this with your real
2006 Mar 19
2
Unit test confusion
Hey all, I''m following along with AWDWR, specifically the unit testing. On page 148, it shows you how Test::Unit::TestCase will automatically define instance variables based on your fixtures. It doesn''t seem to actually work, though. It seems that both @artists ["beatles"]["name"] and @beatles.name are nil objects in my test, where as
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 Apr 16
5
Newbie Problems with pluralization
Hi, I have a many to many relationship incorporating the following tables: taxes --> taxes_tax_groups --> tax_groups I have a model named tax with the following declaration: has_and_belongs_to_many :tax_groups and I have a model named tax_group with the following declaration: has_and_belongs_to_many :taxes I am attempting to run the following unit test: require
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 Jun 08
1
fixtures instance variable naming
hi all, trying my first foray into testing and having trouble with accessing the fixture instance variable built a test for my NewsRelease model. have a news_releases.yml as a fixture with: first: id: 1 title: my first release body: this is still my first test of a news release publish: 0 date_publication: 2006-06-06 17:28:00 in news_release_test.rb, i have def setup
2006 Jul 24
1
All functional tests fail with RoutingError
All, I''m using InstantRails 1.0 on Windows XP and all my functional (controller) tests fail with ActionController::RoutingError, although the actions work OK through a web server/browser. Here''s an example of an error: 1) Error: test_create(AdminControllerTest): ActionController::RoutingError: No url can be generated for the hash {:controlle r=>"admin",
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 Mar 20
2
Testing Models And Fixtures
I have finally decided to look into testing and I am going through the examples in the AWDWR book and I tried the following and it does not work... even though I don''t see why it shouldn''t. =========== posts.yml =========== basic_post: id: 1 title: Title body: Body created_at: 2006-02-01 00:00:00 updated_at: 2006_02-02 00:00:00
2005 Oct 28
2
Accessing fixture
I have a very simple problem. I can''t seem to access a the fixture by name I have a sites.yml with: simple_site: id: 1 name: demo description: A demo site created_on: 2005-10-25 00:00:00 updated_on: 2005-10-25 00:00:00 And I have a test class as: require File.dirname(__FILE__) + ''/../test_helper'' class SiteTest < Test::Unit::TestCase fixtures
2005 Feb 09
1
[DEFECT] ''validates_inclusion_of'' not working as expected (couldn''t post to Trac as it gave me an error)
Hello, I tried to post this as a bug on the trac site, but whenever I hit submit, I got the error message: --- Precondition Failed The precondition on the request for the URL /newticket evaluated to false. --- Anyway... Let''s say I have the following model classes: --- class Project < ActiveRecord::Base has_many :tasks end class Task < ActiveRecord::Base belongs_to
2006 Feb 15
2
First unit test fails
I''ve just started working through ''Agile'' chapter 12 ''Testing''. I''ve followed the steps carefully, setting up a fixture and unit test to check the creation of an order. When I run the test I get the following: Loaded suite test/unit/order_test Started F Finished in 0.108008 seconds. 1) Failure: test_create(OrderTest)
2005 Feb 19
0
[Error] Using validates_presence_of for datetime field causes parse error?
Hi Everyone - I''ve got an odd sort of error when I try to use validates_presence_of for a MySQL ''datetime'' field. Here''s the relevant portion of the table definition: mysql> describe student_surveys; +---------------------+---------------------+------+----- +---------------------+----------------+ | Field | Type | Null |
2006 May 16
3
Testing How To Question
I''m using the functional test for a method like this: def test_create post :create, :phase => ''copynew'', :id => 1 assert_response :success assert_template ''create'' assert_tag :content => ''New Item'' assert_not_nil @item end This posts a request to the create method in the controller. Is there any way to look
2006 Jun 08
2
accessing fixtures in tests
hi all, my first attempt at tests and i''m having trouble accessing the fixture values, if anyone can make it suggestions. i have news_release_test.rb, using new_releases.yml as the fixture file according to the agile book, i should be able to access the fixture properties within my test as such: assert_equal @first_test.id , @news_release.id unfortunately, i try that and get:
2006 Apr 13
1
Setting up Testing model, getting an error
I setup a testing model in my Depot web app from the Agile Web Development with Rails book and came up with the following errors: Loaded suite test/unit/product_test Started EE Finished in 0.050279 seconds. 1) Error: test_create(ProductTest): Errno::ENOENT: No such file or directory - /Users/Mike/Sites/depot/config/../test/fixtures/categories
2007 Mar 22
1
Functional test and flash with an error
I''m getting this error thats moaning about expected tag, but no tag found matching {:content=>"User James Apps was successfully created.", :attributes=>{:id=>"notice"}, :tag=>"div"} in the file application.rb. I tried using a regular expression - /#{user.first_name}/ , but that wouldn''t work either user_controller_test.rb 1) Failure:
2006 Jan 03
3
Rails Noob Question
Apparently the first time I posted this, it was tacked onto the end of another thread. Please pardon my repost. Won''t happen again. -------- Howdy. I''m just getting into Rails, and really enjoying it! I''m coming from the .NET world, so I''ll embarrassedly admit that I''m running it on winXP and even using SQLServer (for now, may switch to mysql
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.
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 +-