Re: [rspec-users] Stories location

2007-10-15 Thread Pat Maddox
On 10/14/07, Steve <[EMAIL PROTECTED]> wrote: > Should the stories dir be located on the project root? I was expecting to > find it located under spec/ but there isn't anything there, just the > stories dir off of /. Also there don't appear to be any rake tasks for > stories, nor generators. Should

[rspec-users] Story Runner: Two 'then' steps output as 'then..and' :)

2007-10-15 Thread Andy Watts
Maybe I'm slow, but I just noticed that the following code.. When 'I login' When 'I do something else' ...will output as... When 'I login' And 'I do something else' The same is true for two 'Then' steps That is really cool! Reusable steps and coherent English output. - Andy -- View this me

Re: [rspec-users] Step matchers

2007-10-15 Thread Wincent Colaiuta
El 15/10/2007, a las 5:49, [EMAIL PROTECTED] escribió: >>> Actually a parser for this would be quite simple >> >> Dead simple. It would also allow us to do away with methods like >> Given, When and Then, which some people have objected to (because of >> the capitalization), because the stories are

[rspec-users] Story Runner: 'When..Then..Then..Then' stories

2007-10-15 Thread Andy Watts
Maybe I'm slow, but I just noticed that the following code.. Then 'I login' Then 'I do something else' ...will output as... Then 'I login' And 'I do something else' The same is true for two 'When' steps This may have implications for writing reusable steps. I'm finding that 'Then' step imple

Re: [rspec-users] Stories location

2007-10-15 Thread David Chelimsky
On 10/15/07, Steve <[EMAIL PROTECTED]> wrote: > Should the stories dir be located on the project root? I was expecting to > find it located under spec/ but there isn't anything there, just the > stories dir off of /. We want stories and specs to be parallel as they are not intended to be run toget

Re: [rspec-users] Story Runner: Two 'then' steps output as 'then..and' :)

2007-10-15 Thread David Chelimsky
On 10/15/07, Andy Watts <[EMAIL PROTECTED]> wrote: > > Maybe I'm slow, but I just noticed that the following code.. > > When 'I login' > When 'I do something else' You're encouraged to write this as: When 'I login' And 'I do something else' Cheers, David > > ...will output as... > > When 'I log

Re: [rspec-users] Step matchers

2007-10-15 Thread Tom Stuart
On 15 Oct 2007, at 10:25, Wincent Colaiuta wrote: > - The customer/client (not necessarily with any programming > knowledge) writes the stories in a format which is (almost) plain > text. > - The developer then writes custom "step matchers"; where do they go? > - How much of parsing can be genera

Re: [rspec-users] Step matchers

2007-10-15 Thread David Chelimsky
On 10/15/07, Wincent Colaiuta <[EMAIL PROTECTED]> wrote: > El 15/10/2007, a las 5:49, [EMAIL PROTECTED] escribió: > > >>> Actually a parser for this would be quite simple > >> > >> Dead simple. It would also allow us to do away with methods like > >> Given, When and Then, which some people have obj

Re: [rspec-users] Step matchers

2007-10-15 Thread David Chelimsky
On 10/15/07, Tom Stuart <[EMAIL PROTECTED]> wrote: > On 15 Oct 2007, at 10:25, Wincent Colaiuta wrote: > > - The customer/client (not necessarily with any programming > > knowledge) writes the stories in a format which is (almost) plain > > text. > > - The developer then writes custom "step matcher

Re: [rspec-users] Step matchers

2007-10-15 Thread Wincent Colaiuta
El 15/10/2007, a las 14:21, "Pat Maddox" <[EMAIL PROTECTED]> escribió: > On 10/14/07, David Chelimsky <[EMAIL PROTECTED]> wrote: >> On 10/14/07, Pat Maddox <[EMAIL PROTECTED]> wrote: >>> Actually a parser for this would be quite simple >> >> Dead simple. It would also allow us to do away with meth

Re: [rspec-users] Stories location

