[rspec-users] fixture instantiated in before block?

2008-09-03 Thread Keith McDonnell
Hi all, Are fixtures not loaded & instantiated in the before block? I thought they /should/ be :) eg before(:all) do [EMAIL PROTECTED], @matt, @it_industry].each { |v| puts v.inspect } end it "should ..." do [EMAIL PROTECTED], @matt, @it_industry].each { |v| puts v.inspect } end => nil n

Re: [rspec-users] Controller specs erroneously loading views in edge rails?

2008-09-03 Thread Tim Haines
Ian White has just submitted a patch for this. Thanks Ian. http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/516 Tim. On Wed, Sep 3, 2008 at 10:41 AM, Tim Haines <[EMAIL PROTECTED]> wrote: > Hi guys, > > After updating to edge rails I've just struck this problem too. I've just > grabb

[rspec-users] Speccing the existance of an unchecked checkbox

2008-09-03 Thread Bart Zonneveld
Hey list, I found myself trying to verify there are some non-checked checkboxes in a template today, and am kinda stumped how to do it :). A checked checkbox is easy, have_tag('input[type=checkbox] [checked=checked]). But, an unchecked checkbox hasn't got the checked attribute at all. And as

Re: [rspec-users] fixture instantiated in before block?

2008-09-03 Thread David Chelimsky
On Wed, Sep 3, 2008 at 4:52 AM, Keith McDonnell <[EMAIL PROTECTED]> wrote: > Hi all, > > Are fixtures not loaded & instantiated in the before block? I thought they > /should/ be :) eg > > before(:all) do Try before(:each) instead. Read the warning at the bottom of http://rspec.info/documentation/

Re: [rspec-users] Speccing the existance of an unchecked checkbox

2008-09-03 Thread David Chelimsky
On Wed, Sep 3, 2008 at 6:56 AM, Bart Zonneveld <[EMAIL PROTECTED]> wrote: > Hey list, > > I found myself trying to verify there are some non-checked checkboxes in a > template today, and am kinda stumped how to do it :). > A checked checkbox is easy, > have_tag('input[type=checkbox][checked=checked

Re: [rspec-users] Speccing the existance of an unchecked checkbox

2008-09-03 Thread Bart Zonneveld
On 3 sep 2008, at 15:28, David Chelimsky wrote: On Wed, Sep 3, 2008 at 6:56 AM, Bart Zonneveld <[EMAIL PROTECTED]> wrote: Hey list, I found myself trying to verify there are some non-checked checkboxes in a template today, and am kinda stumped how to do it :). A checked checkbox is easy,

Re: [rspec-users] Speccing the existance of an unchecked checkbox

2008-09-03 Thread Matt Wynne
On 3 Sep 2008, at 14:31, Bart Zonneveld wrote: On 3 sep 2008, at 15:28, David Chelimsky wrote: On Wed, Sep 3, 2008 at 6:56 AM, Bart Zonneveld <[EMAIL PROTECTED]> wrote: Hey list, I found myself trying to verify there are some non-checked checkboxes in a template today, and am kinda stum

Re: [rspec-users] Speccing the existance of an unchecked checkbox

2008-09-03 Thread David Chelimsky
On Wed, Sep 3, 2008 at 8:38 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: > On 3 Sep 2008, at 14:31, Bart Zonneveld wrote: > >> >> On 3 sep 2008, at 15:28, David Chelimsky wrote: >> >>> On Wed, Sep 3, 2008 at 6:56 AM, Bart Zonneveld <[EMAIL PROTECTED]> >>> wrote: Hey list, I found m

[rspec-users] Setting instance variables for controllers

2008-09-03 Thread patrick_r
Hi everyone, I have been trying to find an answer to this question and have not been able to. Any help is greatly appreciated. I am using Rails 2.1.0 and Rspec 1.1.4. How can I set an instance variable in my Rspec test that is then available to my controller while the test is running? For examp

Re: [rspec-users] Setting instance variables for controllers

2008-09-03 Thread Maurício Linhares
You don't need to set the instance variable, you can stub the find call: describe CartController do describe "index" do before do @user = mock_model( User ) end it "should render 'cart_full' if @user is set" do # This is where I need to set @user User.stub!( :find ).with('

Re: [rspec-users] Setting instance variables for controllers

2008-09-03 Thread Scott Taylor
On Sep 3, 2008, at 10:40 AM, Maurício Linhares wrote: You don't need to set the instance variable, you can stub the find call: Or you could also stub the call to User::find. Also - you don't *WANT* to set the instance variable - it's an encapsulation violation - there is nothing in the p

Re: [rspec-users] Setting instance variables for controllers

