Re: [rspec-users] Examples of writing controller specs that use authentication

2007-10-26 Thread Pat Maddox
On 10/26/07, Leslie Freeman <[EMAIL PROTECTED]> wrote: > Hello, > I'm working on specs for a controller that handles authentication > using the restful_authentication plugin. I'm trying to find a > resource (tutorial or examples, if possible) about the best way to go > about writing mocks and specs

[rspec-users] Examples of writing controller specs that use authentication

2007-10-26 Thread Leslie Freeman
Hello, I'm working on specs for a controller that handles authentication using the restful_authentication plugin. I'm trying to find a resource (tutorial or examples, if possible) about the best way to go about writing mocks and specs to make sure that things like my before_filters are work

Re: [rspec-users] Weird failing spec

2007-10-26 Thread David Chelimsky
On 10/26/07, Tarsoly András <[EMAIL PROTECTED]> wrote: > > On 2007.10.26., at 21:28, Ashley Moran wrote: > > > > > First, like David said earlier, you're putting too much into one spec: > > > > Also I don't think you need '@option = ' in front of > > @option.update_attributes!, as that method call

Re: [rspec-users] Weird failing spec

2007-10-26 Thread Tarsoly András
On 2007.10.26., at 21:28, Ashley Moran wrote: > > First, like David said earlier, you're putting too much into one spec: > > Also I don't think you need '@option = ' in front of > @option.update_attributes!, as that method call modifies the object > in-place. But that's a Rails issue. > > One ot

Re: [rspec-users] rspec and capistrano

2007-10-26 Thread Scott Taylor
On Oct 26, 2007, at 11:50 AM, Pat Maddox wrote: > On 10/26/07, Jonathan Linowes <[EMAIL PROTECTED]> wrote: >> Hi, >> has anyone here written a capistrano task for rspec to run through my >> specs on the deployed server? I'd appreciate a snippet or two to get >> me started. >> Thx >> linoj >>

Re: [rspec-users] rspec_autotest failing

2007-10-26 Thread David Chelimsky
On 10/26/07, Steve <[EMAIL PROTECTED]> wrote: > On Fri, 26 Oct 2007 15:01:30 -0400, Josh Knowles wrote: > > > On 10/26/07, Steve <[EMAIL PROTECTED]> wrote: > >> > >> I'm running from trunk, and don't have the gem installed. How is > >> autotesting enabled? Is it a special switch passed to 'spec' or

Re: [rspec-users] Specing with Subdomains as Account Keys

2007-10-26 Thread sinclair bain
That's great! Cheers! sinclair On 10/26/07, Ryan Heneise <[EMAIL PROTECTED]> wrote: > > On Oct 26, 2007, at 12:11 PM, sinclair bain wrote: > > > Ryan, > > > > Are you stubbing > > > > @current_company = Company.find_by_subdomain(account_subdomain) > > > > in the inherited #find_current_company

Re: [rspec-users] rspec_autotest failing

2007-10-26 Thread Steve
On Fri, 26 Oct 2007 15:01:30 -0400, Josh Knowles wrote: > On 10/26/07, Steve <[EMAIL PROTECTED]> wrote: >> >> I'm running from trunk, and don't have the gem installed. How is >> autotesting enabled? Is it a special switch passed to 'spec' or >> 'spec_server'? > > gem install ZenTest > cd RAILS_RO

Re: [rspec-users] Weird failing spec

2007-10-26 Thread Ashley Moran
On Oct 26, 2007, at 5:39 pm, Tarsoly András wrote: > http://pastie.caboo.se/111221 > > I've tried everything, like stubbing out :update_attributes! , even > tested it in real-life and it works like a charm: updates / creates > new records nicely and everything else is working properly. First

Re: [rspec-users] rspec_autotest failing

2007-10-26 Thread Josh Knowles
On 10/26/07, Steve <[EMAIL PROTECTED]> wrote: > > I'm running from trunk, and don't have the gem installed. How is > autotesting enabled? Is it a special switch passed to 'spec' or > 'spec_server'? gem install ZenTest cd RAILS_ROOT autotest ___ rspec-use

Re: [rspec-users] rspec_autotest failing

2007-10-26 Thread Scott Taylor
On Oct 26, 2007, at 2:51 PM, Steve wrote: > On Fri, 26 Oct 2007 13:38:09 -0400, Scott Taylor wrote: > >> That's quite outdated. RSpec now comes with it's own autotest plugin >> (which should use it by default, if you have the rspec gem >> installed). >> >> Scott > > I'm running from trunk, and

Re: [rspec-users] rspec_autotest failing