2007-10-15 Thread Wincent Colaiuta
El 15/10/2007, a las 14:21, "David Chelimsky" <[EMAIL PROTECTED]> escribió: > On 10/15/07, Steve <[EMAIL PROTECTED]> wrote: >> Should the stories dir be located on the project root? I was >> expecting to >> find it located under spec/ but there isn't anything there, just the >> stories dir off

Re: [rspec-users] Step matchers

2007-10-15 Thread David Chelimsky
On 10/15/07, Wincent Colaiuta <[EMAIL PROTECTED]> wrote: > El 15/10/2007, a las 14:21, "Pat Maddox" <[EMAIL PROTECTED]> escribió: > > > On 10/14/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > >> On 10/14/07, Pat Maddox <[EMAIL PROTECTED]> wrote: > >>> Actually a parser for this would be quite sim

Re: [rspec-users] Stories location

2007-10-15 Thread David Chelimsky
On 10/15/07, Wincent Colaiuta <[EMAIL PROTECTED]> wrote: > El 15/10/2007, a las 14:21, "David Chelimsky" <[EMAIL PROTECTED]> > escribió: > > > On 10/15/07, Steve <[EMAIL PROTECTED]> wrote: > >> Should the stories dir be located on the project root? I was > >> expecting to > >> find it located under

Re: [rspec-users] Step matchers

2007-10-15 Thread Wincent Colaiuta
El 15/10/2007, a las 14:21, "David Chelimsky" <[EMAIL PROTECTED]> escribió: > On 10/15/07, Wincent Colaiuta <[EMAIL PROTECTED]> wrote: >> >> - The customer/client (not necessarily with any programming >> knowledge) writes the stories in a format which is (almost) plain >> text. > > Why almost?

Re: [rspec-users] Step matchers

2007-10-15 Thread David Chelimsky
On 10/15/07, Wincent Colaiuta <[EMAIL PROTECTED]> wrote: > El 15/10/2007, a las 14:21, "David Chelimsky" <[EMAIL PROTECTED]> > escribió: > > > On 10/15/07, Wincent Colaiuta <[EMAIL PROTECTED]> wrote: > >> > >> - The customer/client (not necessarily with any programming > >> knowledge) writes the st

Re: [rspec-users] Step matchers

2007-10-15 Thread David Chelimsky
On 10/15/07, Alvin Schur <[EMAIL PROTECTED]> wrote: > Message: 7 > > Date: Sun, 14 Oct 2007 18:04:33 -0500 > > From: "David Chelimsky" <[EMAIL PROTECTED]> > > Subject: Re: [rspec-users] Step matchers > > To: rspec-users > > Message-ID: > > <[EMAIL PROTECTED]> > > Content-Type: text/plain; ch

Re: [rspec-users] Step matchers

2007-10-15 Thread Mike Vincent
On 10/15/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > Having this expression of stories and scenarios appearing devoid of > programmatic ideas has great potential to help the customers feel > ownership over stories/scenarios. Of course, there is an underlying > relationship to syntax that they'

Re: [rspec-users] Step matchers

2007-10-15 Thread Pat Maddox
On 10/15/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 10/15/07, Wincent Colaiuta <[EMAIL PROTECTED]> wrote: > > El 15/10/2007, a las 5:49, [EMAIL PROTECTED] escribió: > > > > >>> Actually a parser for this would be quite simple > > >> > > >> Dead simple. It would also allow us to do away wit

Re: [rspec-users] Step matchers

2007-10-15 Thread Alvin Schur
Message: 7 > Date: Sun, 14 Oct 2007 18:04:33 -0500 > From: "David Chelimsky" <[EMAIL PROTECTED]> > Subject: Re: [rspec-users] Step matchers > To: rspec-users > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=ISO-8859-1 > > On 10/14/07, David Chelimsky <[EMAIL PROTECTED]

Re: [rspec-users] Step matchers

