Re: [rspec-users] RSpec view test for :partial with :locals?

2008-03-12 Thread David Chelimsky
On Wed, Mar 12, 2008 at 3:19 AM, David Schmidt <[EMAIL PROTECTED]> wrote: > I'm currently working on some RSpec view tests and I'm having problems > with expect_render. Most of the expect_render's work fine, but in one > of my views I have: > > <%= render :partial => "user_cloud", :locals => {:

[rspec-users] Whence "post" in a description?

2008-03-12 Thread nzook
I'm having the exact problem described in this earlier post: http://www.nabble.com/Odd-response.body-behavior-to12837556.html#a12837556 That is, after a post, response.body is just the controller/view string ("user/login" in my case). Failing to find any answer on the web, I'm trying to trace ex

Re: [rspec-users] RSpec view test for :partial with :locals?

2008-03-12 Thread Zach Dennis
Are you assigning @featured_user (ie: assigns[:featured_user]) before you render your template? We use :locals w/o any problem, for example: template.expect_render(:partial => 'profiles/data', :locals => {:profile => @profile}).and_return(%||) Zach On Tue, Mar 11, 2008 at 11:19 PM, David Schmid

[rspec-users] Testing helper methods in rspec

2008-03-12 Thread James B. Byrne
This is perhaps a naive question, but what is the recommended manner of testing a helper method in rspec? I have created a simple string manipulation function and I want to write some tests for it. It it were a script then I would just add if __FILE__ == $0 and add the tests below that but I do n

Re: [rspec-users] Testing helper methods in rspec

2008-03-12 Thread Jarkko Laine
On Wed, Mar 12, 2008 at 3:54 PM, James B. Byrne <[EMAIL PROTECTED]> wrote: > This is perhaps a naive question, but what is the recommended manner of > testing a helper method in rspec? You just describe the helper module and call the helper method like you'd do in the views: require File.dirname

Re: [rspec-users] running a specific describe block

2008-03-12 Thread Jay Donnell
This doesn't work for me on 1.1.3 I have something like this: describe Support do describe "attached image" do it "should validate presence of attachment" do # test stuff ... end it "should validate that attachment is an image" do # test stuff ...

Re: [rspec-users] running a specific describe block

2008-03-12 Thread David Chelimsky
On Wed, Mar 12, 2008 at 5:22 PM, Jay Donnell <[EMAIL PROTECTED]> wrote: > This doesn't work for me on 1.1.3 > I have something like this: > > describe Support do > describe "attached image" do > it "should validate presence of attachment" do > # test stuff ... > end > >

[rspec-users] Warning: integrate_views and nested description groups

2008-03-12 Thread nzook
describe MyController do integrate_views describe "A common base senario" do it "no longer integrates views" do be_careful end end end integrate_views affects an attribute in the class formed by the describe factory method. The second describe generates its own class, so integ

Re: [rspec-users] Problems with form_for and partials

2008-03-12 Thread Jonathan Linowes
Has anyone come up with a solution for stubbing partials and passing form builders to it? i have a complex form with many parts, and those are rendered in partials On Oct 21, 2007, at 8:46 AM, rupert wrote: >> i'm having problem with a form_for situation where i'm trying to DRY >> out the re

Re: [rspec-users] running a specific describe block

2008-03-12 Thread James Deville
Does "Support attached image" or "support attached image" work? JD On Mar 12, 2008, at 10:41 AM, David Chelimsky wrote: > On Wed, Mar 12, 2008 at 5:22 PM, Jay Donnell <[EMAIL PROTECTED]> > wrote: >> This doesn't work for me on 1.1.3 >> I have something like this: >> >> describe Support do >>

Re: [rspec-users] Warning: integrate_views and nested description groups

2008-03-12 Thread David Chelimsky
On Wed, Mar 12, 2008 at 8:23 PM, nzook <[EMAIL PROTECTED]> wrote: > > describe MyController do > integrate_views > describe "A common base senario" do > it "no longer integrates views" do > be_careful >end > end > end > > integrate_views affects an attribute in the class form

Re: [rspec-users] Problems with form_for and partials

2008-03-12 Thread Zach Dennis
You can use mocha parameter matching to match on "anything" where your form builder would be passed in. You could also use Mocha's "kind_of" parameter matcher to ensure that what you expect is a FormBuilder object. Another way to do this is to not pass in your form builder, but the object needed,

Re: [rspec-users] Problems with form_for and partials

2008-03-12 Thread David Chelimsky
On Wed, Mar 12, 2008 at 9:43 PM, Zach Dennis <[EMAIL PROTECTED]> wrote: > You can use mocha parameter matching to match on "anything" where your > form builder would be passed in. You could also use Mocha's "kind_of" > parameter matcher to ensure that what you expect is a FormBuilder > object. >

Re: [rspec-users] Problems with form_for and partials

2008-03-12 Thread Jonathan Linowes
On Mar 12, 2008, at 5:47 PM, David Chelimsky wrote: > On Wed, Mar 12, 2008 at 9:43 PM, Zach Dennis > <[EMAIL PROTECTED]> wrote: >> You can use mocha parameter matching to match on "anything" where >> your >> form builder would be passed in. You could also use Mocha's >> "kind_of" >> param

[rspec-users] What is SpecServer?

2008-03-12 Thread Mikel Lindsaar
I have looked through the docs, looked at the code, even gave a cursory (2 page) glance at google, and it is not clear to me what SpecServer is or what it is for. Is it meant to speed up the execution of specs in a rails environment by doing some magic on the database? Or I am thinking it keeps a

Re: [rspec-users] What is SpecServer?

2008-03-12 Thread Scott Taylor
On Mar 13, 2008, at 12:17 AM, Mikel Lindsaar wrote: > I have looked through the docs, looked at the code, even gave a > cursory (2 page) glance at google, and it is not clear to me what > SpecServer is or what it is for. > > Is it meant to speed up the execution of specs in a rails environment >