Re: [rspec-users] How to test a controller

2008-10-16 Thread Mano ah
Thank you stephen. Though it is easy to write spec for controller something stoped me like I am proceeding the wrong way. Your words gives confidence. so let me try and get back to you. -- Posted via http://www.ruby-forum.com/. ___ rspec-users maili

Re: [rspec-users] How to test a controller

2008-10-16 Thread Stephen Eley
On Fri, Oct 17, 2008 at 1:35 AM, Mano ah <[EMAIL PROTECTED]> wrote: > I want to test the controllers of an existing project. How can i do it. > > Actually when I use ruby script/spec rspec_scaffold modelname it > creates a spec controller for that model and a controller inside the app > folder. T

Re: [rspec-users] RSpec vs Screw.Unit

2008-10-16 Thread Scott Taylor
On Oct 16, 2008, at 4:28 PM, Ashley Moran wrote: Hi Hope this isn't OT. I'm currently contemplating using the Dojo[1] JavaScript framework, and I suspect it's powerful enough that using Cucumber features and Celerity alone will quickly leave me wanting lower-level unit specs for the JS.

Re: [rspec-users] RSpec vs Screw.Unit

2008-10-16 Thread aslak hellesoy
On Thu, Oct 16, 2008 at 10:28 PM, Ashley Moran <[EMAIL PROTECTED]> wrote: > Hi > > Hope this isn't OT. I'm currently contemplating using the Dojo[1] > JavaScript framework, and I suspect it's powerful enough that using Cucumber > features and Celerity alone will quickly leave me wanting lower-leve

[rspec-users] How to test a controller

2008-10-16 Thread Mano ah
I want to test the controllers of an existing project. How can i do it. Actually when I use ruby script/spec rspec_scaffold modelname it creates a spec controller for that model and a controller inside the app folder. So for testing an already existing project how should i proceed. -- Posted vi

Re: [rspec-users] Mocking documentation

2008-10-16 Thread David Chelimsky
On Thu, Oct 16, 2008 at 11:16 AM, Mark Thomson <[EMAIL PROTECTED]> wrote: > Can I make a suggestion for the RSpec documentation? Please put requests like this in lighthouse. Even though we're behind on tickets there, it's the only way to ensure things stay on the radar. Thanks, David > In the d

Re: [rspec-users] Just a quick question on David's new-controller-examples

2008-10-16 Thread David Chelimsky
On Wed, Oct 15, 2008 at 3:58 PM, Shane Mingins <[EMAIL PROTECTED]> wrote: > Hi Mark > > Yeah I was looking at that later on too. And yes if you use in a 'before' > it does. Only setting in an 'it' block is ok. > > I was using this as a quick test as we are on an older version of rspec and > I was

Re: [rspec-users] Mocks: expectations vs spying

2008-10-16 Thread Ashley Moran
On Oct 16, 2008, at 10:02 pm, Ben Mabey wrote: Pat has been working on adding the spy pattern to rspec and JoeSniff has already added it to the rr mocking framework on github I believe. There have been some recent posts on this mailing list about it. Searching for spy in this groups past

Re: [rspec-users] How to spec accessing a constant

2008-10-16 Thread Nick Hoffman
On 2008-10-16, at 15:12, Craig Demyanovich wrote: Cool. Having seen something a little more concrete, I like your design decisions. In this case, I'd go with Scott's recommendation of hiding the constant behind a method. Regards, Craig Thanks for taking a look, Craig, and giving me your op

Re: [rspec-users] Mocks: expectations vs spying

2008-10-16 Thread Ben Mabey
Ashley Moran wrote: Hi again Ok, so I'm having a little research fling with JavaScript, and I've uncovered something I hadn't seen before: "spying". Basically, inspecting mocks after-the-fact, rather than setting expectations upfront. Here are the articles I found: http://ajaxian.com/archi

[rspec-users] Mocks: expectations vs spying

2008-10-16 Thread Ashley Moran
Hi again Ok, so I'm having a little research fling with JavaScript, and I've uncovered something I hadn't seen before: "spying". Basically, inspecting mocks after-the-fact, rather than setting expectations upfront. Here are the articles I found: http://ajaxian.com/archives/mockme-a-new-j

[rspec-users] RSpec vs Screw.Unit

