Displaying 5 results from an estimated 5 matches for "customer_test".
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 tests.
def test_create
test_creation_of :model => Customer,
:record => @custom...
2006 Jul 02
2
NoMethodError in Unit Test - Rails Newcomer
...the NoMethodError, and can''t understand why.
Model: customer.rb
class Customer < ActiveRecord::Base
...
def self.password=(pass)
@password=pass
salt = Customer.random_string(10) if !salt?
self.hashed_password = Customer.encrypt_password(@password, salt)
end
end
Test: customer_test.rb
require File.dirname(__FILE__) + ''/../test_helper''
class CustomerTest < Test::Unit::TestCase
self.use_instantiated_fixtures = true
fixtures :customers
...
# change password
@longbob.password = @longbob.password_confirmation = "newlongpassword"
assert @lon...
2009 Apr 06
3
After Rails 2.3.2 upgrade: superclass mismatch for class TestCase (TypeError)
...l_require''
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require''
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:158:in `require''
from /home/costi/workspace/r2rrails/test/test_helper.rb:3
from ./test/unit/customer_test.rb:1:in `require''
from ./test/unit/customer_test.rb:1
from /usr/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/
rake_test_loader.rb:5:in `load''
from /usr/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/
rake_test_loader.rb:5
from /usr/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/
rake_te...
2006 Aug 08
2
Testing Inconsistencies - ruby works rake fails
...ctiveRecord::StatementInvalid: RuntimeError: ERROR C42P01
Mrelation "customers" does not exist Fnamespace.c L200
RRangeVarGetRelid: DELETE FROM customers
Obviously I''ve checked and the customers table exists, and as I
mentioned above, when I run => ruby test\unit\customer_test.rb all tests
succeed. So I''m guessing there is something wrong with the way rake is
loading up the tests and maybe not executing them correctly.
I am connecting to multiple databases in my application. I''ve created a
new database for my customers, licenses and products and am...
2006 Aug 18
3
Understanding MVC - view customization after using scaffolds
...fo
exists app/controllers/
exists app/helpers/
exists app/views/customerinfo
exists test/functional/
dependency model
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/customer.rb
create test/unit/customer_test.rb
create test/fixtures/customers.yml
identical app/views/customerinfo/_form.rhtml
create app/views/customerinfo/list.rhtml
create app/views/customerinfo/show.rhtml
create app/views/customerinfo/new.rhtml
create app/views/customerinfo/edit.rhtml
create...