[rspec-users] [ANN] assert2/xhtml specifies your HTML by example

2009-03-16 Thread Phlip
Rubies: assert_xhtml now works with RSpec. (Call it ".should be_html_with{}" !) This is its Rails functional test aspect: get :edit_user, :id => users(:Moses).id scope = self assert_xhtml do form :action => '/users' do fieldset do legend 'Personal Informat

[rspec-users] Testing return value of a block argument

2009-03-16 Thread Yun Huang Yong
Hi, I'm using Log4r and one of its neat features is its handling of blocks such that you can do: log.debug { "Something bad happened" + some_expensive_method() } instead of: log.debug("Something bad happened" + some_expensive_method()) The benefit of the former is that some_expensive_metho

[rspec-users] 'Missing template' when using send_data to render response

2009-03-16 Thread Chris Mear
Hi there, Just upgraded to Rails 2.3/RSpec 1.2.0, and I've got a controller that uses send_data to render a response. In the controller spec, I have: controller.should_receive(:send_data).with(...) The send_data method calls 'render' internally, but obviously when I stub/mock out the send_data me

Re: [rspec-users] 'Missing template' when using send_data to render response

2009-03-16 Thread David Chelimsky
2009/3/16 Chris Mear : > Hi there, > Just upgraded to Rails 2.3/RSpec 1.2.0, and I've got a controller that uses > send_data to render a response. In the controller spec, I have: > controller.should_receive(:send_data).with(...) > The send_data method calls 'render' internally, but obviously when I

Re: [rspec-users] 'Missing template' when using send_data to render response

2009-03-16 Thread Chris Mear
On 16 Mar 2009, at 13:28, David Chelimsky wrote: 2009/3/16 Chris Mear : Hi there, Just upgraded to Rails 2.3/RSpec 1.2.0, and I've got a controller that uses send_data to render a response. In the controller spec, I have: controller.should_receive(:send_data).with(...) The send_data method c

Re: [rspec-users] 'Missing template' when using send_data to render response

2009-03-16 Thread Chris Mear
2009/3/16 David Chelimsky > 2009/3/16 Chris Mear : > > Hi there, > > Just upgraded to Rails 2.3/RSpec 1.2.0, and I've got a controller that > uses > > send_data to render a response. In the controller spec, I have: > > controller.should_receive(:send_data).with(...) > > The send_data method calls

Re: [rspec-users] Testing return value of a block argument

2009-03-16 Thread Nick Hoffman
On Mon, Mar 16, 2009 at 7:00 AM, Yun Huang Yong wrote: > Hi, > > I'm using Log4r and one of its neat features is its handling of blocks such > that you can do: >  log.debug { "Something bad happened" + some_expensive_method() } > instead of: >  log.debug("Something bad happened" + some_expensive_m

[rspec-users] Rails 2.3.2 and Cucumber 0.1.16

2009-03-16 Thread James Byrne
I am encountering a problem relating to cucumber and Rails 2.3.2 which has something to do with Rails 2.3.2 but I am unable, as of yet, to determine exactly what is the cause. Situation: environment.rb RAILS_GEM_VERSION = '2.3.2' $ cucumber -r features \ features/components/authentication/aut

Re: [rspec-users] Rails 2.3.2 and Cucumber 0.1.16

2009-03-16 Thread James Byrne
James Byrne wrote: > > Now, when I start the script/server and go to the project root then I > get no errors from either R2.2.2 or R2.3.2. I am guessing that > something in R2.3.2 is changing the pwd from RAILS_ROOT for the feature > steps/tests only, since the file specified in the render state

Re: [rspec-users] Testing return value of a block argument

2009-03-16 Thread Mark Wilden
On Mon, Mar 16, 2009 at 8:33 AM, Nick Hoffman wrote: >> >> Is there any way to test what the resultant log message is from evaluating >> the block? >> >> i.e. something like: >>  log_mock.should_receive(:debug) { |log_block| >>    # execute log_block, and check its return value >>  } > > Hi Yun. H

Re: [rspec-users] Rails 2.3.2 and Cucumber 0.1.16

2009-03-16 Thread James Byrne
It is starting to look like this is a webrat problem. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Testing return value of a block argument

2009-03-16 Thread Matt Wynne
On 16 Mar 2009, at 11:00, Yun Huang Yong wrote: I'm using Log4r You might want to check out this library, which seems to be better maintained these days: http://github.com/TwP/logging/tree/master Matt Wynne http://blog.mattwynne.net http://www.songkick.com __

[rspec-users] Is there any way to use a second webrat session temporarily?

2009-03-16 Thread Erik Pukinskis
Dear Rspecucumberatubyists, I have a Rails app that creates subdomains, and I'd like to verify them in a cucumber feature like so: When I visit http://blingo.myapp.com Then I should see "Welcome to blingo!" The trouble is, webrat's visit method strips the domain off, and keeps only the path,

[rspec-users] respond_to matcher

2009-03-16 Thread Scott Taylor
I noticed this strange behaviour in a spec, and was wondering if it was considered a bug (it certainly took me by surprise): http://gist.github.com/80261 The respond_to matcher specs seem to show this behaviour as intended: http://gist.github.com/80262 Scott __

[rspec-users] Route failure with Rails2.3 and rspec1.2

2009-03-16 Thread Peer Allan
Hello all, I have a spec for a route that used to pass under Rails 2.2.2 and rspec 1.1.12, but can¹t figure out what is wrong since I updated. Here is the assertion: route_for( { :controller => 'purchase_orders', :action => 'update', :comp

Re: [rspec-users] Route failure with Rails2.3 and rspec1.2

2009-03-16 Thread David Chelimsky
On Mon, Mar 16, 2009 at 9:22 PM, Peer Allan wrote: > Hello all, > > I have a spec for a route that used to pass under Rails 2.2.2 and rspec > 1.1.12, but can¹t figure out what is wrong since I updated. Here is the > assertion: > > route_for( >        { >          :controller         => 'purchase_o

[rspec-users] cucumber, watir and new window

2009-03-16 Thread aa aa
Hi, I'm using cucumber and watir and when I want to test i'm on the right page, I use browser.url.should =~ "blah" but how do i test that if the code opens a new window properly? The browser.url is still, correctly, set to the original page url. -- Posted via http://www.ruby-forum.com/. _