Forum: Ruby on Rails ActiveRecord belongs_to ActiveResource

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
256fe77e4bde06736b1ddf1bea5b0d66?d=identicon&s=25 frogstarr78 (Guest)
on 2009-04-10 19:37
(Received via mailing list)
class Thing < ActiveRecord::Base
  belongs_to :other_thing

class OtherThing < ActiveResource::Base = ...

The association here works. I can access other_thing from thing with
no problems until, as usual, testing. Specifically functionally test
the things_controller. The things controller is simple scaffold,
however, having the association to an active resource model causes
functional tests to error because they don't make the required request
to the resource, dispite using the ActiveRecord::HttpMock... mechanism
in the functional test.

So I have three questions really.
One, is this type of relationship something that we can expect to work
in rails? Or am I running off the rails here?
Two, assuming that this is an acceptable use case. Using TDD, as
apposed to BDD. Is there infrastructure already in rails for
functionally testing this?
Three, are there any other suggestions? (e.g. Stubbing
@thing.other_thing, plugins that do this, etc)
This topic is locked and can not be replied to.