you need to use the assigns method like so
it "should count the number of purchase requests found" do
get :index
assigns(:num_found).should == 3
end
On Wed, Jul 15, 2009 at 2:29 PM, Leo wrote:
> HI All,
> I have a controller with the following in it:
>
> def index
>@purchase_reques
Sometimes when features are asked to be removed it doesn't make sense to
specify that they shouldn't be there. It seems to me that removing something
from a tested app should not entail writing a failing spec for that change.
I'm curious if people have different opinions or insights on this.
-Ada
gt;> On Jul 13, 2009, at 2:12 PM, David Chelimsky wrote:
> >>
> >>> On Mon, Jul 13, 2009 at 1:04 PM, Scott Taylor
> >>> wrote:
> >>>>
> >>>> On Jul 13, 2009, at 1:46 PM, Scott Taylor wrote:
> >>>>
> >>>>
13, 2009, at 1:46 PM, Scott Taylor wrote:
>
>
> On Jul 13, 2009, at 1:32 PM, Adam Anderson wrote:
>
> Thanks for the reply, Scott.
>
> What you describe is what is currently being done.
>
> now = Time.now
> Time.stub!(:now).and_return(foo_time)
> do_stuff
>
return to its original behavior
(i.e., returning the current, actual time).
-Adam
On Mon, Jul 13, 2009 at 9:58 AM, Scott Taylor wrote:
>
> On Jul 13, 2009, at 12:09 PM, Adam Anderson wrote:
>
> I can't seem to find a good way to do this. If I stub out Time.now in one
>>
-
> BJ Clark
>
>
> On Jul 13, 2009, at 9:45 AM, Adam Anderson wrote:
>
> So that is what is happening now. Time.now is being stubbed but that will
> last for the life of the spec, but I only need it to create some test data
> and I don't want it to affect other areas of t
is issue, though I'd much
rather generate a real GUID or get rid of it altogether.
Thanks for the help!
On Mon, Jul 13, 2009 at 9:26 AM, doug livesey wrote:
> Can you just stub it before the example in question, either in it or in a
> before block?
>
> 2009/7/13 Adam Anderson
>
I can't seem to find a good way to do this. If I stub out Time.now in one of
my specs but need to return it to its original functionality then can I
remove the stub?
So I'd like to say something like:
Time.stub!(:now).and_return(foo_time)
Time.now # => foo_time
Time.unstub!(:now)
Time.now # => wha
> ./.autotest file, do you also have a ~/.autotest file?
>
>
> On Tue, May 19, 2009 at 1:54 AM, Adam Anderson
> wrote:
> > Yeah. I apologize that was a typo on my part. It should have said
> ./.autotest
> >
> >
> > -Adam
> >
> > On Mon, May 18
Just curious if anyone is running DeepTest with rspec 1.2.6. I can't even do
a '$ rake -T' on the deep-test repo at git://github.com/qxjit/deep-test.git
When I try to run deep_test using their provided rspec example at
http://github.com/qxjit/deep-test it blows up and produces the following:
Warni
Yeah. I apologize that was a typo on my part. It should have said ./.autotest
-Adam
On Mon, May 18, 2009 at 11:55 AM, Kero van Gelder wrote:
>> Then I edit the files like so:
>>
>> ./autotest:
>> Autotest.add_hook :initialize do |at|
>> at.add_mapping(%r%^spec/something/.*_spec\.rb$%) do
>>
onds
1 example, 0 failures
# Waiting since 2009-05-17 16:22:56
Sorry to be so verbose but I'm honestly very lost at this point...
I've also tried variations of this the add_mapping method by using the
block variables but no go.
-Adam
On Sun, May 17, 2009 at 2:31 PM, David Chelimsk
Is there a way to tell autospec for rails to run _all_ the spec files
in the spec directory a la spec/**/*_spec.rb instead of just the ones
in model/controller/etc? I've experimented with adding my own mappings
in /.autotest but haven't had any luck.
___
13 matches
Mail list logo