All the mentioned solutions are great, but for me they implied a bit
too much hassle to set up and also, given a larger number of specs, a
bit slow.
This discussion actually motivated me to publish my own stubbing
solution that I've recently implemented on GitHub. (This actually is a
kind
On 27.5.2008, at 10.52, Mark Dodwell wrote:
Also, any opinions on using a Factory pattern for instantiating
mocks of
models? I like the idea of maintaining mocks in one place as I
frequently use them across several specs for models that have
associations. Do you think it would create dependen
Also, any opinions on using a Factory pattern for instantiating mocks of
models? I like the idea of maintaining mocks in one place as I
frequently use them across several specs for models that have
associations. Do you think it would create dependency issues between the
specs using that Factory
Many thanks for your replies.
David Chelimsky wrote:
> Use stub_model instead (if you're using source from github - if not
> the 1.4 release is coming soon).
Thanks - that helps a great deal.
Scott Taylor wrote:
> I would highly suggest using :null_object => true in view specs (or
> controller
On 26-mei-2008, at 21:52, Mark Dodwell wrote:
I find myself doing this kind of thing a lot in Controller Specs:
@vacancy = mock_model(Vacancy)
@vacancy.stub!(:reference)
@vacancy.stub!(:title)
@vacancy.stub!(:created_at)
@vacancy.stub!(:updated_at)
@vacancy.
On May 26, 2008, at 3:52 PM, Mark Dodwell wrote:
I find myself doing this kind of thing a lot in Controller Specs:
@vacancy = mock_model(Vacancy)
@vacancy.stub!(:reference)
@vacancy.stub!(:title)
@vacancy.stub!(:created_at)
@vacancy.stub!(:updated_at)
@vacancy.stu
On May 26, 2008, at 2:52 PM, Mark Dodwell wrote:
I find myself doing this kind of thing a lot in Controller Specs:
@vacancy = mock_model(Vacancy)
@vacancy.stub!(:reference)
@vacancy.stub!(:title)
@vacancy.stub!(:created_at)
@vacancy.stub!(:updated_at)
@vacancy.stu
I find myself doing this kind of thing a lot in Controller Specs:
@vacancy = mock_model(Vacancy)
@vacancy.stub!(:reference)
@vacancy.stub!(:title)
@vacancy.stub!(:created_at)
@vacancy.stub!(:updated_at)
@vacancy.stub!(:body)
@vacancy.stub!(:contract)