2007-10-15 Thread Wincent Colaiuta
El 15/10/2007, a las 17:01, "David Chelimsky" <[EMAIL PROTECTED]> escribió: > Part of this is to separate the programming 'noise' from the text, so > if we do head down this path (which remains to be seen) I doubt these > would end up in the same file. Thinking about this, the only way to reall

Re: [rspec-users] Step matchers

2007-10-15 Thread James Hughes
On 10/15/07, Wincent Colaiuta <[EMAIL PROTECTED]> wrote: > El 15/10/2007, a las 14:21, "David Chelimsky" <[EMAIL PROTECTED]> > escribió: > > > On 10/15/07, Wincent Colaiuta <[EMAIL PROTECTED]> wrote: > >> > >> - The customer/client (not necessarily with any programming > >> knowledge) writes the st

[rspec-users] Spec::Rails::DSL::HelperEvalContextController: missing defau

2007-10-15 Thread Chris Olsen
Just created a new project and this is the error that I am getting when I try to run my rspec tests: Spec::Rails::DSL::HelperEvalContextController: missing default helper path spec/rails/dsl/helper_eval_context_helper Spec::Rails::DSL::ViewExampleController: missing default helper path spec/rails/

Re: [rspec-users] Spec::Rails::DSL::HelperEvalContextController: missing defau

2007-10-15 Thread David Chelimsky
On 10/15/07, Chris Olsen <[EMAIL PROTECTED]> wrote: > Just created a new project and this is the error that I am getting when > I try to run my rspec tests: Please just call them "specs" :) What command are you using here? > > Spec::Rails::DSL::HelperEvalContextController: missing default helper

Re: [rspec-users] Spec::Rails::DSL::HelperEvalContextController: missing d

2007-10-15 Thread Chris Olsen
> Please just call them "specs" :) done > What command are you using here? it happens for both "rake spec" and autotest -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/lis

Re: [rspec-users] Story Runner: Readability of output with multiple params

2007-10-15 Thread Dan North
Of the options on the table, I prefer "using $placeholder values" because then it tells me the role the value plays in the sentence. Even Pat's version works by defining the $placeholders outside of the step. In a "library" somewhere (we still need to define what a story/step library is or looks l

[rspec-users] Top Quoting?

2007-10-15 Thread s.ross
Sort of off-topic and don't mean to complain, but many on this list use top quoting. That works ok if you don't quote the whole previous thread. However, I'm finding that scrolling forever to locate the reply on longer threads is getting tedious. What's the rationale for top-quoting? Thx.

[rspec-users] TextMate File Type Detection for RSpec & Rails

2007-10-15 Thread Carl Porth
For those of you struggling with TextMate not properly detecting rspec files, Allan Odgaard (the author of TextMate) has kindly provided a tutorial on how to set up TextMate to associate all .rb files with rails and all _spec.rb files with rspec. http://macromates.com/blog/2007/file-type-det

Re: [rspec-users] Top Quoting?

2007-10-15 Thread Jonathan Linowes
+1 On Oct 15, 2007, at 2:38 PM, s.ross wrote: > Sort of off-topic and don't mean to complain, but many on this list > use top quoting. That works ok if you don't quote the whole previous > thread. However, I'm finding that scrolling forever to locate the > reply on longer threads is getting tedio

Re: [rspec-users] Top Quoting?

2007-10-15 Thread James Hughes
On 10/15/07, Jonathan Linowes <[EMAIL PROTECTED]> wrote: > +1 > > On Oct 15, 2007, at 2:38 PM, s.ross wrote: > > > Sort of off-topic and don't mean to complain, but many on this list > > use top quoting. That works ok if you don't quote the whole previous > > thread. However, I'm finding that scrol

Re: [rspec-users] Top Quoting?

2007-10-15 Thread aslak hellesoy
Good point. Reminds me of this classic: A: Because it breaks the logical sequence of the discussion. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? On 10/15/07, s.ross <[EMAIL PROTECTED]> wrote: > Sort of off-topic and don't mea

[rspec-users] intro article

