Re: [rspec-users] mocking an AR: ActiveRecord::AssociationTypeMismatch error

2011-02-11 Thread David Chelimsky
On Feb 12, 2011, at 1:10 AM, Fearless Fool wrote: > I have a Premise model with lots of validations and somewhat complex > callbacks. I've already written tests for those (and they pass). > > I also have a MeteredService model for which premise :has_many > metered_services and (of course) meter

[rspec-users] mocking an AR: ActiveRecord::AssociationTypeMismatch error

2011-02-11 Thread Fearless Fool
I have a Premise model with lots of validations and somewhat complex callbacks. I've already written tests for those (and they pass). I also have a MeteredService model for which premise :has_many metered_services and (of course) metered_service :belongs_to premise. Testing MeteredService doesn'

Re: [rspec-users] Current test failing?

2011-02-11 Thread James Martin
I'm trying to imagine a use case (and usage) of this. Could you give me an example of how you would want to write it and what for? On Friday, February 11, 2011, Andrew Wagner wrote: > Is there any way, within a test (e.g., in an after block), to see whether the > test is currently passing, fail

[rspec-users] Controller Specs - undefined local variable or method 'app'

2011-02-11 Thread Doug Bryant
On one of my projects using rspec 2.5 & rails 3.0.4, I recently moved from postgres to mongo and am using mongoid as the persistence library. I ported all the models over to the mongoid way of doing things and now have all my models passing the tests. None of the controller test work any more. T

Re: [rspec-users] Problem with rendering JSON

2011-02-11 Thread Matt Wynne
On 11 Feb 2011, at 16:04, Ants Pants wrote: > You are my last resort for solving this issue as I have tried and tried to > solve it myself but can't. > > I'm not even sure if it's an RSpec issue but the thing is, if I run the > request from the browser, it works. Sadly, my test fails. So eithe

Re: [rspec-users] testing a collection

2011-02-11 Thread Greg Ditrick
Jay McGaffigan wrote: > Have you looked at JTestR? > I'm not sure how active it is being developed and it might not do what > you are looking for... but it might be worth a shot. > Yes. I can pretty much do all of what jtestr is doing. But, I believe that when you mock a java class that

Re: [rspec-users] testing a collection

2011-02-11 Thread Jay McGaffigan
Have you looked at JTestR? I'm not sure how active it is being developed and it might not do what you are looking for... but it might be worth a shot. jay On Fri, Feb 11, 2011 at 11:28 AM, GregD wrote: > All, > > Is there away to test a collection with rspec 1.3?  I've seen Jim > Weirich's rspec

[rspec-users] testing a collection

2011-02-11 Thread GregD
All, Is there away to test a collection with rspec 1.3? I've seen Jim Weirich's rspec-collection, but it requires rspec 2.0. I'd like to go to rspec 2.0, but have another dependency that will not work with rspec 2.0. I may have to bite the bullet and see if I can update that dependency to work

[rspec-users] Problem with rendering JSON

2011-02-11 Thread Ants Pants
You are my last resort for solving this issue as I have tried and tried to solve it myself but can't. I'm not even sure if it's an RSpec issue but the thing is, if I run the request from the browser, it works. Sadly, my test fails. So either there's something about Rails I don't know about (but sh

[rspec-users] Current test failing?

2011-02-11 Thread Andrew Wagner
Is there any way, within a test (e.g., in an after block), to see whether the test is currently passing, failing, or pending? Even a hack-ish kind of way? I'm just curious. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailma

Re: [rspec-users] hash form of stub_chain returning nil for chains with shared first message

2011-02-11 Thread Frederick Cheung
On Feb 10, 7:30 pm, David Chelimsky wrote: > On Feb 10, 2011, at 12:40 PM, Frederick Cheung wrote: > > > I'm new using rspec, so please forgive me if I'm barking up the wrong tree, > > but... > > > I'd expect this to pass (using rspec 2.5.1) > > > describe 'stub_chain' do > >  it "returns expecte