I left out a key piece of my spec code in the original question:
before(:each) do
@category = mock_model(Category)
Category.should_receive(:find).any_number_of_times.and_return
(@category)
@image = mock_model(Image)
@image_category = mock_model(ImageCategory)
end
For th
Actually better then an exception
On 8/23/07, Zach Dennis <[EMAIL PROTECTED]> wrote:
> On 8/23/07, Daniel N <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > On 8/24/07, Courtenay <[EMAIL PROTECTED]> wrote:
> > > Does this work?
> > >
> > >Image.stub!(:validates_uniqueness_of).and_return(true)
> > >
On 8/23/07, s.ross <[EMAIL PROTECTED]> wrote:
> I want to use mocks and stubs to test the controller, but am having
> trouble getting my validation not to trigger. Here's the code:
>
> # spec:
>
> Image.stub!(:find).and_return(@image)
> @image.should_receive(:save!).once.with(:any_args)
>
On 8/23/07, Daniel N <[EMAIL PROTECTED]> wrote:
>
>
>
> On 8/24/07, Courtenay <[EMAIL PROTECTED]> wrote:
> > Does this work?
> >
> >Image.stub!(:validates_uniqueness_of).and_return(true)
> >
> >
> > On 8/23/07, s.ross <[EMAIL PROTECTED]> wrote:
> > > I want to use mocks and stubs to test the co
On 8/24/07, Courtenay <[EMAIL PROTECTED]> wrote:
>
> Does this work?
>
>Image.stub!(:validates_uniqueness_of).and_return(true)
>
>
> On 8/23/07, s.ross <[EMAIL PROTECTED]> wrote:
> > I want to use mocks and stubs to test the controller, but am having
> > trouble getting my validation not to tri
Does this work?
Image.stub!(:validates_uniqueness_of).and_return(true)
On 8/23/07, s.ross <[EMAIL PROTECTED]> wrote:
> I want to use mocks and stubs to test the controller, but am having
> trouble getting my validation not to trigger. Here's the code:
>
> # spec:
>
> Image.stub!(:find).a
I want to use mocks and stubs to test the controller, but am having
trouble getting my validation not to trigger. Here's the code:
# spec:
Image.stub!(:find).and_return(@image)
@image.should_receive(:save!).once.with(:any_args)
put :update, :id => @image.id, :category_id =>
@ca