2007-10-26 Thread Steve
On Fri, 26 Oct 2007 18:51:17 +, Steve wrote: > On Fri, 26 Oct 2007 13:38:09 -0400, Scott Taylor wrote: > >> That's quite outdated. RSpec now comes with it's own autotest plugin >> (which should use it by default, if you have the rspec gem installed). >> >> Scott > > I'm running from trun

Re: [rspec-users] rspec_autotest failing

2007-10-26 Thread Steve
On Fri, 26 Oct 2007 13:38:09 -0400, Scott Taylor wrote: > That's quite outdated. RSpec now comes with it's own autotest plugin > (which should use it by default, if you have the rspec gem installed). > > Scott I'm running from trunk, and don't have the gem installed. How is autotesting enable

Re: [rspec-users] Specing with Subdomains as Account Keys

2007-10-26 Thread Ryan Heneise
On Oct 26, 2007, at 12:11 PM, sinclair bain wrote: > Ryan, > > Are you stubbing > > @current_company = Company.find_by_subdomain(account_subdomain) > > in the inherited #find_current_company method ? > > Make sure the @current_company is the same one upon which you have > your expectations ? >

Re: [rspec-users] Spec custom finders

2007-10-26 Thread Pat Maddox
On 10/26/07, Steve <[EMAIL PROTECTED]> wrote: > I have some finders in my models where I write some of the sql myself. I > of course want to test these, but am not sure the best way. Should I just > let them roll through to the db, and verify they return the correct > objects based on the fixtures

Re: [rspec-users] rspec_autotest failing

2007-10-26 Thread Scott Taylor
That's quite outdated. RSpec now comes with it's own autotest plugin (which should use it by default, if you have the rspec gem installed). Scott On Oct 26, 2007, at 1:23 PM, Steve wrote: > Is the rspec_autotest plugin mentioned here, > http://blog.nicksieger.com/articles/2006/11/15/rspec-a

[rspec-users] rspec_autotest failing

2007-10-26 Thread Steve
Is the rspec_autotest plugin mentioned here, http://blog.nicksieger.com/articles/2006/11/15/rspec-autotest-now-a-rails-plugin the accepted method of auto testing specs? It's an old article, and after grabbing the plugin, and giving it a run, it fails with: $ rake spec:autotest:rails trunk/vendor/

[rspec-users] Weird failing spec

2007-10-26 Thread Tarsoly András
Hi guys, I have a weird failing spec, for which I just cannot figure out the reason of failure. I'm now rewriting my controller specs based on the advice of David and Ashley, and I got stuck on this (see: [rspec- users] specing rescue, ensure and else blocks of an Exception). http://pastie

Re: [rspec-users] Specing with Subdomains as Account Keys

2007-10-26 Thread sinclair bain
Ryan, Are you stubbing @current_company = *Company.find_by_subdomain(account_subdomain)* in the inherited #find_current_company method ? Make sure the @current_company is the same one upon which you have your expectations ? ie before do ... Company.stub!(:find_by_subdomain).and_return(@curr

Re: [rspec-users] Scenarios Plugin Pre-Announcement

2007-10-26 Thread Josh Knowles
On 10/26/07, Josh Knowles <[EMAIL PROTECTED]> wrote: > Has anyone got this to work with Edge Rails/Rspec? I'm getting the > following stack trace when I try and execute my specs after installing > the plugin: FYI I got this to work by removing the reference to ExampleModule (lines 12 - 14 of exte

[rspec-users] Spec custom finders

2007-10-26 Thread Steve
I have some finders in my models where I write some of the sql myself. I of course want to test these, but am not sure the best way. Should I just let them roll through to the db, and verify they return the correct objects based on the fixtures I load, or should I spec the actual query? I know that

Re: [rspec-users] rspec and capistrano

2007-10-26 Thread Pat Maddox
On 10/26/07, Jonathan Linowes <[EMAIL PROTECTED]> wrote: > Hi, > has anyone here written a capistrano task for rspec to run through my > specs on the deployed server? I'd appreciate a snippet or two to get > me started. > Thx > linoj > ___ > rspec-users m

Re: [rspec-users] Easy AR association stubbing

2007-10-26 Thread Matthew Heidemann
try: it "should find the item requested" do @current_company.items.should_receive(:find).with("1").and_return(@item) do_get end -Matt ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Scenarios Plugin Pre-Announcement

2007-10-26 Thread Josh Knowles
On 10/17/07, John Long <[EMAIL PROTECTED]> wrote: > I just updated the README. It gives a better overview of the Scenarios > plugin now: > > http://faithfulcode.rubyforge.org/svn/plugins/trunk/scenarios/README Has anyone got this to work with Edge Rails/Rspec? I'm getting the following stack tra

Re: [rspec-users] Textmate Formatting has gone away

2007-10-26 Thread Daniel N
On 10/27/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > > On 10/26/07, Daniel N <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I just updated my Textmate bundle to the latest in the svn because It > wasn't > > working with the latest version of rspec. It's been a while since I > updated > > the bund

