Re: spec'ing models

It looks like my first note didn’t go through … so I apologize if it
is delayed and this is a duplicate. My colleagues and I have been
testing associations like this …

it “should have one account” do
Profile.should_receive(:has_one).with(:account)
load “profile.rb”
end

We like this as we are only testing the code we write and not testing
ActiveRecord. If anyone has a better approach I know we would be
interested in learning about it.

Anthony Broad-Crawford

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs