Re: [rspec-users] Rspec2 - Absolutely brilliant! (at breaking stuff) - Is there a downgrade path ?

2010-11-30 Thread Rob Aldred
maybe just being stupid here but surely your using git or some sort of scm? stash your progress with rspec 2 in another branch then reset your current branch.. $ git reset --hard On 1 December 2010 00:13, itsterry wrote: > Just installed Rspec2 and noticed an immediate improvement in speed: >

[rspec-users] Testing html email content with have_selector rspec2 rails3 fails

2010-12-03 Thread Rob Aldred
Previously on rails 2.x I have been able to test the content of my html actionmailer emails. In rspec 1.x: @mailer = OrderMailer.create_receipt(@order) @mailer.body.should have_tag('.order_number') @mailer.body.should have_tag('.billing_address') @mailer.body.should have_tag('.delivery_address')

[rspec-users] session variable not available in global before(:each, :type => :controller)

2011-01-17 Thread Rob Aldred
expect the global before callbacks to have the same things as the ones in the individual tests but I guess maybe they are loaded before the rails environment has been initialised? Thanks -- Rob Aldred Software Developer r...@stardotstar.com twitter: stardotstar 47 Newton Street, Manchester, M1

[rspec-users] Ability to stub a method differently the second time its called

2011-01-26 Thread Rob Aldred
] end if @exam.draft? redirect_to :action => :edit else redirect_to :action => :show end I can obviously set consecutive values with and_return(true,false) but this feels a bit unreliable? maybe im just confusing myself -- Rob Aldred Software Developer r...@stardotstar.

[rspec-users] Command with -l and shared examples

2011-01-31 Thread Rob Aldred
work with dynamic tests. It does not mention shared examples but I assume internally they are setup dynamically? Is there anyway around this at all? -- Rob Aldred Software Developer r...@stardotstar.com twitter: stardotstar 47 Newton Street, Manchester, M1 1FT T: +44 (0) 161 236 9740

Re: [rspec-users] Ability to stub a method differently the second time its called

2011-01-31 Thread Rob Aldred
On 26 Jan 2011, at 15:29, David Chelimsky wrote: > On Jan 26, 2011, at 7:34 AM, Rob Aldred wrote: > >> I'm having a bit of trouble stubbing out a method on a model which has some >> quite specific behaviour. >> Basically I want to check the method returns

Re: [rspec-users] [RAILS] [rspec 2.4.0] helper spec works but rails escapes all output

2011-02-03 Thread Rob Aldred
Hi Since rails 3 all strings are escaped, unlike rails 2 where you had to use the h method use .html_safe in your helper method to stop the output escaping the test is correct This article will explain a little bit more http://markconnell.co.uk/posts/2010/02/rails-3-html-escaping -- Rob Aldred

Re: [rspec-users] How to do controller.stub(:some_method) at request test when using rspec2

2011-03-03 Thread Rob Aldred
On 3 Mar 2011, at 07:36, Jiang Guimin wrote: > Hi, > I hava a controller > > class DynamicFlowsController < ApplicationController > > def create > @workflow = Workflow.find_by_id(params[:workflow_id]) > table = @workflow.flex_table > save_u_and_node(table, @workflow.node_def

Re: [rspec-users] ruby 1.8.6

2011-08-22 Thread Rob Aldred
On 22 Aug 2011, at 14:10, Chuck Remes wrote: > On Aug 21, 2011, at 9:11 PM, David Chelimsky wrote: > >> Hey all, >> >> It's growing increasingly difficult for RSpec to support Ruby 1.8.6 as other >> libraries that rspec's development environment relies on drop support. >> Noting that 1.8.7 was

[rspec-users] Mocking expectations on I/O operations

2011-09-14 Thread Rob Aldred
I'm speccing a small lib which manipulates image files using mini_magick. The lib creates various temporary files during the process, the lib then cleans up the temporary files at the end. I'm trying to mock expectations that the calls are made to File#delete Eg... File.should_receive(:delete).o

Re: [rspec-users] Mocking expectations on I/O operations

2011-09-15 Thread Rob Aldred
Thanks Justin, That isnt working... its erroring with: The method `delete` was not stubbed or was already unstubbed -- Rob Aldred Software Developer r...@stardotstar.com twitter: stardotstar 47 Newton Street, Manchester, M1 1FT T: +44 (0) 161 236 9740

Re: [rspec-users] Mocking expectations on I/O operations

2011-09-15 Thread Rob Aldred
11 at 11:08, Ash Moran wrote: > > On 15 Sep 2011, at 10:05, Rob Aldred wrote: > > > Thanks Justin, > > That isnt working... its erroring with: > > > > The method `delete` was not stubbed or was already unstubbed > > Hi Rob > > For reasons I could go

[rspec-users] Setting expections on chained calls

2011-11-07 Thread Rob Aldred
I'm pretty sure this has probably been discussed before. I'm using couchdb (couchrest_model) When speccing my controller i want to set expectations that im calling my couch views correctly. The query interface has recently been updated to work very similar to ARel This means i have to rewrite s

Re: [rspec-users] Setting expections on chained calls

2011-11-08 Thread Rob Aldred
On Tue, Nov 08, 2011 at 12:36:22AM +, Justin Ko wrote: > > On Nov 7, 2011, at 4:13 PM, Matt Wynne wrote: > > > > > On 7 Nov 2011, at 18:37, Justin Ko wrote: > > > >> On Nov 2, 2011, at 12:01 PM, Rob Aldred wrote: > >> > >>> >

[rspec-users] Fixtures not loading when running full test suite

2009-08-14 Thread Rob Aldred
Hi, I've been trying to work this out for a while, im convinced its some local db configuration specific to my machine. When running `rake spec` 14 of my test fail all of them in the user_spec generated by restful auth. The error for all the failing tests is: ActiveRecord::RecordNotFound Couldn't