Re: [rspec-users] request.params causing errors

2008-04-11 Thread David Chelimsky
On Apr 11, 2008, at 3:53 PM, Olivier Dupuis wrote: Sorry about that. Here goes... Spec: describe "/search/index" do it "should have option to login" do render "/search/index" response.should have_text(/Login/) end end Code for index.rhtml

Re: [rspec-users] request.params causing errors

2008-04-11 Thread Olivier Dupuis
Sorry about that. Here goes... Spec: *describe "/search/index" do it "should have option to login" do render "/search/index" response.should have_text(/Login/) end end* Code for index.rhtml * <%= render_component :controller => "com

Re: [rspec-users] request.params causing errors

2008-04-11 Thread David Chelimsky
Please post spec, code and error message. On Apr 11, 2008, at 3:21 PM, Olivier Dupuis wrote: > Hello, > > I have a rhtml file that goes through the request.params. One of my > test generates that file, but rspec pops an error saying : > > undefined method 'params' for ... > > I'm not sure what

[rspec-users] request.params causing errors

2008-04-11 Thread Olivier Dupuis
Hello, I have a rhtml file that goes through the request.params. One of my test generates that file, but rspec pops an error saying : undefined method 'params' for ... I'm not sure what to do with this, since request.params actually works with rails. Any idea? Thank you Olivier Dupuis __

[rspec-users] Easy way to specify protocol for a controller spec?

2008-04-11 Thread Will Sargent
Hi all, I'd like to add some controller specs that use HTTPS rather than HTTP. I've poked a bit into the get() and post() methods that are provided by ControllerTestCase, but it doesn't seem as though there's an easy way to specify that it should be using SSL from there. In ActionController, I c

Re: [rspec-users] Does Ctrl-Shift-V in Textmate ever annoy you as an RSpec user?

2008-04-11 Thread David Chelimsky
On Apr 11, 2008, at 2:29 PM, Rick DeNatale wrote: > I love the TextMate feature of syntax checking ruby source with ^V. > But often when I use it in an RSpec example group or a story steps > file, I run into the problem that, although the file is syntactically > correct, I get all kinds of warning

[rspec-users] Does Ctrl-Shift-V in Textmate ever annoy you as an RSpec user?

2008-04-11 Thread Rick DeNatale
I love the TextMate feature of syntax checking ruby source with ^V. But often when I use it in an RSpec example group or a story steps file, I run into the problem that, although the file is syntactically correct, I get all kinds of warnings like: line 44: warning: useless use of '==' in void

Re: [rspec-users] mock_model outside of rails

2008-04-11 Thread David Chelimsky
On Apr 11, 2008, at 10:56 AM, Eric Smith wrote: > Hello all. I have a quick mock_model question. Is there a way to > use it when doing ActiveRecord testing outside of rails? Right now you can't because it's defined in the RailsExampleGroup. Why don't you put in a feature request to have it e

[rspec-users] mock_model outside of rails

2008-04-11 Thread Eric Smith
Hello all. I have a quick mock_model question. Is there a way to use it when doing ActiveRecord testing outside of rails? What I want to be able to do with my ActiveRecord is this: class Child belongs_to :parent end child.parent = mock_model(Parent) Now in rails I can do this, be

[rspec-users] autotest only passing spec files to rspec once

2008-04-11 Thread Andy Orahood
When I run autotest it works fine the first time, generating the command line: /usr/bin/ruby1.8 -S script/spec -O spec/spec.opts spec/models/timespan_spec.rb spec/models/article_spec.rb ... and all my specs get run. After the first runthrough, however, autotest pauses for a second and then, with

Re: [rspec-users] Stories - Use view matchers rather than assigns[].should?

2008-04-11 Thread David Chelimsky
On Apr 11, 2008, at 8:15 AM, David Chelimsky wrote: On Apr 11, 2008, at 4:44 AM, Ashley Moran <[EMAIL PROTECTED] > wrote: On 11 Apr 2008, at 03:14, Rick DeNatale wrote: I'm thinking that I might just write a whole new xxx_steps.rb file which would run the same story but at the real user i

Re: [rspec-users] Stories - Use view matchers rather than assigns[].should?

2008-04-11 Thread David Chelimsky
On Apr 11, 2008, at 4:44 AM, Ashley Moran <[EMAIL PROTECTED]> wrote: > > On 11 Apr 2008, at 03:14, Rick DeNatale wrote: > >> I'm thinking that I might just write a whole new xxx_steps.rb file >> which would run the same story but at the real user interaction >> level, >> and keep the model lev

Re: [rspec-users] newbq: Organizing your stories

2008-04-11 Thread Kyle Hargraves
On Fri, Apr 11, 2008 at 3:43 AM, Ashley Moran <[EMAIL PROTECTED]> wrote: > > On 11 Apr 2008, at 05:16, Zach Dennis wrote: > > > - stories/ > > - projects/ > > - a_user_creating_a_project_story > > - a_project_manager_adding_users_to_a_project_story > > - admin/ > >

Re: [rspec-users] newbq: Organizing your stories

2008-04-11 Thread David Chelimsky
On Apr 11, 2008, at 4:43 AM, Ashley Moran <[EMAIL PROTECTED]> wrote: > > On 11 Apr 2008, at 05:16, Zach Dennis wrote: > >> - stories/ >>- projects/ >> - a_user_creating_a_project_story >> - a_project_manager_adding_users_to_a_project_story >>- admin/ >> - an_admin_removing

Re: [rspec-users] Stories - Use view matchers rather than assigns[].should?

2008-04-11 Thread Ashley Moran
On 11 Apr 2008, at 03:14, Rick DeNatale wrote: > I'm thinking that I might just write a whole new xxx_steps.rb file > which would run the same story but at the real user interaction level, > and keep the model level steps also. I still haven't convinced myself > one way or the other. Wow, I had

Re: [rspec-users] newbq: Organizing your stories

2008-04-11 Thread Ashley Moran
On 11 Apr 2008, at 05:16, Zach Dennis wrote: > - stories/ > - projects/ > - a_user_creating_a_project_story > - a_project_manager_adding_users_to_a_project_story > - admin/ > - an_admin_removing_users_story > > I use stories as system level integration tests, so they us

Re: [rspec-users] Multi-line steps

2008-04-11 Thread Ashley Moran
On 11 Apr 2008, at 03:03, Rick DeNatale wrote: > And I wouldn't think that most reasonable systems would disable > Lisa1's account because some Lisa2 tried and failed to use the same > name. Somebody, somewhere has built a system that does this. You know it. -- http://www.patchspace.co.uk

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

2008-04-11 Thread Jarkko Laine
On 11.4.2008, at 4.57, newbie wrote: Thanks for the direction. I'm glad to hear that I'm going in the right direction. I just have a final question and I seem to be hitting a stub/mocking road block at the moment. In my controller I have this... def index @entries = current_user.entries end H