2008-09-03 Thread Jonathan Linowes
On Sep 3, 2008, at 10:53 AM, Scott Taylor wrote: On Sep 3, 2008, at 10:40 AM, Maurício Linhares wrote: You don't need to set the instance variable, you can stub the find call: Or you could also stub the call to User::find. Also - you don't *WANT* to set the instance variable - it's an

[rspec-users] webrat question, form without buttons

2008-09-03 Thread Zach Dennis
Can you submit a form that has no submit button/image? -- Zach Dennis http://www.continuousthinking.com http://www.mutuallyhuman.com ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] webrat question, form without buttons

2008-09-03 Thread Nick Hoffman
On 2008-09-03, at 12:06, Zach Dennis wrote: Can you submit a form that has no submit button/image? You can submit a form using Javascript. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] webrat question, form without buttons

2008-09-03 Thread Zach Dennis
On Wed, Sep 3, 2008 at 12:40 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: > On 2008-09-03, at 12:06, Zach Dennis wrote: >> >> Can you submit a form that has no submit button/image? > > You can submit a form using Javascript. That's why we don't have submit buttons. =) But in the context of webrat,

Re: [rspec-users] webrat question, form without buttons

2008-09-03 Thread Nick Hoffman
On 2008-09-03, at 13:15, Zach Dennis wrote: On Wed, Sep 3, 2008 at 12:40 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: You can submit a form using Javascript. That's why we don't have submit buttons. =) But in the context of webrat, if there is a form w/o a submit button, how can you submit it

Re: [rspec-users] webrat question, form without buttons

2008-09-03 Thread Nick Hoffman
On 2008-09-03, at 13:38, Zach Dennis wrote: When the user clicks a button, but all of the handy dandy work is done in unobtrusive-style javascript. It's not a submit button. It's a CSS-made button with listeners attached, I'm afraid I can't be of much help with that. I've barely used Webrat.

[rspec-users] Writing specs for a module

2008-09-03 Thread Nick Hoffman
I'm writing specs for a module for my Rails app. The module will live in lib/ . For now, I've created the directory spec/lib/ to store the specs for files in lib/ . However, I'm curious to know if there's a currently accepted location in which to store these types of specs. Thanks, Nick ___

Re: [rspec-users] webrat question, form without buttons

2008-09-03 Thread Zach Dennis
On Wed, Sep 3, 2008 at 1:31 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: > On 2008-09-03, at 13:15, Zach Dennis wrote: >> >> On Wed, Sep 3, 2008 at 12:40 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: >>> >>> You can submit a form using Javascript. >> >> That's why we don't have submit buttons. =) >> >

Re: [rspec-users] Writing specs for a module

2008-09-03 Thread Pat Maddox
On Wed, Sep 3, 2008 at 1:57 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: > I'm writing specs for a module for my Rails app. The module will live in > lib/ . For now, I've created the directory spec/lib/ to store the specs for > files in lib/ . However, I'm curious to know if there's a currently acce

Re: [rspec-users] Setting instance variables for controllers

2008-09-03 Thread patrick_r
Thank you very much for all your help, this made everything crystal clear! -- View this message in context: http://www.nabble.com/Setting-instance-variables-for-controllers-tp19283500p19295990.html Sent from the rspec-users mailing list archive at Nabble.com. __

Re: [rspec-users] webrat question, form without buttons

2008-09-03 Thread Jarkko Laine
On 3.9.2008, at 19.38, Zach Dennis wrote: On Wed, Sep 3, 2008 at 1:31 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: On 2008-09-03, at 13:15, Zach Dennis wrote: On Wed, Sep 3, 2008 at 12:40 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: You can submit a form using Javascript. That's why we

Re: [rspec-users] webrat question, form without buttons

2008-09-03 Thread Ben Mabey
Jarkko Laine wrote: > > On 3.9.2008, at 19.38, Zach Dennis wrote: > >> On Wed, Sep 3, 2008 at 1:31 PM, Nick Hoffman <[EMAIL PROTECTED]> >> wrote: >>> On 2008-09-03, at 13:15, Zach Dennis wrote: On Wed, Sep 3, 2008 at 12:40 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: > > You c

Re: [rspec-users] webrat question, form without buttons

2008-09-03 Thread Zach Dennis
On Wed, Sep 3, 2008 at 6:21 PM, Ben Mabey <[EMAIL PROTECTED]> wrote: > Jarkko Laine wrote: >> >> On 3.9.2008, at 19.38, Zach Dennis wrote: >> >>> On Wed, Sep 3, 2008 at 1:31 PM, Nick Hoffman <[EMAIL PROTECTED]> >>> wrote: On 2008-09-03, at 13:15, Zach Dennis wrote: > > On Wed, Sep 3, 2