Re: [rspec-users] rspec - rails put :update any examples

2008-02-04 Thread David Chelimsky
On Feb 4, 2008 9:44 PM, Brian Rowe <[EMAIL PROTECTED]> wrote: > I'm looking for a working example of a put :update on a controller. The > documentation online avoids the update function. > > Any help pointing to this example would be great. Trying to get to 100% > coverage...can't make it without

Re: [rspec-users] Spec::Runner.register_at_exit_hook in RSpec 1.1.3

2008-02-04 Thread David Chelimsky
On Feb 4, 2008 11:15 PM, Steve Hayes <[EMAIL PROTECTED]> wrote: > In RSpec 1.1.3 this method is invoked from > Spec::Example::ExampleGroupMethods.inherited, but it no longer exists. It most certainly does. In fact, it's new in 1.1.3, so neither the method nor the call existed prior. Any chance you

[rspec-users] rspec - rails put :update any examples

2008-02-04 Thread Brian Rowe
I'm looking for a working example of a put :update on a controller. The documentation online avoids the update function. Any help pointing to this example would be great. Trying to get to 100% coverage...can't make it without update :) Brian ___ rspec

[rspec-users] Spec::Runner.register_at_exit_hook in RSpec 1.1.3

2008-02-04 Thread Steve Hayes
In RSpec 1.1.3 this method is invoked from Spec::Example::ExampleGroupMethods.inherited, but it no longer exists. I noticed this trying to run my specs inside Textmate. I looked for a new version of the Textmate bundle, but there doesn't seem to be one. Re-adding the method from an earlier version

Re: [rspec-users] Error on nil.build

2008-02-04 Thread Chris Olsen
Ooops there was a typo on the method causing the error. It should be: It is this test that fails it "should make the relation to the users" do @account.should_receive(:users) # removed the .and_return do_post end Is there a better way to test that the data is being loaded into the related

Re: [rspec-users] odd versioning issue

2008-02-04 Thread Matt Cowley
Yep, that was it. Thanks, knew it was something simple. On Feb 4, 2008, at 7:11 PM, Luis Lavena wrote: > On Feb 4, 2008 9:48 PM, Matt Cowley <[EMAIL PROTECTED]> wrote: >> Hi folks, >> >> If I run rspec from textmate, or do a "spec " from the >> command-line, I get this message: >> #

Re: [rspec-users] Mock objects not getting unloaded between specs

2008-02-04 Thread Nate Clark
David, thanks for getting back. Here is the pastie with (hopefully) all the relevant code: http://pastie.caboo.se/147536 We're using the latest and greatest Rspec 1.1.3, so I don't think it's old versions that is the problem. Through some debugging, I have determined that in fact my "paginate_by_

Re: [rspec-users] OT local version control?

2008-02-04 Thread Corey Haines
Thanks for the response, Luis. I'm going through the user manual, and it looks like I can set up a main branch, make a clone, work on the clone with its own repository/revisions, then merge the changes back to the main branch when I'm ready. I like the idea of being able to work on several things

Re: [rspec-users] RESTful Routes

2008-02-04 Thread Raimond Garcia
> > On 4.2.2008, at 19.16, Raimond Garcia wrote: >> Interesting Jarkko... >> >> The restful routes, seem clearer than using urls, maybe not so much >> for this case, but for very long urls, that include for example the >> title of a blog, I would rather use blog_path(@blog). >> >> Yes, I want to t

Re: [rspec-users] odd versioning issue

2008-02-04 Thread Luis Lavena
On Feb 4, 2008 9:48 PM, Matt Cowley <[EMAIL PROTECTED]> wrote: > Hi folks, > > If I run rspec from textmate, or do a "spec " from the > command-line, I get this message: > > Your RSpec on Rails plugin is incompatible with

Re: [rspec-users] OT local version control?

2008-02-04 Thread Luis Lavena
On Feb 4, 2008 9:28 PM, Corey Haines <[EMAIL PROTECTED]> wrote: > Since it sounds like people don't mind talking about source control, and > this group has people I trust, I thought, as I went through the > learning/evaluating, I'd ask questions/make statements and get people's > thoughts. If peopl

[rspec-users] odd versioning issue

2008-02-04 Thread Matt Cowley
Hi folks, If I run rspec from textmate, or do a "spec " from the command-line, I get this message: Your RSpec on Rails plugin is incompatible with your installed RSpec. RSpec : 20080114022430 RSpec on Rails :

Re: [rspec-users] Trouble testing a method with loop

2008-02-04 Thread David Currin
Great, thanks for that, d. On 04/02/2008, Pat Maddox <[EMAIL PROTECTED]> wrote: > Extract the company creation to a method, so that that method only > builds one record at a time. Test that it works properly. Then you > can keep the test that you have, verifying that it creates the right > numb

Re: [rspec-users] OT local version control?