2007-10-15 Thread Jonathan Linowes
fyi http://www.vaporbase.com/postings/ Beginners_Guide_to_Rspec_on_Story_Runner ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Top Quoting?

2007-10-15 Thread Jay Levitt
On 10/15/2007 5:04 PM, aslak hellesoy wrote: > Good point. Reminds me of this classic: > > A: Because it breaks the logical sequence of the discussion. > Q: Why is top-posting such a bad thing? > A: Top-posting. > Q: What is the most annoying thing on usenet and in e-mail? > > On 10/15/07, s.ross

Re: [rspec-users] Top Quoting?

2007-10-15 Thread Pat Maddox
On 10/15/07, Jay Levitt <[EMAIL PROTECTED]> wrote: > On 10/15/2007 5:04 PM, aslak hellesoy wrote: > > Good point. Reminds me of this classic: > > > > A: Because it breaks the logical sequence of the discussion. > > Q: Why is top-posting such a bad thing? > > A: Top-posting. > > Q: What is the most

Re: [rspec-users] Top Quoting?

2007-10-15 Thread Shane Mingins
Just wondering On 10/16/07, Pat Maddox <[EMAIL PROTECTED]> wrote: > Personally, I'd prefer it if people don't top-post but I don't care sideposting > too too much. I just stick with whatever app

Re: [rspec-users] Step matchers

2007-10-15 Thread Pat Maddox
On 10/15/07, James Hughes <[EMAIL PROTECTED]> wrote: > On 10/15/07, Wincent Colaiuta <[EMAIL PROTECTED]> wrote: > > El 15/10/2007, a las 14:21, "David Chelimsky" <[EMAIL PROTECTED]> > > escribió: > > > > > On 10/15/07, Wincent Colaiuta <[EMAIL PROTECTED]> wrote: > > >> > > >> - The customer/client

Re: [rspec-users] Top Quoting?

2007-10-15 Thread Pat Maddox
Wait, actually it looks like OP is asking about top-quoting, and you're responding about top-posting. Top-posting is what I'm doing right now, and apparently is what OP would prefer? I'm so confused now (especially after Shane's sideposting prank!). On 10/15/07, aslak hellesoy <[EMAIL PROTECTED]

Re: [rspec-users] Top Quoting?

2007-10-15 Thread Jonathan Linowes
Not to beat an already beaten horse, but... I see email more as a dynamic information flow than a static page, especially active conversations like this, so I like to see the current response at the top, immediately accessible, and visible in my preview pane. Or, maybe I should look for a mail read

Re: [rspec-users] Top Quoting?

2007-10-15 Thread Luis Lavena
On 10/15/07, Pat Maddox <[EMAIL PROTECTED]> wrote: > I think one problem is that GMail encourages you to top-post. Not > everybody uses gmail of course, but a lot of devs do. I'm probably > guilty of not trimming enough because GMail folds that stuff out of > the way for me. > I guess is not qui

Re: [rspec-users] Step matchers

2007-10-15 Thread Jay Levitt
On 10/15/2007 10:11 AM, Wincent Colaiuta wrote: > El 15/10/2007, a las 14:21, "Pat Maddox" <[EMAIL PROTECTED]> escribió: >> Jay mentioned antlr. This parser is so simple though that I doubt we >> would need/want that. There's not really any parsing at all in fact. >> You just look at each line, f

Re: [rspec-users] Step matchers

2007-10-15 Thread Jay Levitt
On 10/15/2007 6:11 PM, Pat Maddox wrote: > On 10/15/07, James Hughes <[EMAIL PROTECTED]> wrote: >> Just wanted to chime in and say, as a regular user of the folding >> features of the editor, this is what really resonated with me when >> Story Runner was first introduced. In fact, I recently did a

Re: [rspec-users] Step matchers

2007-10-15 Thread Pat Maddox
On 10/15/07, Jay Levitt <[EMAIL PROTECTED]> wrote: > On 10/15/2007 6:11 PM, Pat Maddox wrote: > > On 10/15/07, James Hughes <[EMAIL PROTECTED]> wrote: > >> Just wanted to chime in and say, as a regular user of the folding > >> features of the editor, this is what really resonated with me when > >>

Re: [rspec-users] Top Quoting?

2007-10-15 Thread Wincent Colaiuta
El 16/10/2007, a las 0:58, Jay Levitt <[EMAIL PROTECTED]> escribió: > Yeah.. this is an age-old Internet debate, of course, but I think the > problem is that (a) we're all top-quoting but (b) we're never > trimming, > not even the mailing-list footer. > > If you're gonna top-quote/bottom-post

Re: [rspec-users] Step matchers

2007-10-15 Thread David Chelimsky
On 10/15/07, Pat Maddox <[EMAIL PROTECTED]> wrote: > Well, I'm not sure that anyone was suggesting that we ditch the > current way. I certainly wasn't. If you want to embed code then you > can. Actually - if we do go down this path, I'd like to see the embedded code go away. The structure that e

Re: [rspec-users] Top Quoting?

2007-10-15 Thread David Chelimsky
On 10/15/07, Wincent Colaiuta <[EMAIL PROTECTED]> wrote: > Some prefer top-posting, others bottom-posting (I fall into this > latter group), but I think that whichever way people decide to go, > they would do us all a great service by trimming down the quoted > section to only the relevant parts.

Re: [rspec-users] Top Quoting?

2007-10-15 Thread Nathan Sutton
> This is especially true in cases where the reply might be two or > three lines long, and the untrimmed quoted message stretches on for > screenfuls. I totally agree, in fact I let most of these conversations just pass by because it's too much work to sift through all the nested quotes. I'd

Re: [rspec-users] Top Quoting?

2007-10-15 Thread s.ross
On Oct 15, 2007, at 4:35 PM, Nathan Sutton wrote: >> This is especially true in cases where the reply might be two or >> three lines long, and the untrimmed quoted message stretches on for >> screenfuls. > > I totally agree, in fact I let most of these conversations just pass > by because it's too

Re: [rspec-users] Step matchers

2007-10-15 Thread Zach Dennis
I agree with the start of this thread with Pat Maddox stating, "I think we all know that the readability of steps isn't great right now..." My argument in the thread [0, 1] that may have sparked Pat's initial implementation of StepMatcher's asked the question about what value is being added

Re: [rspec-users] Top Quoting?

2007-10-15 Thread George Anderson
> Yes? What was the question, again? /g ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Step matchers

2007-10-15 Thread Pat Maddox
On 10/15/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > To me adding a story parser to parse a text file adds overhead to the > rspec team and to developers and customers using it. In a way I fear > that the textual freedom of a raw text file will lead to many gray > area's both on the rspec's implem

Re: [rspec-users] Step matchers

2007-10-15 Thread Zach Dennis
On 10/15/07, Pat Maddox <[EMAIL PROTECTED]> wrote: > On 10/15/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > > To me adding a story parser to parse a text file adds overhead to the > > rspec team and to developers and customers using it. In a way I fear > > that the textual freedom of a raw text file

Re: [rspec-users] Step matchers

2007-10-15 Thread Wincent Colaiuta
El 16/10/2007, a las 2:44, "Pat Maddox" <[EMAIL PROTECTED]> escribió: >> Wincet Colaitua brings up a good point [3] in regards to >> StepMatchers: >> >> "My main concern here is that you're now having to keep two >> files in >> sync to have the stories work properly." > > Perhaps there was

Re: [rspec-users] Step matchers

2007-10-15 Thread Zach Dennis
On 10/15/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > On 10/15/07, Pat Maddox <[EMAIL PROTECTED]> wrote: > > On 10/15/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > > > To me adding a story parser to parse a text file adds overhead to the > > > rspec team and to developers and customers using it. In

Re: [rspec-users] Step matchers

2007-10-15 Thread David Chelimsky
On 10/15/07, Wincent Colaiuta <[EMAIL PROTECTED]> wrote: > If the conventions are kept reasonably tight then this concern could > be largely ameliorated with a good automated tool for generating an > ".rb" file from an ".story" file, or updating an existing ".rb" file > from an updated ".story" fil

