I’ve got a Rails 2.0 app “AIMS_1” with one model, “Portfolio”. (I’m
following David C.’s 2007 tutorial at
Portfolio has two attributes: :symbol and :name.
With great help from this NG, I’ve got a neat set of validations
I want to put together a script that will test the validations as part
of a suite of tests to confirm the app’s validity as I expand it. For
this purpose, I added a Q&A directory (actually, “__QA”) under AIMS_1
and populated it with the following portfolio_spec.rb file:
describe Portfolio do
it “should report any invalid :stock entries” do
pf = Portfolio.new
When I run “spec portfolio_spec.rb” in a Command window I get the
ActiveRecord::ConnectionNotEstablished in ‘Portfolio should report any
invalid :stock entries’.
I expected some error because I’m creating a Portfolio instance
outside the AIMS_1 framework generated by Rails. I have no idea how
to address this issue.
I’m running ruby 1.8.6, Rails 2.0.2 and SciTE 1.74 over WinXP/SP2.
Thanks in Advance,