Re: [rspec-users] Testing routes with a prefix

2011-03-23 Thread Justin Ko
On Tue, Mar 22, 2011 at 6:50 PM, Radhesh Kamath wrote: > Hi experts, > > I am trying to test routing in my application, where all routes are > enclosed in a namespace like so: > > scope 'v1' do > resource :blah end >collection do > something >end > end > end > > Is there a clean way

Re: [rspec-users] RSPEC how to post to a controller? What's wrong with this?

2011-03-23 Thread Justin Ko
On Sat, Mar 19, 2011 at 2:32 PM, Mobyye wrote: > I'm trying to post to my controller in RSPEC by doing: > > it "should store create an IncomingMail record" do > > lambda { > post :create, >:from => 'xx', >:to => 'xx', >:cc => 'xx', >:sub

Re: [rspec-users] Stubs and Object Constructor

2011-03-23 Thread Pat Maddox
On Mar 20, 2011, at 9:38 PM, andyl wrote: > OK - I got this working using mocha and the 'any_instance' method. > > A gist with working examples is here: https://gist.github.com/879029 > > It looks like rspec mocks had an 'any_instance' method, but it was removed > because it promoted 'bad pra

Re: [rspec-users] Testing routes with a prefix

2011-03-23 Thread Pat Maddox
On Mar 22, 2011, at 6:50 PM, Radhesh Kamath wrote: > Hi experts, > > I am trying to test routing in my application, where all routes are > enclosed in a namespace like so: > > scope 'v1' do > resource :blah end >collection do > something >end > end > end > > Is there a clean way

Re: [rspec-users] RSPEC how to post to a controller? What's wrong with this?

2011-03-23 Thread Pat Maddox
On Mar 19, 2011, at 2:32 PM, Mobyye wrote: > I'm trying to post to my controller in RSPEC by doing: > > it "should store create an IncomingMail record" do > > lambda { > post :create, >:from => 'xx', >:to => 'xx', >:cc => 'xx', >:subjec

Re: [rspec-users] Stubs and Object Constructor

2011-03-23 Thread David Chelimsky
On Mar 20, 2011, at 11:38 PM, andyl wrote: > OK - I got this working using mocha and the 'any_instance' method. > > A gist with working examples is here: https://gist.github.com/879029 > > It looks like rspec mocks had an 'any_instance' method, but it was removed > because it promoted 'bad pr

[rspec-users] current example

2011-03-23 Thread Michael Guterl
Is it possible to retrieve the example that is currently running? ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] current example

2011-03-23 Thread David Chelimsky
On Mar 23, 2011, at 8:03 AM, Michael Guterl wrote: > Is it possible to retrieve the example that is currently running? describe "an example" do it "knows itself as example" do example.description.should eq("knows itself as example") end end __

Re: [rspec-users] rspec-users Digest, Vol 57, Issue 22

2011-03-23 Thread Micah Martin
On Mar 23, 2011, at 12:22 AM, rspec-users-requ...@rubyforge.org wrote: > Send rspec-users mailing list submissions to > rspec-users@rubyforge.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://rubyforge.org/mailman/listinfo/rspec-users > or, via email, send a

Re: [rspec-users] RSPEC how to post to a controller? What's wrong with this?

2011-03-23 Thread Joe Van Dyk
Before_filters preventing it? On Mar 22, 2011, at 11:06 PM, Mobyye wrote: I'm trying to post to my controller in RSPEC by doing: it "should store create an IncomingMail record" do lambda { post :create, :from => 'xx', :to => 'xx', :cc => 'xx',

Re: [rspec-users] Testing routes with a prefix

2011-03-23 Thread Radhesh Kamath
Justin Ko wrote in post #988825: > On Tue, Mar 22, 2011 at 6:50 PM, Radhesh Kamath > wrote: > >> end >> >> rspec-users@rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > > > You're mapping absolute strings (URL's) to your routes. Any string > manipulation would dilute the spec

Re: [rspec-users] Testing routes with a prefix

2011-03-23 Thread David Chelimsky
On Wed, Mar 23, 2011 at 12:16 PM, Radhesh Kamath wrote: > Justin Ko wrote in post #988825: >> On Tue, Mar 22, 2011 at 6:50 PM, Radhesh Kamath >> wrote: >> >>>  end >>> >>> rspec-users@rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >>> >> >> You're mapping absolute strings (URL

Re: [rspec-users] Post call verification

2011-03-23 Thread Srushti
If anyone is interested, I wrote a quick little gem to add spies to rspec-mocks. Basically, it adds a method called spy which internally returns a mock.as_null_object, and a matcher for "have_received(:method)" & "have_received(:method).with(args)". David, my understanding of your point (or at leas

Re: [rspec-users] Testing routes with a prefix

2011-03-23 Thread Justin Ko
On Wed, Mar 23, 2011 at 10:16 AM, Radhesh Kamath wrote: > Justin Ko wrote in post #988825: > > On Tue, Mar 22, 2011 at 6:50 PM, Radhesh Kamath > > wrote: > > > >> end > >> > >> rspec-users@rubyforge.org > >> http://rubyforge.org/mailman/listinfo/rspec-users > >> > > > > > > You're mapping absolut

Re: [rspec-users] Post call verification

2011-03-23 Thread David Chelimsky
[moved your post to the bottom for consistency with this thread] On Mar 23, 2011, at 1:41 PM, Srushti wrote: > On 22 March 2011 17:22, wrote: > > Date: Tue, 22 Mar 2011 06:52:02 -0500 > From: David Chelimsky > To: rspec-users > Subject: Re: [rspec-users] Post call verification > Message-ID: <

Re: [rspec-users] Post call verification

2011-03-23 Thread Srushti Ambekallu
On 24/03/11 12:29 AM, David Chelimsky wrote: [moved your post to the bottom for consistency with this thread] On Mar 23, 2011, at 1:41 PM, Srushti wrote: On 22 March 2011 17:22, > wrote: Date: Tue, 22 Mar 2011 06:52:02 -0500 From: David Cheli

Re: [rspec-users] Stubs and Object Constructor

2011-03-23 Thread andyl
Pat and David - Thanks for taking the time to explain this. Look forward to seeing any_instance in rspec/mocks. And I will try to use it as little as possible! ;-) - Andy ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org

[rspec-users] problem running tests of helpers

2011-03-23 Thread Art Peel
I'm in the process of upgrading from ruby 1.8.7 to ruby-1.9.2-p18 and from rails 2.3.8 to rails 2.3.9 and my tests of helpers have stopped working, for example script/spec spec/helpers/application_helper_spec.rb (Full sample shown below.) The output is below. The problem occurs in helper_exampl