Re: [rspec-users] Am I off track on my testing?

2008-03-14 Thread __iso __
Zach Dennis wrote: > Can someone change this implementation and still have your tests pass, > but have the implementation be broken? If they can then yes it is > worth the 40 lines. It is partly this paranoia of someone changing the code that makes me question testing of this magnitude. Other t

Re: [rspec-users] Disabling a set of tests?

2008-03-14 Thread Scott Taylor
On Mar 14, 2008, at 1:46 PM, Will Sargent wrote: > Hi all, > > Part of the integration test suite involves running against a sandbox > on Paypal's server. > > Lately that server's been acting flakely. It doesn't fail all the > time, but enough to confuse people. > > I made pending some tests tha

Re: [rspec-users] Am I off track on my testing?

2008-03-14 Thread Zach Dennis
On Fri, Mar 14, 2008 at 2:08 PM, __iso __ <[EMAIL PROTECTED]> wrote: > Zach Dennis wrote: > > When I write software for myself I tend to flip flop. Sometimes I am > > writing things to learn or play and I don't test. > > I did that on a recent small project and I was amazed at how fast I was >

Re: [rspec-users] Am I off track on my testing?

2008-03-14 Thread Matthijs Langenberg
I really agree with the topic starter. I've always done the rspec testing with all layers in isolation, a bit like the first example. Now for my latest project I went a bit for a more TDD approach, sending a request to a controller and testing the full stack, including the dynamic bits of the layou

[rspec-users] Branching scenarios, GivenScenario and database

2008-03-14 Thread Rick DeNatale
I'm trying to use stories to drive some high-level design. I've got some branching scenarios where I want to follow a scenario, to establish a base situation, and then have different scenarios which 'branch' out from that state, possibly several levels deep. I asked a bit about this a few days a

Re: [rspec-users] Am I off track on my testing?

2008-03-14 Thread __iso __
Zach Dennis wrote: > When I write software for myself I tend to flip flop. Sometimes I am > writing things to learn or play and I don't test. I did that on a recent small project and I was amazed at how fast I was able to get things done. > Here's another perspective to look at it from. When you

Re: [rspec-users] Disabling a set of tests?

2008-03-14 Thread Zach Dennis
At the top of the file put... __END__ Zach On Fri, Mar 14, 2008 at 1:46 PM, Will Sargent <[EMAIL PROTECTED]> wrote: > Hi all, > > Part of the integration test suite involves running against a sandbox > on Paypal's server. > > Lately that server's been acting flakely. It doesn't fail all the

[rspec-users] Disabling a set of tests?

2008-03-14 Thread Will Sargent
Hi all, Part of the integration test suite involves running against a sandbox on Paypal's server. Lately that server's been acting flakely. It doesn't fail all the time, but enough to confuse people. I made pending some tests that looked like they were repeat offenders, but now I'm seeing the s

Re: [rspec-users] tutes on testing controllers

2008-03-14 Thread Oliver Barnes
I got the spec and controller minimally working now, here's the code paste for both in full. http://pastie.caboo.se/165743 still working on it, any suggestions on possible improvements would be greatly appreciated. 2008/3/14, Oliver Barnes <[EMAIL PROTECTED]>: > thanks, will do - I am still wrap

Re: [rspec-users] tutes on testing controllers

2008-03-14 Thread Oliver Barnes
should have posted the code, sorry about that :) http://pastie.caboo.se/165708 I was actually posting to :create, but hadn't added do_post() to the example :P adding it solved this specific problem, thanks. hope the pastie helps another newb out 2008/3/13, Shane Mingins <[EMAIL PROTECTED]>: > A

Re: [rspec-users] tutes on testing controllers

