Re: [rspec-users] Testing helpers that accept a block

2009-04-08 Thread Brandon Olivares
Hi, Oh, I should have thought of that. Thanks a lot. I'm growing used to the assert_xhtml syntax, lol, so I've just been using that. Thank you though for fixing the be_html_with syntax. Brandon > -Original Message- > From: rspec-users-boun...@rubyforge.org [mailto:rspec-users- > boun...

Re: [rspec-users] Testing helpers that accept a block

2009-04-08 Thread Phlip
assert_xhtml output do div.error do p 'Block' end end Nokogiri has some "easter eggs" in its ambitious HTML::Builder system. One of them is only HTML tags not already recognized as methods can get turned into HTML tags. The usual .method_missing(

Re: [rspec-users] Testing helpers that accept a block

2009-04-08 Thread Brandon Olivares
Hi, Well, I googled some more, and everything I could find used eval_erb. So is this the best method for testing helpers with blocks? And then why is that block displaying when I run the test? Thanks, Brandon > -Original Message- > From: Brandon Olivares [mailto:programmer2...@gmail.com

Re: [rspec-users] rspec_on_rails_on_crack not being loaded properly

2009-04-08 Thread David Chelimsky
On Wed, Apr 8, 2009 at 9:22 PM, danielpennypacker wrote: > > So me and the senior dev solved the problem. We tried a number of things, so > I'm not sure if my original question is that relevant, but here's what was > kinda going on... > > -This is my first time integrating lots of plugins from ano

Re: [rspec-users] rspec_on_rails_on_crack not being loaded properly

2009-04-08 Thread danielpennypacker
So me and the senior dev solved the problem. We tried a number of things, so I'm not sure if my original question is that relevant, but here's what was kinda going on... -This is my first time integrating lots of plugins from another app, so I was going in between installing gems as gems and inst

Re: [rspec-users] Web-based story runner?

2009-04-08 Thread Nigel Thorne
I'm starting one of these too... I'll github it when I'm happy with my approach. 2009/4/8 Ben Mabey > David Chelimsky wrote: > >> On Tue, Apr 7, 2009 at 3:26 PM, Sophie (itsme213) >> wrote: >> >> >>> Some time ago I had come across a web-based story editor for scenarios. >>> I'm >>> not sure if

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] [Rspec] Trying to get rspec to test a controller in a namespace

2009-04-08 Thread Zach Dennis
On Wed, Apr 8, 2009 at 5:18 PM, TimBooher wrote: > any takers? am i asking a question that is too hard or too easy and > boring? So your SponsorsController exists inside of a Admin module namespace? If so update your spec: describe Admin::SponsorsController If that's not the issue I'm not q

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

2009-04-08 Thread TimBooher
any takers? am i asking a question that is too hard or too easy and boring? thanks, tim On Apr 7, 7:41 am, Tim Booher wrote: > I am trying to get my workflow down and am confused on several fronts. The > first is how to get my rspec_scaffold tests to run. The problem is that i > generated my sc

Re: [rspec-users] Reuse of Cucumber Features

2009-04-08 Thread Williams, Wesley
All, I know this is an older post but I have a similar but different set of scenarios I need to handle. I have a set of flight related scheduling features, such as delay, reschedule, and cancel, each with multiple scenarios that have an effect on later flights in the schedule (there are a lot

Re: [rspec-users] updated to latest gems, rspec not catching flash.now

2009-04-08 Thread Zach Dennis
On Wed, Apr 8, 2009 at 2:08 PM, doug livesey wrote: > Hi, after an update to all the latest gems, I have a controller spec failing > that wasn't previously: >    flash[:alert].should eql( "Blah blah." ) > > The flash is being set by "flash.now[:alert] = '...'" in this instance. > Can anyone sugges

Re: [rspec-users] debuggin cucmber script in ruby

2009-04-08 Thread Matt Wynne
On 7 Apr 2009, at 17:23, Scott Taylor wrote: On Apr 7, 2009, at 11:54 AM, Ben Mabey wrote: On Apr 7, 2009, at 8:30 AM, aidy lewis wrote: On 07/04/2009, Zach Dennis wrote: On Mon, Apr 6, 2009 at 12:21 PM, Ben Mabey wrote: My best suggestion would be to set multiple breakpoints and h

Re: [rspec-users] Pending expectations

2009-04-08 Thread David Chelimsky
On Wed, Apr 8, 2009 at 12:07 PM, Sven wrote: >> In general, I write before() >> after I write the examples, since I usually consider it just a DRY >> refactoring. > > Good point. I guess I'll just get used to it then :-) No, please don't get used to it. The behaviour you expect is correct, and th

Re: [rspec-users] superclass mismatch for class ModelExampleGroup (TypeError)

2009-04-08 Thread Andrew Zielinski
Thanks David, It seems like remarkable was the culprit. Somebody had posted the same issue to lighthouse. The solution was to specify the lib in environment.rb instead of setting it to false for rspec and rspec-rails. The discussion was in Portuguese so I'm not sure why this works. I don't get

Re: [rspec-users] RSpec-Rails 1.2.2 and Controllers without views - what to do?

2009-04-08 Thread doug livesey
Hi. Bira -- just got the same problem myself, and have found that (whilst not a perfect solution) that stubbing out render on the controller in my before block solves it. controller.stub!( :render ) HTH, Doug. 2009/4/1 Bira > I'm trying to upgrade to RSpec 1.2.2 in a Rails app, and reading >

[rspec-users] updated to latest gems, rspec not catching flash.now

2009-04-08 Thread doug livesey
Hi, after an update to all the latest gems, I have a controller spec failing that wasn't previously: flash[:alert].should eql( "Blah blah." )** The flash is being set by "flash.now[:alert] = '...'" in this instance. Can anyone suggest how I can make this work again? Cheers, Doug. ___

Re: [rspec-users] rspec_on_rails_on_crack not being loaded properly

2009-04-08 Thread danielpennypacker
Oops, sotty about that, I got my version of ruby mixed in there. They're both 1.1.8 I followed the instructions here: http://wiki.github.com/dchelimsky/rspec/rails David Chelimsky-2 wrote: > > On Tue, Apr 7, 2009 at 6:55 PM, danielpennypacker > wrote: >> >> We're using Rails 2.1.1 and rspec/

Re: [rspec-users] possible to stub params hash ?

2009-04-08 Thread Scott Taylor
On Apr 8, 2009, at 11:09 AM, Andrea Jahn wrote: Hi, I added one line in my controller to extend the params hash. But now I get errors in my controller spec. Controller def update @pl_planning = PlPlanning.find(params[:id]) # the item model version (select box) depends on other

Re: [rspec-users] Pending expectations

2009-04-08 Thread David Chelimsky
On Wed, Apr 8, 2009 at 6:11 AM, Sven wrote: > I've noticed that pending expectations fail if the before(:each) code is not > implemented yet. In other words, taking the example code from Peepcode's rspec > series: > > describe Weather, ".fetch for zipcode" do > >  before(:each) do >   �...@weather

[rspec-users] possible to stub params hash ?

2009-04-08 Thread Andrea Jahn
Hi, I added one line in my controller to extend the params hash. But now I get errors in my controller spec. Controller def update @pl_planning = PlPlanning.find(params[:id]) # the item model version (select box) depends on other select boxes and can be empty # then it is not in the

Re: [rspec-users] Pending expectations

2009-04-08 Thread Sven
> In general, I write before() > after I write the examples, since I usually consider it just a DRY > refactoring. Good point. I guess I'll just get used to it then :-) ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/

Re: [rspec-users] Pending expectations

2009-04-08 Thread David Chelimsky
On Wed, Apr 8, 2009 at 11:59 AM, Mark Wilden wrote: > On Wed, Apr 8, 2009 at 2:11 AM, Sven wrote: > >> describe Weather, ".fetch for zipcode" do >> >>  before(:each) do >>   �...@weather = Weather.fetch_for_zipcode(98117) >>  end >> >>  it "should populate zipcode" >> >>  it "should populate temp

Re: [rspec-users] Pending expectations

2009-04-08 Thread Mark Wilden
On Wed, Apr 8, 2009 at 2:11 AM, Sven wrote: > describe Weather, ".fetch for zipcode" do > >  before(:each) do >   �...@weather = Weather.fetch_for_zipcode(98117) >  end > >  it "should populate zipcode" > >  it "should populate temperature units" > >  it "should populate recorded at" > > end > >

[rspec-users] Testing helpers that accept a block

2009-04-08 Thread Brandon Olivares
Hi, I am trying to write and test a helper that accepts a block. Right now it goes something like this: module ContactHelper # Wraps a field with div.error if it has an error. def wrap_error_field errors, &block field = capture &block if errors.empty? concat field else

[rspec-users] Pending expectations

2009-04-08 Thread Sven
I've noticed that pending expectations fail if the before(:each) code is not implemented yet. In other words, taking the example code from Peepcode's rspec series: describe Weather, ".fetch for zipcode" do before(:each) do @weather = Weather.fetch_for_zipcode(98117) end it "should popu

Re: [rspec-users] [Cucumber] Welcome Ben Mabey to the official Cucumber team

2009-04-08 Thread Matt Wynne
On 7 Apr 2009, at 22:19, aslak hellesoy wrote: Ben Mabey has accepted my invitation to be on the core Cucumber team. Ben has been a long time contributor to Cucumber's ecosystem and knows it inside out. Here is a quote from IRC today: mabes: Yeah but you're the cucumber God. The core Cuc

Re: [rspec-users] [Cucumber] Welcome Ben Mabey to the official Cucumber team

2009-04-08 Thread Joseph Wilk
aslak hellesoy wrote: Ben Mabey has accepted my invitation to be on the core Cucumber team. Ben has been a long time contributor to Cucumber's ecosystem and knows it inside out. Here is a quote from IRC today: mabes: Yeah but you're the cucumber God. The core Cucumber team now consists of J