Displaying 20 results from an estimated 1700 matches similar to: "Testing Inconsistencies - ruby works rake fails"
2006 May 11
4
Legacy database problem
Hi
I am trying to use Ruby on Rails to work with an existing database. The
problem is that, all the table names begin with a captial letter (e.g.
Products). So I did the following changes
in environment.rb, I''ve added under # Include your application
configuration below
ActiveRecord::Base.pluralize_table_names = false
In class Product, I''ve added
set_table_name
2006 Sep 01
2
Mrelation does not exists
Hello!
I''m having the following error:
RuntimeError: ERROR C42P01 Mrelation "subjects_users_id_seq" does not
exist Fnamespace.c L200 RRangeVarGetRelid: SELECT currval
(''subjects_users_id_seq'')
when I try to do:
subject= SubjectsUser.new(params[:subjects_user])
subject.save
The models:
class User < ActiveRecord::Base
has_one :last_entrie
has_one
2006 Jul 20
4
Help with Rails and postgres with sequence numbers (global?)
Hello,
I am building an Rails applications that has to integrate an legacy
system (lxoffice) (schema at:
http://www.lx-office.org/uploads/media/DB_Schema_2.1.1_R_393_17_03_2005_.pdf).
They somehow use global ids (global for some tables). I can not change
the schema and still I want to use Rails to access it and not pure SQL.
When I try to insert a record I get the following message:
2008 Nov 14
3
migration with data
Hi
I am using postgres and have two migration files like
001_create_categories.rb as
class CreateCategories < ActiveRecord::Migration
def self.up
create_table :categories do |t|
t.column :name, :string, :limit=>80
end
end
def self.down
drop_table :categories
end
end
and 002_populate_categories.rb
class PopulateCategories < ActiveRecord::Migration
2007 Oct 18
4
Feeding the framework ?
Hi there,
Is it just me or do many other rspec / rpsec_on_rails users spend more
time than they would like feeding the framework ?
Don''t get me wrong, I love rpsec, but I seem to spend about 2/3 hours
per week hunting down rspec problems.
For example, today `rake spec:models` is broken. When I migrate, load
fixtures and run `spec -cfs` all is well. When I run `rake spec:models`,
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 May 12
0
Using primary key that is not named "id"
Hi
I am using a legacy database that the primary key is named "ProductID"
and its type is SERIAL (or INT NOT NULL auto_increment).
set_primary_key "ProductID", is added to the Product class
Then I used >ruby script/generate scaffold Product Admin
to generate my controllers. When I try to insert a new product in the
products table, it gave me this error
RuntimeError:
2009 Apr 06
3
After Rails 2.3.2 upgrade: superclass mismatch for class TestCase (TypeError)
I upgraded a working app from rails 2.1 to 2.3.2. Now when I run rake
test:units I get this error: /usr/lib/ruby/gems/1.8/gems/
activesupport-2.3.2/lib/active_support/test_case.rb:17: superclass
mismatch for class TestCase (TypeError)
I generated a new test app and all tests run OK.
For the upgrade I ran rake:update and renamed the class in test_helper
to ActiveSupport::TestCase. Also renamed
2006 Jul 02
2
NoMethodError in Unit Test - Rails Newcomer
I''m working on user authentication system to get familiar with rails,
and have basically solved most of my apps problems till now. I keep
getting 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 =
2017 Nov 13
4
How to objcopy via LLVM toolchain for armv7e-m ELF32LE?
Hi LLVM developers,
As PR35281 mentioned:
$ llvm-objcopy -O binary llvm-cortex-m7.elf llvm-cortex-m7.bin
llvm-objcopy: 'llvm-cortex-m7.elf': The file was not recognized as a
valid object file.
if (ELFObjectFile<ELF64LE> *o =
dyn_cast<ELFObjectFile<ELF64LE>>(&Binary))
https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-objcopy/llvm-objcopy.cpp#L200
2014 Feb 06
2
Consulta spplot
Buenas tardes,
Estoy probando a leer archivos netcdf (como raster stack) y crear
animaciones de datos de modelos climáticos y estaba utilizando para
generar las imágenes spplot(). Estás imágenes tienes superpuestas
varias capas de imagenes, el mdt de base, nubosidad, precipitación y
nieve. Mi pregunta es la siguiente,¿es posible visualizar la leyenda
de cada una de las capas?
Actualmente solo
2006 Jan 02
3
rake test_units not loading any fixtures
Hello All,
If I run my unit tests individually using Ruby, they all work correctly.
However, if I try to run them using "rake test_units", I get a bunch of
error messages.
The error messages appear to be caused by rake not loading any of the
fixtures into the test database.
I am using PostgreSQL on Windows.
Does anyone have any suggestions?
Many thanks,
Bruce.
--
Posted via
2006 Apr 12
2
unit testing with model inheritence
Having jotted down some models, with some inheritence I tried to run some
unit tests. After waiting for rake test_units to run I got a rake of errors
(if you''ll forgive the play on words). The errors were to do with unknown
tables in the tear down stage. The unknown tables corresponded to sub-types
where single table inheritence was used. In other words, these tables
*shouldn''t*
2007 Oct 18
0
rake spec:models failing
Hi there,
I''m having trouble with `rake spec:models`. It''s failing on:
- 1 old rspec/rails project
- all new rspec/rails projects
But, it *is* working fine on my other (older) rspec/rails projects. All
projects are on rspec & rails 1.0.8, Rails 1.2.3, os X ppc
Here''s a fresh rspec/rails project with failing rake task
$ rails test_app -d postgresql
$ cd
2005 Dec 30
1
Need serious help - unit testing without a database
I''ve created a model, let''s just call it Person
class Person
attr_accessor :first_name, :lastname
def full_name
@first_name + " " + @last_name
end
end
I''m using this in my Rails application. My Rails application does not
use a database of any kind, and this model is obviously not a subclass
of ActiveRecord::Base. I can''t unit test this
2002 Dec 06
2
[patch] fix the ext3 data=journal unmount bug
This patch fixes the data loss which can occur when unmounting a
data=journal ext3 filesystem.
The core problem is that the VFS doesn't tell the filesystem enough
about what is happening. ext3 _needs_ to know the difference between
regular memory-cleansing writeback and sync-for-data-integrity
purposes.
(These two operations are really quite distinct, and the kernel has got
it wrong for
2005 Dec 23
2
SQLite in-memory
I left ":memory:" in database.yml for testing and the most simple
tests in the Agile book do not work (see trace below for test_truth).
Since that''s what comes with the distributed database.yml I suppose
it''s me doing something wrong.
Did someone get SQLite ":memory:" working? How does it grab the schema?
-- fxn
% rake test_units
(in
2006 Feb 08
8
Strategies for Unit testing 2 databases
Hi,
My application spans 2 (or more) databases for some very specific
reasons... My models are working fine, even dynamically establishing
connections as needed at runtime, and spanning relationships across the
databases (which really impressed me). The problem is, I can''t seem to
force Units for these models (that use a secondary db) to load their
fixtures into and use the
2006 Jun 02
3
Wierdness with rake test_units and schema.rb
I have just migrated to use Rail 1.1 from 1.0.
In the progress of fixing and cleaning up the unit tests. I found the
following problem. I am not sure if this is a bug or it is my
environment.
When I run "rake test_units, some of the index in association tables is
not created, this leads to failures for some unit test cases.
Thinking that may be because I didn''t setup the
2005 Dec 29
1
DNS wizard
Do we have anyone here who is a bind/dns wizard? I've been under the
impression my dns setup which I've used for so many years on a bsd
machine is now considered lame. If there is someone who would not mind
taking a look at my configuration to see where I'm missing something, or
where the difference lies between bind 9 and previous bind 8 configs?
I'd prefer to do this off list