Re: [rspec-users] Fixture replacement vs mock model

2009-09-02 Thread Scott Taylor
Jeremy Hageman wrote: Scott thanks for the insight. On Sep 1, 9:16 pm, Scott Taylor wrote: Most mocks used in a rails project server neither of these purposes. Primarily they are used for speed - which so far has been the primary trade off with using a fixture replacement (such as FixtureR

[rspec-users] Nested Partials

2009-09-02 Thread amkirwan
What is the best way to spec nested partials in rails? Here is the generic type of nesting I am trying to spec. new.html.erb edit.html.erb _outer_partial.html.erb _inner_partial.html.erb ___ rspec-users mailing list rspec-users@rubyforge.org

Re: [rspec-users] undefined local variable or method `__FILE'

2009-09-02 Thread theLemcke
Thanks a lot, that fixed it. Sorry about the double post, btw. On Sep 2, 3:03 pm, theLemcke wrote: > I ran this install > guide:http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-ra... > > Then generated a rails app, and ran 'script/generate rspec' and > 'script/generate rspec_m

[rspec-users] undefined local variable or method `__FILE'

2009-09-02 Thread theLemcke
I ran this install guide: http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-rails-and-postgresql-on-os-x-third-edition Then generated a rails app, and ran 'script/generate rspec' and 'script/generate rspec_model Note' When I try to spec note_spec.rb I get this error: /Users/sixt

Re: [rspec-users] undefined local variable or method `__FILE'

2009-09-02 Thread David Chelimsky
On Wed, Sep 2, 2009 at 5:22 PM, theLemcke wrote: > So I began with this setup: > http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-rails-and-postgresql-on-os-x-third-edition > > Created a basic rails setup, ran 'script/generate rspec' and 'script/ > generate rspec_model Note' and t

[rspec-users] undefined local variable or method `__FILE'

2009-09-02 Thread theLemcke
So I began with this setup: http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-rails-and-postgresql-on-os-x-third-edition Created a basic rails setup, ran 'script/generate rspec' and 'script/ generate rspec_model Note' and tried to run 'note_spec.rb' and I encountered this error:

Re: [rspec-users] Fixture replacement vs mock model

2009-09-02 Thread Jeremy Hageman
On Sep 2, 6:06 am, Stephen Eley wrote: > Why isn't current_user available to your controller specs?  If you > defined it in ApplicationController, and your controller inherits from > that, then it's just another method on your controller.  You may or > may not want to stub it for convenience, to

Re: [rspec-users] uploads with webrat in stories

2009-09-02 Thread Enrico Hartung
This topic might be a little bit old, but since I run into this issue recently here's the solution: Due to a lack of multipart form support for integration tests in Action Pack Webrat's attach_file does not work with Rails 2.0.2. I posted a workaround on our blog: http://devblog.imedo.de/2009/

Re: [rspec-users] Fixture replacement vs mock model

2009-09-02 Thread Stephen Eley
On Wed, Sep 2, 2009 at 3:34 AM, Jeremy Hageman wrote: > > But this is not possible since current_user is a method unavailable to > the specs. At this point I realize this situation is much better > served by stubbing and mocking the functions and models. Why isn't current_user available to your co

Re: [rspec-users] Fixture replacement vs mock model

2009-09-02 Thread Jeremy Hageman
Scott thanks for the insight. On Sep 1, 9:16 pm, Scott Taylor wrote: > Most mocks used in a rails project server neither of these purposes.   > Primarily they are used for speed - which so far has been the primary > trade off with using a fixture replacement (such as FixtureReplacement, > FactoryG

Re: [rspec-users] Issue with ActiveRecord::Base.transaction in RSpec

2009-09-02 Thread David Chelimsky
On Wed, Sep 2, 2009 at 2:19 AM, Brian Cardarella wrote: > Dave, > >   Yes, verb failure :) > >   I think this might be an issue of me using Sqlite3 as my DB. Let me > port over to Postgres and test that out. Hopefully just a false alarm. Cool - let us know. Cheers, David > > - Brian > > On Sep 2

Re: [rspec-users] Issue with ActiveRecord::Base.transaction in RSpec

2009-09-02 Thread Brian Cardarella
False alarm, it was because of Sqlite3. Sorry! - Brian On Sep 2, 3:19 am, Brian Cardarella wrote: > Dave, > >    Yes, verb failure :) > >    I think this might be an issue of me using Sqlite3 as my DB. Let me > port over to Postgres and test that out. Hopefully just a false alarm. > > - Brian >

Re: [rspec-users] Fixture replacement vs mock model

2009-09-02 Thread Jeremy Hageman
On Sep 1, 3:26 pm, Stephen Eley wrote: > For what kind of test? The specific situation that started the question rolling around in my head was specing out a build method in a controller which creates an instance of a join model between two User instances. My setup includes AuthLogic and Machinist.

Re: [rspec-users] Issue with ActiveRecord::Base.transaction in RSpec

2009-09-02 Thread Brian Cardarella
Dave, Yes, verb failure :) I think this might be an issue of me using Sqlite3 as my DB. Let me port over to Postgres and test that out. Hopefully just a false alarm. - Brian On Sep 2, 3:11 am, David Chelimsky wrote: > On Tue, Sep 1, 2009 at 10:02 PM, Brian Cardarella > wrote: > > I have

Re: [rspec-users] Issue with ActiveRecord::Base.transaction in RSpec

2009-09-02 Thread David Chelimsky
On Tue, Sep 1, 2009 at 10:02 PM, Brian Cardarella wrote: > I have this example: > > http://pastie.org/602476 > > If I run it, it on the 2nd 'Country.count.should == 0' There's a verb missing :) I think you mean that "If I run it, it _fails_ on the 2nd ...", yes? What is the failure message you're

[rspec-users] Issue with ActiveRecord::Base.transaction in RSpec

2009-09-02 Thread Brian Cardarella
I have this example: http://pastie.org/602476 If I run it, it on the 2nd 'Country.count.should == 0' If I run the exact same code in 'script/console test' (so in the same environment) it works just fine. But not within an RSepc example. Any thoughts? _