2008-03-14 Thread Oliver Barnes
thanks, will do - I am still wrapping my mind around mocks and stubs indeed :) 2008/3/13, Pat Maddox <[EMAIL PROTECTED]>: > On Thu, Mar 13, 2008 at 4:55 PM, Oliver Barnes > > <[EMAIL PROTECTED]> wrote: > > > I see. I had gotten to trying the first way you suggested (haven't > > tried the second

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

2008-03-14 Thread Jonathan Linowes
seems like it'd make sense to just add this to http://code.google.com/ p/rspec-on-rails-matchers/ linoj On Mar 14, 2008, at 8:48 AM, Brandon Keepers wrote: Zach, On 3/14/08, Zach Moazeni <[EMAIL PROTECTED]> wrote: This hints at another extension I've wanted to write for us for a while. C

[rspec-users] Adding before / after blocks to every spec

2008-03-14 Thread Steve Tooke
Folks, I was wondering if someone would be able to help me out with a quandry. I'm trying to write an rspec plugin module for merb that will run all specs within an ActiveRecord (initially) database transaction - to give functionality similar to rails transactional fixtures. Here is the module:

Re: [rspec-users] Am I off track on my testing?

2008-03-14 Thread Zach Dennis
> Is it just me or does anyone else miss being able to create something > quickly. When I write customer paid for software I strive to apply the best practices to ensure they have high quality, low bug software which is well-factored with the goal that it is easier to maintain and extend over its

Re: [rspec-users] Multiple should_receive(:render).with

2008-03-14 Thread Alan Larkin
Corey Haines wrote: > Stub out the first one, something like > > template.stub!(:render) > > Then, each of your tests set the actual should_receive expectation. > > -Corey > > On Fri, Mar 14, 2008 at 8:44 AM, Alan Larkin <[EMAIL PROTECTED] > > wrote: > > I'm tryi

Re: [rspec-users] Multiple should_receive(:render).with

2008-03-14 Thread Corey Haines
Stub out the first one, something like template.stub!(:render) Then, each of your tests set the actual should_receive expectation. -Corey On Fri, Mar 14, 2008 at 8:44 AM, Alan Larkin <[EMAIL PROTECTED]> wrote: > I'm trying to specify that a particular view must render two different > partials.

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

2008-03-14 Thread Zach Dennis
My pair and I have written a bunch of these helpers. I'll post what we have later, perhaps it will be a starting point, Zach On Fri, Mar 14, 2008 at 8:20 AM, Zach Moazeni <[EMAIL PROTECTED]> wrote: > This hints at another extension I've wanted to write for us for a while. > > Common html selector

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

2008-03-14 Thread Brandon Keepers
Zach, On 3/14/08, Zach Moazeni <[EMAIL PROTECTED]> wrote: > > This hints at another extension I've wanted to write for us for a while. > Common html selector strings, Labels, input fields, textareas, forms, > links, etc > > Really just rolling up something like: > > response.shouldhave_tag("input[

[rspec-users] Multiple should_receive(:render).with

2008-03-14 Thread Alan Larkin
I'm trying to specify that a particular view must render two different partials. My spec looks like: describe AClass do it do template.should_receive(:render).with(:partial => 'foo', :locals => { ... }) ... end describe 'some conditional case' do it do template.s

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

2008-03-14 Thread Zach Moazeni
This hints at another extension I've wanted to write for us for a while. Common html selector strings, Labels, input fields, textareas, forms, links, etc Really just rolling up something like: response.should have_tag("input[type=text][name=?][value=?][id=company- name]", "user[company_name

Re: [rspec-users] Story testing views in isolation

2008-03-14 Thread Corey Haines
Thanks, everyone, for the thoughts. After thinking about it further and reflecting on all the thoughts, I think it definitely is more of a square peg - round hole situation. Luckily, my designer is well able to handle building view specs for the prototypes that he is building. We then are going to

[rspec-users] `const_missing': uninitialized constant Spec::Rails

2008-03-14 Thread Dmitry Vanidovsky
Hi! I'm experiencing such error while running simple model rspec just to make sure everything is working. $ script/spec spec/models/site_user_spec.rb /var/lib/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:100:in `const_missing': uninitialized constant Spec::Rails (NameError

Re: [rspec-users] Lib Specs and config.use_transactional_fixtures = true

2008-03-14 Thread David Chelimsky
On Fri, Mar 14, 2008 at 1:31 AM, Shane Mingins <[EMAIL PROTECTED]> wrote: > Hi > > We have specs in our rails project other than model/view/controller .. > we have interests and lib ... > > using use_transactional_fixtures = true seems fine in a spec in the m/ > v/c and interests directories bu