Displaying 20 results from an estimated 30000 matches similar to: "$SAFE ERB"
2005 Dec 30
1
Problems with Testing (Depot) demo app in Agile Rails book
I''ve encountered a perplexing problem whilst following along the demo
app in the "Agile Web Development with Rails" book. Any help would be
greatly appreciated. Here is a brief time line of my tale of woe:-
0. Been programming (business apps) and designing/building DBs for two
decades - but new to both Ruby and Rails (so I apologise in advance if
I''ve made some
2005 Dec 12
2
Using a lib in YAML fixtures
I''m using the runt library [1] to do some temporal expression
matching. I want to keep the expression in a binary field in my db.
I figured that then in order to do the fixtures, I''d need to do some
erb in the yaml file. So I came up with this:
onetime:
id: 1
name: One Time
description: This event occurs only one time.
timex: <%= REYear.new(7) & REMonth.new(24)
2005 Dec 22
1
How to write unit tests with respect to model callbacks?
Hello,
I am exploring the "Testing" part of Rails, but It seems some things
work differently than I thought it would.
Consider the following model:
class Client < ActiveRecord::Base
has_one :project
def after_create
Project.new(:name => self.name, :is_client => true, :client_id
=> self.id).save
end
def after_update
2006 Jan 18
15
Anyone got Globalize working???
Hi all
In another thread I complain about an error I get after trying to get
Globalize working.
http://www.ruby-forum.com/topic/51988#new
Now I want to ask you, if anybody of you has ever got Globalize working?
I have done exactly what''s written in the (absolutely much too short)
tutorial of its wiki...
http://globalize.diluvia.net/wiki
...and I''m very frustrated that no
2005 Dec 21
6
Rails without a db - how to run tests
I''m writing a simple app that doesn''t need to use a database. I added
:active_record to the config.frameworks -= line in environment.rb
file. This lets me run ./script/generate fine without complaining
about no connection. However if I try to run a functional test, it
complains about no connection being established. Well...I don''t want
a connection to be established.
2006 Jan 10
5
Oracle 10g Express - generate scaffold gives error
Hello,
I have Oracle XE installed.
I have a table USERS.
When I try to generate a scaffold it gives me this error.
I tried also with Mysql and it worked.
E:\radrails\projects\MPS>ruby script\generate scaffold user
exists app/controllers/
exists app/helpers/
create app/views/user
exists test/functional/
dependency model
exists app/models/
exists
2006 Jan 10
2
Default unit tests failing?
I''ve got a strange issue. My default unit tests are failing for two models. I
haven''t changed _anything_ in the test. Here''s an example:
Output:
1) Error:
test_truth(ShippingCostTypeTest):
NoMethodError: You have a nil object when you didn''t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.find
2006 Jan 03
2
Newbie Install Question
Hi,
I''ve been trying to get rails going on one of our dedicated servers,
with no luck. I have ruby installed, gems, etc... When i goto to
create my first rails app i get this:
rails test
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/
associations/association_proxy.rb:6: warning: instance_methods:
parameter will default to ''true'' as of 1.8.1
2007 Jul 12
0
[retry] fixture_references: "Mysql::Error #HY000"? (fwd)
I''m resending this with additional information, as I''ve had no
response. I''ve been trying to use the fixture_references plugin,
and I seem to be getting lots of:
1) Error:
test_truth(DeviceTest):
ActiveRecord::StatementInvalid: Mysql::Error: #HY000Field ''description_id'' doesn
''t have a default value: INSERT INTO devices (`id`) VALUES (2)
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
2006 Jan 14
0
testing template components
Hi,
I''m plowing through the template section of "Agile Rails", specifically the
stuff starting on P. 364. What is a good strategy for testing components?
My initial thought is to mimic the Rails application "test" directory. No
problem.
Next copy the setup method, and set it up like so -
class SidebarControllerTest < Test::Unit::TestCase
def setup
2007 Jun 15
3
Error when running functional test - Errno::ENOENT
Hello,
I''m getting an error when running functional tests as follows, using
Mac OSX 10.4.9, Rails 1.2.3 .
When I run:
ruby test/functional/campaign_controller_test.rb
I get this error:
Started
E
Finished in 0.027402 seconds.
1) Error:
test_should_get_icon_data(CampaignControllerTest):
Errno::ENOENT: No such file or directory - /usr/src/projects/myproject/
2005 Jan 15
0
Model syntax errors obscured during fixture load
When I run unit tests with a syntax error in one of my models (in this
case, it was an unterminated quote), I get this error, which suggests
to me that whatever code is autoloading the model while it''s loading
my fixtures is masking the error (I don''t get any notification of the
syntax error, here, nor in the log).
Bob
bob@gemini:~/rails/windsong$ ruby -Ilib:test -S testrb
2009 Feb 02
2
looking for help with NoMethodError: undefined method `key?' for #<String:0x4795488>
Hi all,
Any help with this would be appreciated. I''m using instant rails,
updated to 2.2.2, on Windows XP.
I''ve created my DB and scaffolded a few things and put some fixtures
into place, and when I run the tests I get many errors that look like
this:
---------------------------------
1) Error:
test_the_truth(EntityTest):
NoMethodError: undefined method `key?'' for
2005 Dec 29
7
belongs_to causing NoMethodError exceptions ... ?
I''ve got a really strange problem using belongs_to. I apologize in
advance for the length... this is going to take a while to explain.
Basic idea: Creating a User requires that the user enter an email
address and activation key that matches an existing PendingUser.
After creating the user successfully, that pending user should be
marked as "used".
The problem:
When I
2006 Nov 07
4
Unknown column 'id' in 'field list
Hello,
I''m trying to write a unit test for model that doesn''t have an ''id''
field. I created the model''s table with the following migration, making
sure the primary key was set.
class CreateActiveUserMetrics < ActiveRecord::Migration
def self.up
create_table :active_user_metrics,
{:id => false,
2008 Jan 16
0
[CruiseControl] RubyOnRails build 8649 failed
The build failed.
CHANGES
-------
Revision 8649 committed by gbuesing on 2008-01-16 20:07:10
Introducing DateTime #utc, #utc? and #utc_offset, for duck-typing compatibility with Time. Closes #10002
M /trunk/activesupport/CHANGELOG
M /trunk/activesupport/lib/active_support/core_ext/date_time/calculations.rb
M /trunk/activesupport/test/core_ext/date_time_ext_test.rb
TEST FAILURES AND
2005 Nov 26
4
activerecord rake test_mysql
Hi (I''m resubmitting this because
First question: This is the rails dev list, correct?
I''d like to submit a patch and am following the steps on this page:
http://dev.rubyonrails.org/
Here''s what I did (using mysql 5.0.15-nt):
created 2 databases:
activerecord_unittest
activerecord_unittest2
created 1 user: rails (giving all priveleges to both databases)
ran
2006 Feb 24
1
sqlite3 error: uninitialized constant API
I''m just starting my first rails app and I can''t figure out this error.
It''s got something to do with connecting to sqlite3...Here''s the
application trace:
<code>
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:200:in
`const_missing''
2006 Jun 24
5
Rake vs Ruby for running tests (error discrepency)
I''m having (to me) a strange problem with errors when running my tests
with rake as opposed to using ruby. If I do rake test:units I get this
error for several tests, but not all:
13) Error:
test_player_has_game_statistics_for_season(PlayerSeasonTest):
ActiveRecord::StatementInvalid: Mysql::Error: Duplicate entry ''22'' for
key 1: INSERT INTO positions (`name`, `id`,