Re: [rspec-users] Do you still Write Tests First on code that is churning hard?

2010-02-19 Thread Courtenay
Testing should answer this question for you, regularly: How do you know it works? Courtenay On Fri, Feb 19, 2010 at 12:59 AM, Erik Pukinskis wrote: > Hello Specmeisters! > > I have a bit of a philosophical question for the TDD witches and > wizards out there.  I'm working

Re: [rspec-users] Stubbing through multiple layers

2010-01-10 Thread Courtenay
On Sat, Jan 9, 2010 at 7:38 PM, Sean DeNigris wrote: >>   window = stub('window', :title => "programming_ruby_1.9.pdf") >>   preview = stub('preview', :front_window => window) > Perfect - so easy!  Thanks. > There's also stub_chain, which is probably a Bad Thing but helps break through layers of

Re: [rspec-users] Caboosers drop RSpec

2008-11-05 Thread Courtenay
On Wed, Nov 5, 2008 at 2:58 AM, Alex Satrapa <[EMAIL PROTECTED]> wrote: > On 05/11/2008, at 01:37 , Steven Baker wrote: > >> Big difference between "haven't been able to" and "wouldn't learn the >> tools". Ashley's post below sums it up best. This is a problem that's seen >> regularly when workin

Re: [rspec-users] jumping authentication spec

2008-07-01 Thread Courtenay
On Tue, Jul 1, 2008 at 11:08 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Jul 1, 2008, at 12:59 PM, marcio <[EMAIL PROTECTED]> wrote: > >> hi everyone! i ve been working in my new rspec scaffold generator. >> I have made all the neccesary specs over all controllers and models. >> I am worki

Re: [rspec-users] spec'ing validates_uniqueness_of :whatever

2008-04-03 Thread Courtenay
On Thu, Apr 3, 2008 at 4:38 AM, Juanma Cervera <[EMAIL PROTECTED]> wrote: > Thanks to all for your answers. > I also have found a plugin with matchers for active record validations, > associations and even useful matchers for views. > > It has a matcher for validates_uniqueness_of that doesn't g

Re: [rspec-users] spec'ing validates_uniqueness_of :whatever

2008-04-02 Thread Courtenay
IMO this function should be tested using the database, since it relies heavily on the data. Courtenay @(o..O)@ On Apr 2, 2008, at 1:13 AM, Juanma Cervera <[EMAIL PROTECTED]> wrote: > Hello > > I am learning rspec and trying to especify the activerecord > v

Re: [rspec-users] Order of the get call and xxx.should

2008-01-30 Thread Courtenay
ething happened, which didn't exist before the call was run. Whereas the latter is stubbing the method as well as raising if it doesn't. Courtenay ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Stubbing out required associated models

2007-11-15 Thread Courtenay
of course, you do both. you need to unit test in isolation, as well as integration test the stack. On Nov 15, 2007 5:44 AM, Matthew Lins <[EMAIL PROTECTED]> wrote: > But, that should be okay, since my intent is not to test the associated > models. I have a separate spec file for those models. > >

Re: [rspec-users] Plain Text Stories Chaining Scenarios

2007-11-14 Thread Courtenay
Reads like haiku :p On Nov 14, 2007, at 7:01 PM, Nathan Sutton <[EMAIL PROTECTED]> wrote: > I'm writing a plain text story (testing the waters) and I have > scenarios that I need to chain in my specs. > > Here is what I have so far: > > Story: User purchasing tshirts > As a user > I want to

Re: [rspec-users] Testing arbitrary SQL

2007-08-27 Thread Courtenay
You create the records. @bah = Bah.create! [1, 5, 22, 16].each { |amount| Foo.create! :amount => amount, :bah => @bah } @bah.foos.should == 44 On 8/27/07, Rodrigo Alvarez Fernández <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to know how would you test a method in a model that uses >

Re: [rspec-users] controller spec with model that validates_uniqueness

2007-08-23 Thread Courtenay
Does this work? Image.stub!(:validates_uniqueness_of).and_return(true) On 8/23/07, s.ross <[EMAIL PROTECTED]> wrote: > I want to use mocks and stubs to test the controller, but am having > trouble getting my validation not to trigger. Here's the code: > > # spec: > > Image.stub!(:find).a