2008-02-04 Thread Corey Haines
Since it sounds like people don't mind talking about source control, and this group has people I trust, I thought, as I went through the learning/evaluating, I'd ask questions/make statements and get people's thoughts. If people on the list get annoyed, though, just let me know (offgroup is fine),

[rspec-users] outside-in BDD vs writing examples up front

2008-02-04 Thread Dan North
I thought I'd repost this because it had the not-very-obvious title of "Re: Textmate RSpec Bundle 'it' snippet". And it seems quite timely wrt the BDD vs TDD threads. Cheers, Dan ps. Not wishing to single out Edvard below - I just happened to reply to his message in the original thread.

[rspec-users] Error on nil.build

2008-02-04 Thread Chris Olsen
I can't figure out why I am getting an error for one of the tests below: describe AccountsController, "POST" do before :each do @user = mock_model(User) @account = mock_model(Account, :id => 1, :valid => true, :save => true, :users => mock("users", :build => @user

Re: [rspec-users] RESTful Routes

2008-02-04 Thread Jarkko Laine
On 4.2.2008, at 19.16, Raimond Garcia wrote: > Interesting Jarkko... > > The restful routes, seem clearer than using urls, maybe not so much > for this case, but for very long urls, that include for example the > title of a blog, I would rather use blog_path(@blog). > > Yes, I want to test the full

Re: [rspec-users] Mock objects not getting unloaded between specs

2008-02-04 Thread David Chelimsky
On Feb 4, 2008 2:51 PM, Nate Clark <[EMAIL PROTECTED]> wrote: > I'm having a frustrating experience with a mock object in one example (a > Rails controller test) interfering with an actual model test in a subsequent > model example. More specifically, I have > spec/controllers/section_controller_sp

[rspec-users] Mock objects not getting unloaded between specs

2008-02-04 Thread Nate Clark
I'm having a frustrating experience with a mock object in one example (a Rails controller test) interfering with an actual model test in a subsequent model example. More specifically, I have spec/controllers/section_controller_spec.rb with a mock call like this in one of the examples: Section.shou

Re: [rspec-users] Problems with plugins?

2008-02-04 Thread David Chelimsky
On Feb 4, 2008 1:52 PM, Lance Ball <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > On Feb 4, 2008, at 2:34 PM, David Chelimsky wrote: > > > On Feb 4, 2008 12:57 PM, Lance Ball > > <[EMAIL PROTECTED]> wrote: > >> > >> When #add_user_to_role is called in the control

Re: [rspec-users] Problems with plugins?

2008-02-04 Thread Lance Ball
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Feb 4, 2008, at 2:34 PM, David Chelimsky wrote: > On Feb 4, 2008 12:57 PM, Lance Ball > <[EMAIL PROTECTED]> wrote: >> >> When #add_user_to_role is called in the controller during my spec, >> the method is run, rather than being a stub as I would

Re: [rspec-users] Problems with plugins?

2008-02-04 Thread David Chelimsky
On Feb 4, 2008 12:57 PM, Lance Ball <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi there > > I've run into a bit of a problem that I can't seem to figure out. I > have a model class User which includes our acts_as_role_context > library. This lib acts like mos

[rspec-users] Problems with plugins?

2008-02-04 Thread Lance Ball
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi there I've run into a bit of a problem that I can't seem to figure out. I have a model class User which includes our acts_as_role_context library. This lib acts like most other acts_as libs, evaluating class and instance methods at runtime.

Re: [rspec-users] RESTful Routes

2008-02-04 Thread Raimond Garcia
>> Hi, >> >> I'm trying to test the behavior of a route with a delete method. >> >> Something like this: >> When "the admin clicks on 'delete'" do >>delete admin_blog_path(@blog) >> end >> >> which raises the following exception: >> NoMethodError: You have a nil object when you didn't expect i

Re: [rspec-users] BDD and TDD (was "Newbie question with rspec on rails")

2008-02-04 Thread Pat Maddox
On Feb 4, 2008 9:19 AM, Pat Maddox <[EMAIL PROTECTED]> wrote: > My favorite way to explain BDD is: > > There's a quote that says "Seek not to follow in the footsteps of > masters, seek what they sought." BDD presents the "seek what they > sought" as first-level knowledge. That should read "...pre

Re: [rspec-users] BDD and TDD (was "Newbie question with rspec on rails")

2008-02-04 Thread Pat Maddox
On Feb 4, 2008 7:51 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Feb 4, 2008 1:20 AM, Pat Maddox <[EMAIL PROTECTED]> wrote: > > For some info on why BDD kicks TDD's butt ... > > Woah! > > I find this deeply disturbing. I believe your heart is in the right > place here, so please don't take t

Re: [rspec-users] RESTful Routes

2008-02-04 Thread Raimond Garcia
> > On 4.2.2008, at 14.54, Raimond Garcia wrote: > >> Hi, >> >> I'm trying to test the behavior of a route with a delete method. >> >> Something like this: >> When "the admin clicks on 'delete'" do >>delete admin_blog_path(@blog) >> end >> >> which raises the following exception: >> NoMethodEr