Re: [rspec-users] Textmate Formatting has gone away

2007-10-26 Thread George Anderson
You may find this useful, too: http://macromates.com/blog/2007/file-type-detection-rspec-rails/ /g On 10/26/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 10/26/07, Daniel N <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I just updated my Textmate bundle to the latest in the svn because It wasn

Re: [rspec-users] Textmate Formatting has gone away

2007-10-26 Thread David Chelimsky
On 10/26/07, Daniel N <[EMAIL PROTECTED]> wrote: > Hi, > > I just updated my Textmate bundle to the latest in the svn because It wasn't > working with the latest version of rspec. It's been a while since I updated > the bundle ;) > > I like the format that I used to have of a progress bar across t

[rspec-users] Easy AR association stubbing

2007-10-26 Thread Ryan Heneise
On 10/5/07, Andrew WC Brown wrote: > I've added a method to the mock class that makes it pretty easy to > stub associations in rails. I've been using it for awhile and it seems > to cut down on a lot of setup code for the controller and model specs > that use associations. Hi Matthew, Thanks for

[rspec-users] Textmate Formatting has gone away

2007-10-26 Thread Daniel N
Hi, I just updated my Textmate bundle to the latest in the svn because It wasn't working with the latest version of rspec. It's been a while since I updated the bundle ;) I like the format that I used to have of a progress bar across the top and html formatted results for each example, however n

[rspec-users] rspec and capistrano

2007-10-26 Thread Jonathan Linowes
Hi, has anyone here written a capistrano task for rspec to run through my specs on the deployed server? I'd appreciate a snippet or two to get me started. Thx linoj ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/li

[rspec-users] Specing with Subdomains as Account Keys

2007-10-26 Thread Ryan Heneise
How do you go about implementing and rspecing subdomains as account keys? I'm sure that this must be an issues for others as well. So I have an app using subdomains as account keys. The Application Controller sets up @current_company in a before filter. Everything is done within the context

Re: [rspec-users] specing rescue, ensure and else blocks of an Exception

2007-10-26 Thread Tarsoly András
Thanks a lot guys, this is great help, it's really appreciated, it makes a lot more sense now. I somehow felt that I'm not entirely on the right path when I'm doing controller testing, and your replies and examples given here shed some light on it. David, I like your alternative better, sin

Re: [rspec-users] specing rescue, ensure and else blocks of an Exception

2007-10-26 Thread David Chelimsky
On 10/26/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 10/26/07, Tarsoly András <[EMAIL PROTECTED]> wrote: > Take a look at http://pastie.caboo.se/25 (reorganized from your > example). Note that each example is about what the controller does, > not what the model does. Also note that ther

Re: [rspec-users] specing rescue, ensure and else blocks of an Exception

2007-10-26 Thread Ashley Moran
On 26 Oct 2007, at 12:56, Ashley Moran wrote: >@foo.should_receive(:update_attributes!).with(params > [:foo]).and_raise(RecordNotSaved) Sorry, RecordInvalid.new in your case, not RecordNotSaved (with or without the new) -- blog @ http://aviewfromafar.net/ linked-in @ http://www.linkedi

Re: [rspec-users] specing rescue, ensure and else blocks of an Exception

2007-10-26 Thread David Chelimsky
On 10/26/07, Tarsoly András <[EMAIL PROTECTED]> wrote: > Greetings, > > I'm using rspec with rcov for my applications and there is one issue which I > cannot solve nor can find any proper information regarding it: specing what > is in a rescue block in case of an exception. > > I'm using Ruby on Ra

Re: [rspec-users] specing rescue, ensure and else blocks of an Exception

2007-10-26 Thread Ashley Moran
On 26 Oct 2007, at 11:55, Tarsoly András wrote: > So any pointers, help or links to some quick rundown regarding this > problem would be greatly appreciated. From a brief look over (apologies if I missed something), you are not invoking the errors you need to cause your rescue etc blocks to

Re: [rspec-users] spec_server doesn't update 'required' files

2007-10-26 Thread David Chelimsky
On 10/25/07, Brian Takita <[EMAIL PROTECTED]> wrote: > Rails handles the reloading of classes and modules. > If you would like to have these files be reloaded, use > require_dependency instead of require. You can also use Rails constant > autoloading facility (not requiring the file) to register th

[rspec-users] specing rescue, ensure and else blocks of an Exception

2007-10-26 Thread Tarsoly András
Greetings, I'm using rspec with rcov for my applications and there is one issue which I cannot solve nor can find any proper information regarding it: specing what is in a rescue block in case of an exception. I'm using Ruby on Rails and I usually make use of exceptions in my controllers,