Re: [rspec-users] why should_receive failure?

2009-07-14 Thread Jim Gay
escribe PeepCode, "awesome" do it "should call the totally_rad method" do peep = PeepCode.new peep.should_receive(:totally_rad).and_return(...whatever...) peep.awesome end it "should return the string 'righteous'" do PeepCode.new.awesome.should == &

Re: [rspec-users] [Rspec] Trying to get rspec to test a controller in a namespace

2009-04-08 Thread Jim Gay
Hey Tim, I didn't see the first post. If you've namespaced the controller, you'll need to make that change in the spec. My assumption is that SponsorsController became Admin::SponsorsController So you'll need to make sure that this is reflected in your spec. -Jim On Apr 8, 2009, at 5:18 PM,

Re: [rspec-users] Mocking / stubbing errors for ActiveRecord

2009-02-19 Thread Jim Gay
On Feb 19, 2009, at 3:54 PM, Martin wrote: Hi, I'm trying to test my views using rspec. I want to test my edit- and new-view also for the case an error occurs (something like "title can't be blank" and so on). Can someone point me please to an example where I can see how to mock my mode

Re: [rspec-users] validate_presence_of

2009-02-18 Thread Jim Gay
On Feb 18, 2009, at 7:39 PM, Fernando Perez wrote: Yi Wen wrote: Hello, according to this post: http://blog.davidchelimsky.net/2009/1/13/rspec-1-1-12-is-released I should be able to write: describe User do it {should valdate_presence_of(:login)} end What's the point in testing validates_

Re: [rspec-users] [RSpec] matcher for href

2009-01-19 Thread Jim Gay
On Jan 19, 2009, at 2:11 PM, James Byrne wrote: Of the several ways available to test for this, what would be the preferred way to see if the following is present in an html document WITHOUT actually following the link? response.should have_tag('a[href=?]','/users/new') I tried this: res

Re: [rspec-users] Rails project as a template for other projects (off topic)

2008-12-04 Thread Jim Gay
On Dec 4, 2008, at 1:34 PM, Andrew Premdas wrote: This is of topic but I have a feeling I might get some useful advice here - hope you don't mind I've created a rails project that I want to use as a basis for other rails project. I was wondering if anyone had any tips on workflow for doi

Re: [rspec-users] Using Cucumber with latest Webrat

2008-12-02 Thread Jim Gay
On Dec 2, 2008, at 10:42 AM, aslak hellesoy wrote: On Tue, Dec 2, 2008 at 4:25 PM, Stephen Veit <[EMAIL PROTECTED]> wrote: I added cucumber to my rails project using the following commands: git submodule add git://github.com/aslakhellesoy/cucumber.git \ vendor/plugins/cucumber ruby script/gen

Re: [rspec-users] restful_auth and good rspec examples (was: Caboosers drop RSpec)

2008-11-04 Thread Jim Gay
On Nov 4, 2008, at 3:01 PM, Ben Mabey wrote: Fernando Perez wrote: As a starter, can someone tell me if the specs defined in restful_authentication are clever? Can I learn from them? Please don't look at restful_auth as an example on how to use rspec examples and/or the story runner. T

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

Re: [rspec-users] What are we spec'ing?

2008-08-24 Thread Jim Gay
On Aug 24, 2008, at 10:39 AM, Muhammad Ichsan wrote: Dear All, I'm a new member here. I've been using RSpec since my first Rails project. I'm proud that I've deliver the most bugs free app in my office (In my country, spec'ing even autotesting is not common). Thanks to Ruby community that make

Re: [rspec-users] Spec Server on Windows - missing fork

2008-08-05 Thread Jim Gay
On Aug 6, 2008, at 12:04 AM, David Chelimsky wrote: On Sat, Aug 2, 2008 at 3:43 PM, Luis Lavena <[EMAIL PROTECTED]> wrote: On Sat, Aug 2, 2008 at 9:04 PM, Mark Wilden <[EMAIL PROTECTED]> wrote: spec_server is one of the hidden gems of the RSpec world. It's not completely a slam-dunk to use,

Re: [rspec-users] Should(not?) test associations (was: Dealing with dependent data)

2008-06-28 Thread Jim Gay
On Jun 28, 2008, at 5:32 AM, David Chelimsky wrote: I'm beginning to regret the validity example, because it is somewhat structural as well. The behaviour is not whether it's valid or not, but rather whether you can save it or not. So scratch the example I gave earlier and think about this:

Re: [rspec-users] Should(not?) test associations (was: Dealing with dependent data)

2008-06-27 Thread Jim Gay
On Jun 27, 2008, at 10:07 PM, David Chelimsky wrote: An association does not want you to know that it's an association. It wants you to think of it as any other attribute. Why do you care what it IS? Focus on what it DOES. Good point. Being a newbie I sometimes find myself where I *think* I'

Re: [rspec-users] Dealing with dependent data

2008-06-27 Thread Jim Gay
http://www.lindsaar.net/2008/6/24/tip-24-being-clever-in-specs-is-for-dummies That post is fantastic. Thanks! Couldn't agree more with that post... For instance, restful_authentication now comes with specs, but, ehrm... See for yourself: http://pastie.org/222670 haha. I have no idea wha