Re: [rspec-users] Story Runner: Finally understand when steps are reusable.

2007-10-15 Thread Andy Watts
Thanks David, After rereading Dan's original rbehave introduction, i see its important to think of steps are either 1. Givens 2. Events (When) 3. Outcomes (Then) In a 'Then..And' scenario, the 'And' is an Outcome and therefore reusable only as an outcome. That is, either 'Then' or a in another

Re: [rspec-users] Step matchers

2007-10-15 Thread David Chelimsky
On 10/15/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > What are your thoughts about using symbol identifiers rather then > question marks? I think this increases readability and gets rid of > ambiguity at least for me. > > step "a user named :username" do |username| > > end I think that I'm

[rspec-users] Example for attr_accessible?

2007-10-15 Thread Steve
Is anyone out there writing specs to check attr_accessible fields? I had originally written my spec to check for allowing the desired fields, and then none of the other regular db fields. Unfortunately this isn't satisfactory, because attr_protected could have been used instead, which of course wou

Re: [rspec-users] Step matchers

2007-10-15 Thread James Hughes
On 10/15/07, Wincent Colaiuta <[EMAIL PROTECTED]> wrote: > > I really think it's important that this thing, whatever it ends up > looking like, be nice for programmers to use, not just programmer's > customers. > > Cheers, > Wincent > > > ___ > rspec-user

Re: [rspec-users] Step matchers

2007-10-15 Thread James Hughes
On 10/15/07, Wincent Colaiuta <[EMAIL PROTECTED]> wrote: > I really think it's important that this thing, whatever it ends up > looking like, be nice for programmers to use, not just programmer's > customers. +1 > > Cheers, > Wincent > ___ rspec-users

[rspec-users] generate script_controller not creating test code

2007-10-15 Thread Chris Olsen
For some reason when I ran it this time it decided not to create any view or controller tests. I had already created the corresponding model with the rpsec_model script before trying to create the controller. I am not sure if there is something that I did incorrectly or not. Does anyone know why

Re: [rspec-users] generate script_controller not creating test code

2007-10-15 Thread Steve
On Tue, 16 Oct 2007 04:44:55 +0200, Chris Olsen wrote: > For some reason when I ran it this time it decided not to create any > view or controller tests. I had already created the corresponding model > with the rpsec_model script before trying to create the controller. I > am not sure if there i

Re: [rspec-users] generate script_controller not creating test code

2007-10-15 Thread Chris Olsen
please disregard this post. I got a little a head of myself and forgot that they were only created with the rspec_scaffold script. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/ma

Re: [rspec-users] generate script_controller not creating test code

2007-10-15 Thread Chris Olsen
Steve wrote: > On Tue, 16 Oct 2007 04:44:55 +0200, Chris Olsen wrote: > >> For some reason when I ran it this time it decided not to create any >> view or controller tests. I had already created the corresponding model >> with the rpsec_model script before trying to create the controller. I >> a

Re: [rspec-users] Step matchers

2007-10-15 Thread David Chelimsky
On 10/15/07, James Hughes <[EMAIL PROTECTED]> wrote: > On 10/15/07, Wincent Colaiuta <[EMAIL PROTECTED]> wrote: > > I really think it's important that this thing, whatever it ends up > > looking like, be nice for programmers to use, not just programmer's > > customers. > > +1 I think what we're pr

[rspec-users] Failure trying to test ApplicationController

2007-10-15 Thread Steve
I'm trying to write some tests for the ApplicationController as shared tests that can be run in all of my other controller tests, but am getting a nil.rewrite error. Below is what I have... describe AccountController do it_should_behave_like 'Application controller' end describe 'Application

Re: [rspec-users] stubbing a method that yeilds sequential results