Re: [rspec-users] RESTful Routes

2008-02-04 Thread David Chelimsky
On Feb 4, 2008 10:49 AM, Raimond Garcia <[EMAIL PROTECTED]> wrote: > > On Feb 4, 2008 6:54 AM, Raimond Garcia <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to test the behavior of a route with a delete method. > > Something like this: > When "the admin clicks on 'delete'" do > delete admin_bl

Re: [rspec-users] rspec-users Digest, Vol 20, Issue 6

2008-02-04 Thread Raimond Garcia
On Feb 4, 2008, at 5:07 PM, [EMAIL PROTECTED] wrote: On 4.2.2008, at 14.54, Raimond Garcia wrote: Hi, I'm trying to test the behavior of a route with a delete method. Something like this: When "the admin clicks on 'delete'" do delete admin_blog_path(@blog) end which raises the followin

Re: [rspec-users] RESTful Routes

2008-02-04 Thread Raimond Garcia
On Feb 4, 2008 6:54 AM, Raimond Garcia <[EMAIL PROTECTED]> wrote: Hi, I'm trying to test the behavior of a route with a delete method. Something like this: When "the admin clicks on 'delete'" do delete admin_blog_path(@blog) end which raises the following exception: NoMethodError: You ha

[rspec-users] BDD and TDD (was "Newbie question with rspec on rails")

2008-02-04 Thread David Chelimsky
On Feb 4, 2008 1:20 AM, Pat Maddox <[EMAIL PROTECTED]> wrote: > For some info on why BDD kicks TDD's butt ... Woah! I find this deeply disturbing. I believe your heart is in the right place here, so please don't take this as a personal attack, but this statement reflects a view that I see express

Re: [rspec-users] Development Cycle

2008-02-04 Thread Nathan Sutton
sounds good guys, thanks :) Nathan Sutton [EMAIL PROTECTED] rspec 1.1.3 rspec_on_rails 1.1.3 rails 2.0.2 On Feb 4, 2008, at 1:14 AM, Pat Maddox wrote: > On Feb 3, 2008 9:19 PM, Nathan Sutton <[EMAIL PROTECTED]> wrote: >> Hey guys, I'm trying to work out the order of development for >> features

Re: [rspec-users] BDD and TDD (was "Newbie question with rspec on rails")

2008-02-04 Thread Andrew WC Brown
David, I'll be your cha'Dich Some people still sware using TDD over BDD. On Feb 4, 2008 10:51 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Feb 4, 2008 1:20 AM, Pat Maddox <[EMAIL PROTECTED]> wrote: > > For some info on why BDD ki

Re: [rspec-users] Trouble testing a method with loop

2008-02-04 Thread Pat Maddox
Extract the company creation to a method, so that that method only builds one record at a time. Test that it works properly. Then you can keep the test that you have, verifying that it creates the right number of records. Pat ___ rspec-users mailing li

Re: [rspec-users] Trouble testing a method with loop

2008-02-04 Thread David Currin
Thanks, Point taken about less interaction with the database. The 'companies' mock is an exact representation of the companies list returned by the basecamp api which is why there's 37 records in there. I need to learn to think more clearly about separation from the database I guess. The point is

Re: [rspec-users] RESTful Routes

2008-02-04 Thread Jarkko Laine
On 4.2.2008, at 14.54, Raimond Garcia wrote: > Hi, > > I'm trying to test the behavior of a route with a delete method. > > Something like this: > When "the admin clicks on 'delete'" do > delete admin_blog_path(@blog) > end > > which raises the following exception: > NoMethodError: You have

Re: [rspec-users] Trouble testing a method with loop

2008-02-04 Thread David Chelimsky
On Feb 4, 2008 5:24 AM, David Currin <[EMAIL PROTECTED]> wrote: > I'm having trouble working out how to test a method that contains a > loop. I'm new to rspec so not sure what the best way is to tackle > this. > > class Company < ActiveRecord::Base > > def self.sync_with_basecamp > companies = ba

Re: [rspec-users] RESTful Routes

2008-02-04 Thread David Chelimsky
On Feb 4, 2008 6:54 AM, Raimond Garcia <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to test the behavior of a route with a delete method. > > Something like this: > When "the admin clicks on 'delete'" do > delete admin_blog_path(@blog) >end > > which raises the following exception: > No

[rspec-users] RESTful Routes

2008-02-04 Thread Raimond Garcia
Hi, I'm trying to test the behavior of a route with a delete method. Something like this: When "the admin clicks on 'delete'" do delete admin_blog_path(@blog) end which raises the following exception: NoMethodError: You have a nil object when you didn't expect it! The error occurred whil

[rspec-users] Trouble testing a method with loop

2008-02-04 Thread David Currin
I'm having trouble working out how to test a method that contains a loop. I'm new to rspec so not sure what the best way is to tackle this. class Company < ActiveRecord::Base def self.sync_with_basecamp companies = basecamp_fetch("companies") companies.each do |c| company = self.find_or_