2008-10-16 Thread Ashley Moran
Hi Hope this isn't OT. I'm currently contemplating using the Dojo[1] JavaScript framework, and I suspect it's powerful enough that using Cucumber features and Celerity alone will quickly leave me wanting lower-level unit specs for the JS. So I just wondered if anyone here has used Screw.

Re: [rspec-users] How to spec accessing a constant

2008-10-16 Thread Craig Demyanovich
Cool. Having seen something a little more concrete, I like your design decisions. In this case, I'd go with Scott's recommendation of hiding the constant behind a method. Regards, Craig ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyfo

Re: [rspec-users] specifying a controller's layout

2008-10-16 Thread Rahoul Baruah
On 16 Oct 2008, at 16:02, Stephen Eley wrote: This confused me too at first. To put it another way: (1) controller.expect_render(:layout => 'index') [set expectation] (2) get :index [perform action] ...is equivalent to... (1) Call spouse to say "Honey, I'm coming home, see you shortly."

Re: [rspec-users] How to spec accessing a constant

2008-10-16 Thread Nick Hoffman
On 2008-10-15, at 21:59, Craig Demyanovich wrote: Since class A is coupled to class B, the specs for A are also coupled to class B through class A. Thus, I wouldn't worry about the coupling. Why does a method of class A directly access a constant of class B? Does the constant belong in class

Re: [rspec-users] specifying a controller's layout

2008-10-16 Thread Stephen Eley
On Thu, Oct 16, 2008 at 9:49 AM, Jim Gay <[EMAIL PROTECTED]> wrote: > > Because you are creating an expectation for the following action. > In your code above, you are doing the action, and then creating an > expectation for a following action which never occurs, so it receives it 0 > times followi

Re: [rspec-users] Any good conferences this year about ruby/rspec/watir?

2008-10-16 Thread Jarkko Laine
On 16.10.2008, at 16.17, juuuser wrote: Hello. Sorry for this little offtopic question, but I was wondering if anyone happens to know if there's any good conferences coming up about rspec or ruby or watir in this year where I could attend to? Since you seem to be fluent in Finnish: http://r

Re: [rspec-users] specifying a controller's layout

2008-10-16 Thread Dave Phiri
Jim Gay wrote: > On Oct 16, 2008, at 7:59 AM, Dave Phiri wrote: > >> >> David: >> Why is it that >> >> get :some_action >> controller.expect_render(:layout => 'special_layout') >> >> ie having the get statement before the controller.expect.. statement >> produces the ff error: >> Mock 'expect_rend

Re: [rspec-users] specifying a controller's layout

2008-10-16 Thread Jim Gay
On Oct 16, 2008, at 7:59 AM, Dave Phiri wrote: David Chelimsky wrote: On Thu, Sep 4, 2008 at 8:42 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: I want to spec that a controller uses a particular layout how do I do that? Depends on what else is going on, but this is the simplest situation: co

[rspec-users] Any good conferences this year about ruby/rspec/watir?

2008-10-16 Thread juuuser
Hello. Sorry for this little offtopic question, but I was wondering if anyone happens to know if there's any good conferences coming up about rspec or ruby or watir in this year where I could attend to? Or any good website where such things are listed or something similar. All suggested confere

[rspec-users] Mocking documentation

2008-10-16 Thread Mark Thomson
Can I make a suggestion for the RSpec documentation? In the discussion of Spec::Mocks (http://rspec.info/documentation/mocks/), it would be helpful for there to be some explanation of mock_model. There's a reference to mock_model in an example in the section on controller specs, but as far I ca

Re: [rspec-users] specifying a controller's layout

2008-10-16 Thread Dave Phiri
David Chelimsky wrote: > On Thu, Sep 4, 2008 at 8:42 AM, Matt Wynne <[EMAIL PROTECTED]> wrote: >> I want to spec that a controller uses a particular layout >> how do I do that? > > Depends on what else is going on, but this is the simplest situation: > > controller.expect_render(:layout => 'spe

[rspec-users] Rails: View specs and implicit parameters in link_to()

2008-10-16 Thread Matt Wynne
Hi all, I've been cleaning up our routing file, and removed the default map.connect ":controller/:action" route. It's thrown up a bunch of sloppy mistakes, which is great, but I also think I've found a problem with the view specs. We have a generic navbar partial which is rendered in the