I defined my models in a file called model.rb located in app/models
like so:
class Client
include DataMapper::Resource
property :id, Serial
property :name, String, :key => true, :unique => true
property :created_at, DateTime
property :updated_at, DateTime
end
I would now like to test my setup with RSpec like so:
require "rspec"
require "spec_helper"
describe Client, "do" do
before(:each) do
@client = Client.create(:name => 'The Glue Factory')
end
it "should provide id and timestamps for a new client" do
@client.saved
[email protected]?
[email protected]_at.nil?
[email protected]_at.nil?
end
end
I have commented out all the stuff in spec_helper.rb related to
ActiveRecord. However, when I run my test I get this:
PGError: fe_sendauth: no password supplied
.rvm/gems/ruby-1.9.2-p290@global/gems/activerecord-3.0.10/lib/
active_record/connection_adapters/postgresql_adapter.rb:950:in
`initialize'
.rvm/gems/ruby-1.9.2-p290@global/gems/activerecord-3.0.10/lib/
active_record/connection_adapters/postgresql_adapter.rb:950:in `new'
Notice the ActiveRecord stuff. Understandable that it is not finding a
password because I pass those credentials to DataMapper:
DataMapper.setup(:default, ENV['DATABASE_URL'] || 'postgres://
localhost/mydb')
Why is my test executing ActiveRecord? How can I get my test to work
as desired?
Thanks.
--
You received this message because you are subscribed to the Google Groups
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/datamapper?hl=en.