Re: [rspec-users] Netbeans and .story files

2008-04-07 Thread Tim Haines
I sent the netbeans guys a list of features for story support in netbeans. With luck they'll make it into the next version after 6.1. Feel free to go check it out and add to the list. :-) Cheers, Tim. On 8/04/2008, at 4:55, Ashley Moran <[EMAIL PROTECTED]> wrote: > > On 7 Apr 2008, at

Re: [rspec-users] Need some help with a simple

2008-04-07 Thread chris anderson
Glenn Ford wrote: > I'm guessing the key is inside "find_account_by_subdomain_or_url". Do > you have that defined somewhere? It probably calls something like: > > @account = Account.find_by_subdomain(blah) or Account.find_by_url(blah) > > In which case that's probably what you need to stub. No

Re: [rspec-users] Need some help with a simple

2008-04-07 Thread Glenn Ford
I'm guessing the key is inside "find_account_by_subdomain_or_url". Do you have that defined somewhere? It probably calls something like: @account = Account.find_by_subdomain(blah) or Account.find_by_url(blah) In which case that's probably what you need to stub. Nothing is actually checking

[rspec-users] Need some help with a simple

2008-04-07 Thread chris anderson
I can't figure out why this is failing. It seems to have a hard time assigning the @account. I have spent way too long trying to figure this out. Thanks for any help. --- NoMethodError in 'StaffMembersController GET index should allow anonymous users' You have a nil object when you didn't e

Re: [rspec-users] Why do I have to require_dependency here?