Re: [rspec-users] describing a mock_model as being an instance

2007-08-19 Thread Courtenay
On 8/19/07, Edward Ocampo-Gooding <[EMAIL PROTECTED]> wrote: > David Chelimsky wrote: > > On 8/19/07, Edward Ocampo-Gooding <[EMAIL PROTECTED]> wrote: > >> Is there a built-in way of describing a mock_model as being an instance, > >> beyond > >> stubbing the eval("Object.methods - Object.new.metho

Re: [rspec-users] should_receive, used in the wrong place?

2007-08-17 Thread Courtenay
; it's more convenient.. > > On 8/17/07, Courtenay <[EMAIL PROTECTED]> wrote: > > What do you guys think of this: if someone calls should_receive > > outside of an "it" block, it warns you. > > > > before(:each) do > > @foo = Foo.new >

[rspec-users] should_receive, used in the wrong place?

2007-08-17 Thread Courtenay
s correct when setting up objects. Opinions? courtenay ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] ActsAsList specs

2007-08-15 Thread Courtenay
On 8/15/07, Steve Tooke <[EMAIL PROTECTED]> wrote: > Hi, > > How are people specifying models which act_as_list? > > I'm thinking that it would be possible to check that acts_as_list > instance methods have been added to a class using something like this: You're specing the code not the behavior.

Re: [rspec-users] nuby: how spec redirect_to at ApplicationController

2007-08-15 Thread Courtenay
On 8/15/07, Priit Tamboom <[EMAIL PROTECTED]> wrote: > Good morning rspec people! > > Still rspec nuby: I must do something wrong obviously. > > How can I spec about redirect_to at ApplicationController > > describe ApplicationController do >it "method login_required should redirect to home pat

Re: [rspec-users] Stubbing all methods

2007-08-14 Thread Courtenay
On 8/14/07, aslak hellesoy <[EMAIL PROTECTED]> wrote: > On 8/15/07, Scott Taylor <[EMAIL PROTECTED]> wrote: > > > > Mocha's mock/stub framework has the ability to stub all methods on a > > mock given. Does RSpec's mocking framework have this ability? > You mean like :null_object => true ?? =

Re: [rspec-users] Rspec and acl_system2 plugin

2007-08-11 Thread Courtenay
_return(@current_user) > request.session[:user] = @current_user The fact that you're stubbing "find" calls in the *view* spec indicates that you're probably testing things that are out of the scope of that spec. The actual ACL system should be tested on its own, not in the context of a view. Courtenay ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Mocking Access Control

2007-07-27 Thread Courtenay
On 7/27/07, Justin Williams <[EMAIL PROTECTED]> wrote: > Thanks for the help. > You're welcome > I think I'm getting closer. I'm still not getting a redirect. I > still think it's the same reason though. I say this because when I > modify the last line of my spec to be render_template("index")

Re: [rspec-users] Mocking Access Control

2007-07-26 Thread Courtenay
u can change the implementation without screwing round with a bunch of tests. In fact neither of these would require a change of controller specs. @user.should_receive(:has_role?).with('tutor').and_return(true) Hope this helps :) Courtenay On 7/26/07, Justin Williams <[EMAIL PROTECTED]&

Re: [rspec-users] spec'ing helpers that use controller

2007-07-24 Thread Courtenay
On 7/24/07, Rick Tessner <[EMAIL PROTECTED]> wrote: > Hi, > > On Tue, 2007-24-07 at 15:26 -0700, Courtenay wrote: > > Does this work? > > > > ApplicationHelper.stub!(:controller).and_return mock('controller', > > :controller_name => 'foo&#

Re: [rspec-users] spec'ing helpers that use controller

2007-07-24 Thread Courtenay
Does this work? ApplicationHelper.stub!(:controller).and_return mock('controller', :controller_name => 'foo') On 7/24/07, Rick Tessner <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm in the process of creating rspecs for my helpers. One of the > helpers in app/helpers/application_helper.rb looks