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

2008-03-14 Thread Pat Maddox
On the other hand, earlier today my pair and I had to override a find_by_param method. We quickly wrote it down: def find_by_param(val) find_by_id val end We were puzzled, then saw that it should be User.find_by_param. Who'da thunk. Pat On Thu, Mar 13, 2008 at 10:42 PM, __iso __ [EMAIL

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 but not in

[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

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],

[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

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:

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] 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] 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] mailto:[EMAIL PROTECTED] wrote: I'm trying to specify

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.

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 yet):

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]: And

[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:

[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

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 time,

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

[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

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

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 able to

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 that looked

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