2008-04-07 Thread Ashley Moran
On 7 Apr 2008, at 21:09, David Chelimsky wrote: > Did anything else change in your setup? Rails version? Autotest > version? Just checking :) Hmm, can't think of anything. Rails has been 2.0.2 since I started, don't remember ever upgrading Autotest, at the very most it was 3.9.1 to 3.9.2 (b

Re: [rspec-users] Why do I have to require_dependency here?

2008-04-07 Thread David Chelimsky
On Mon, Apr 7, 2008 at 4:08 PM, Ashley Moran <[EMAIL PROTECTED]> wrote: > > On 7 Apr 2008, at 21:01, Ashley Moran wrote: > > > The fix is to put this at the top of the controller file: > > require_dependency "user_state" > > > I spoke to soon :( > > This fixes it for a single controller run, b

Re: [rspec-users] Why do I have to require_dependency here?

2008-04-07 Thread Ashley Moran
On 7 Apr 2008, at 21:01, Ashley Moran wrote: > The fix is to put this at the top of the controller file: > require_dependency "user_state" I spoke to soon :( This fixes it for a single controller run, but still breaks when autotest re-runs the one controller after making a change. Somethi

[rspec-users] Why do I have to require_dependency here?

2008-04-07 Thread Ashley Moran
Hi This was bugging the hell out of me until I found a fix just. I have been getting reams and reams of errors from reference to one model class in a controller spec. Here's one of the 57 that go wrong: 20) LoadError in 'UsersController PUT /users/:id when the model is invalid and there i

Re: [rspec-users] Netbeans and .story files

2008-04-07 Thread Ashley Moran
On 7 Apr 2008, at 20:18, David Chelimsky wrote: > That said, the convention that I see emerging is .rb for stories > expressed in ruby and either no extension or .story for those > expressed in plain text. That's what I do - .story for the plain text file and .rb for the corresponding runner

Re: [rspec-users] Netbeans and .story files

2008-04-07 Thread David Chelimsky
On Mon, Apr 7, 2008 at 11:01 AM, Ashley Moran <[EMAIL PROTECTED]> wrote: > On 01/04/2008, Martin Krauskopf <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > yes, the .story extension is not supported out-of-the box. Unfortunately > > it is not possible to extend Ruby file-type now: > > > > http://www.ne

Re: [rspec-users] Error testing rails controller

2008-04-07 Thread David Chelimsky
On Fri, Apr 4, 2008 at 12:46 PM, Jacob <[EMAIL PROTECTED]> wrote: > I am trying to test my controllers with RSpec and from the examples I > have found it is as easy as this: > > describe SessionsController do > > it "should render login template" do > get 'new' > response.should render_

[rspec-users] Haml and View tests

2008-04-07 Thread Chris Olsen
Does Rspec work nicely with Haml for controller integrated view tests? I am getting the following error: === ActionView::TemplateError in 'Admin::ListingsController index should get a 200 OK' undefined method `photo' for true:TrueClass On line #2 of admin/listings/_listing.html.ham

Re: [rspec-users] how to stub the :current_user and any methods associated with it

2008-04-07 Thread Bryan Ray
Responses shown below... Sorry this isn't extremely informative ... in a bit of a rush. Hopefully it will point you in the appropriate direction. On Sun, Apr 6, 2008 at 2:17 PM, newbie <[EMAIL PROTECTED]> wrote: > I'm new to Rspec and I'm having a bit of trouble with this controller > that I'm t

Re: [rspec-users] how should i test this code with rspec

2008-04-07 Thread Pat Maddox
On Mon, Mar 24, 2008 at 3:24 AM, nathan.wu <[EMAIL PROTECTED]> wrote: > ids = Category.find(:all).map(&:id) > > ids = mock('ids') > Category.should_receive(:find).with(all).and_return(??) > > and > what's the difference between mock and mock_model > when should i use mock and mock_model categ

Re: [rspec-users] Netbeans and .story files

2008-04-07 Thread Ashley Moran
On 01/04/2008, Martin Krauskopf <[EMAIL PROTECTED]> wrote: > > Hi, > > yes, the .story extension is not supported out-of-the box. Unfortunately > it is not possible to extend Ruby file-type now: > > http://www.netbeans.org/issues/show_bug.cgi?id=116563 > > But easy to fix inside of NetBeans. I've j

Re: [rspec-users] Advice / Turning a Usecase into a Rspec Story / Granularity ofstories

2008-04-07 Thread Rick DeNatale
On Thu, Apr 3, 2008 at 10:59 AM, Ashley Moran <[EMAIL PROTECTED]> wrote: > On 03/04/2008, Rick DeNatale <[EMAIL PROTECTED]> wrote: > > > > > On the other hand. Keeping these finer grained scenarios within a > > single story allows branching using GivenScenario which only works > > with scenarios wi

Re: [rspec-users] Comparing new models

2008-04-07 Thread David Chelimsky
On Sun, Apr 6, 2008 at 4:33 PM, Rare <[EMAIL PROTECTED]> wrote: > Hi all, > > I am trying to test that a view file in Rails is being sent a new > empty model (Product.new) in my rspec test, below is my code. I've > tried comparing them with ==, ===, equal, eql none work. I just get an > error (

Re: [rspec-users] Using Haml for view tests

2008-04-07 Thread David Chelimsky
On Mon, Mar 24, 2008 at 12:38 PM, Joe Fiorini <[EMAIL PROTECTED]> wrote: > I'm writing a view test and I render index.html.haml. However, > autotest does not pick up changes to this file, but more importantly, > when the tests do run I get my Haml source displayed in the "actual" > result, inst

[rspec-users] Error testing rails controller

2008-04-07 Thread Jacob
I am trying to test my controllers with RSpec and from the examples I have found it is as easy as this: describe SessionsController do it "should render login template" do get 'new' response.should render_template(:login) end end However both get and post raise "wrong number of arg

Re: [rspec-users] Netbeans and .story files

2008-04-07 Thread Martin Krauskopf
Tim Haines wrote: > Hi Ashley, > > I don't think Netbeans has support for plain text stories yet - but I'm > not certain (I was using it with frustration last night too). Probably > better to ask in the netbeans forum? Hi, yes, the .story extension is not supported out-of-the box. Unfortunate

[rspec-users] Comparing new models

2008-04-07 Thread Rare
Hi all, I am trying to test that a view file in Rails is being sent a new empty model (Product.new) in my rspec test, below is my code. I've tried comparing them with ==, ===, equal, eql none work. I just get an error (see below code). I guess it's the condition tester (e.g. ==) that is incorrect,

Re: [rspec-users] Testing Plugins + Lib Code

2008-04-07 Thread Joe Fiorini
Thanks for this! I came across your message while writing my first plugin. You allowed me to take 20 lines of lib code and turn it into a fully tested plugin in 30 minutes! Thanks man! Joe On Mar 3, 2008, at 7:46 PM, Pat Maddox wrote: > On Mon, Mar 3, 2008 at 3:17 PM, Mark Dodwell <[EMAIL

[rspec-users] Using Haml for view tests

2008-04-07 Thread Joe Fiorini
I'm writing a view test and I render index.html.haml. However, autotest does not pick up changes to this file, but more importantly, when the tests do run I get my Haml source displayed in the "actual" result, instead of rendered Html. Does rspec support Haml in this way? Is there anothe

[rspec-users] how should i test this code with rspec

2008-04-07 Thread nathan.wu
ids = Category.find(:all).map(&:id) ids = mock('ids') Category.should_receive(:find).with(all).and_return(??) and what's the difference between mock and mock_model when should i use mock and mock_model ___ rspec-users mailing list rspec-users@rubyforge.

[rspec-users] How to loadby by alphabetical order, not mtime

2008-04-07 Thread Andrew Chen
Hi, I'm writing my requirements in rspec, however, I can not figure out a way to execute all specs according to alphabetical order, not by last modified time. According to the documentation, it seems like the default is by alphabetical order, I just can not get that to work. In the unit tests wit

Re: [rspec-users] How to loadby by alphabetical order, not mtime

2008-04-07 Thread Andrew Chen
Hi, I'm writing my requirements in rspec, however, I can not figure out a way to execute all specs according to alphabetical order, not by last modified time. According to the documentation, it seems like the default is by alphabetical order, I just can not get that to work. In the unit tests wi

[rspec-users] Is loadby file name order not implemented or not working? - want to run tests in file name order, not mtime order

2008-04-07 Thread Andrew Chen
Hi, I'm writing my requirements in rspec, however, I can not figure out a way to execute all specs according to alphabetical order, not by last modified time. According to the documentation, it seems like the default is by alphabetical order, I just can not get that to work. In the unit tests wit

[rspec-users] how to stub the :current_user and any methods associated with it

2008-04-07 Thread newbie
I'm new to Rspec and I'm having a bit of trouble with this controller that I'm testing. I think I'm doing it right but I guess my syntax is wrong. I'm currently using the "acts_as_authenticated" plug in. What I want to test out is EventController on entering the tickets_page - should show the tic

Re: [rspec-users] Welcome Pat Maddox

2008-04-07 Thread Chad Humphries
Congrats Pat! -- Chad On Fri, Apr 4, 2008 at 2:52 PM, Andrew WC Brown <[EMAIL PROTECTED]> wrote: > Gooble Goble, Gooble Goble, One of Us! One of Us! > > > > On Fri, Apr 4, 2008 at 2:42 PM, Brian Takita <[EMAIL PROTECTED]> wrote: > > On Fri, Apr 4, 2008 at 10:26 AM, aslak hellesoy > > <[EMAIL PRO

Re: [rspec-users] How can you delete unused view helper files?

2008-04-07 Thread Chris Olsen
Scott Taylor wrote: > On Apr 7, 2008, at 9:34 AM, Chris Olsen wrote: > >> I would like to delete most of the view helper files from my project. >> Unfortunately, when I try to run my tests it throws an error saying >> that >> one of the files is missing. > > Warning? What does it say? > > Are

Re: [rspec-users] How can you delete unused view helper files?

2008-04-07 Thread Scott Taylor
On Apr 7, 2008, at 9:34 AM, Chris Olsen wrote: > I would like to delete most of the view helper files from my project. > Unfortunately, when I try to run my tests it throws an error saying > that > one of the files is missing. Warning? What does it say? Are you throwing away the helper *AND*

[rspec-users] How can you delete unused view helper files?

2008-04-07 Thread Chris Olsen
I would like to delete most of the view helper files from my project. Unfortunately, when I try to run my tests it throws an error saying that one of the files is missing. I find that all the non-required helper files clutter things up. Is there any way to remove them and still have your tests pa

Re: [rspec-users] Advice / Turning a Usecase into a Rspec Story / Granularity ofstories

2008-04-07 Thread Bart Zonneveld
On 3-apr-2008, at 14:31, David Chelimsky wrote: > On Thu, Apr 3, 2008 at 8:25 AM, Bart Zonneveld > <[EMAIL PROTECTED]> wrote: >> >> >> On 3-apr-2008, at 14:12, Rick DeNatale wrote: >>> On Thu, Apr 3, 2008 at 5:34 AM, Ashley Moran >>> <[EMAIL PROTECTED]> wrote: On 03/04/2008, joseph <[EMAIL