2007-10-15 Thread Mikel Lindsaar
Nice :) On 10/14/07, rupert <[EMAIL PROTECTED]> wrote: > > On 14 Oct 2007, at 08:28, Mikel Lindsaar wrote: > > > On 8/13/07, rupert <[EMAIL PROTECTED]> wrote: > >> On 12 Aug 2007, at 14:38, David Chelimsky wrote: > However, what I actually need to do is check each result that is > yielde

Re: [rspec-users] Failure trying to test ApplicationController

2007-10-15 Thread David Chelimsky
On 10/15/07, Steve <[EMAIL PROTECTED]> wrote: > I'm trying to write some tests for the ApplicationController as shared > tests that can be run in all of my other controller tests, but am getting > a nil.rewrite error. Below is what I have... > > describe AccountController do > it_should_behave_li

Re: [rspec-users] Failure trying to test ApplicationController

2007-10-15 Thread Steve
On Mon, 15 Oct 2007 23:46:32 -0500, David Chelimsky wrote: > On 10/15/07, Steve <[EMAIL PROTECTED]> wrote: >> I'm trying to write some tests for the ApplicationController as shared >> tests that can be run in all of my other controller tests, but am getting >> a nil.rewrite error. Below is what I

Re: [rspec-users] Failure trying to test ApplicationController

2007-10-15 Thread David Chelimsky
On 10/15/07, Steve <[EMAIL PROTECTED]> wrote: > I'm trying to write some tests for the ApplicationController as shared > tests that can be run in all of my other controller tests, but am getting > a nil.rewrite error. Below is what I have... > > describe AccountController do > it_should_behave_li

Re: [rspec-users] Failure trying to test ApplicationController

2007-10-15 Thread Steve
On Tue, 16 Oct 2007 00:26:13 -0500, David Chelimsky wrote: > > You get responses (i.e. the response object in the spec) from actions > using get, post, put, delete, not by calling methods directly on the > controller. > > Part of the problem is that you're trying to spec something that > already

Re: [rspec-users] Failure trying to test ApplicationController

2007-10-15 Thread David Chelimsky
On 10/16/07, Steve <[EMAIL PROTECTED]> wrote: > On Tue, 16 Oct 2007 00:26:13 -0500, David Chelimsky wrote: > > Part of the problem is that you're trying to spec something that > > already exists. Developing spec-first, you wouldn't likely end up with > > this problem because this method would have

[rspec-users] Stub ActionController::Base#params

2007-10-15 Thread Jed Hurt
Has anyone had any success stubbing ActionController::Base#params? The following is not intercepting calls to params[:foo] in my controllers: ActionController::Base.stub!(:params).and_return(:foo => 'bar') ___ rspec-users mailing list rspec-users@rubyfor

Re: [rspec-users] Stub ActionController::Base#params

2007-10-15 Thread Jed Hurt
Nevermind! I figured out that (in my case) I simply needed to instantiate an instance of ActionController::Base and then stub the methods on the instance: @controller = ActionController::Base.new @controller.stub!(:params).and_return(:foo => 'bar') I then run my expectations against @controller, w

Re: [rspec-users] Failure trying to test ApplicationController

2007-10-15 Thread Steve
On Tue, 16 Oct 2007 01:02:58 -0500, David Chelimsky wrote: > But how do you know that it's being used? The behaviour you're > spec'ing is that a given action should redirect if the user is not > logged in, right? If you look at it that way, then it seems perfectly > acceptable to do this: > > des

[rspec-users] Named routes in controller not working?

2007-10-15 Thread Steve
I have some "redirect_to"s using named routes in a controller that work fine in the browser, but choke my tests. The route in question is "new_session" and comes from a "map.resource :session, :controller => :session" route mapping. If I replace the named route in the controller with controller/act

Re: [rspec-users] Named routes in controller not working?

2007-10-15 Thread Steve
On Tue, 16 Oct 2007 06:45:53 +, Steve wrote: > I have some "redirect_to"s using named routes in a controller that work > fine in the browser, but choke my tests. The route in question is > "new_session" and comes from a "map.resource :session, :controller => > :session" route mapping. If I rep