Re: [rspec-users] Problems with raising errors on a mocked object

2007-08-08 Thread Eivind Uggedal
Thanks, that worked great after I had mocked out the ActiveRecord::Errors::full_messages: http://pastie.caboo.se/85887 Cheers, Eivind Uggedal On 8/8/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 8/8/07, Eivind Uggedal <[EMAIL PROTECTED]> wrote: > > Here you go: http://pastie.caboo.se/85876

[rspec-users] RSpec book?

2007-08-08 Thread Ashley Moran
Came across this as a stub page browsing Amazon UK. This is good news! I'm surprised it hasn't been discussed on the list before. Was Chad keeping it a secret? I hope it will have plenty of BDD theory. I'm still waiting for that ma

[rspec-users] Problems with RESTfully generated helpers

2007-08-08 Thread Lance Carlson
I am using helper the RESTfully generated helper methods in my views. My routes are nested so the helpers appear to need arguments passed to them, but it works without arguments. Say for example I have pages and comments. If I do page_comments_path without parameters, it works. However, when I run

Re: [rspec-users] RSpec book?

2007-08-08 Thread Kevin Williams
I can't wait to read this. If IronRuby ever supports RSpec, I'll give a copy of this book to all my .NET cronies and say just what Ashley said. :) On 8/8/07, Ashley Moran <[EMAIL PROTECTED]> wrote: > > > Came across this as a stub page browsi

Re: [rspec-users] Problems with RESTfully generated helpers

2007-08-08 Thread David Chelimsky
On 8/8/07, Lance Carlson <[EMAIL PROTECTED]> wrote: > I am using helper the RESTfully generated helper methods in my views. > My routes are nested so the helpers appear to need arguments passed to > them, but it works without arguments. Say for example I have pages and > comments. If I do page_comm

Re: [rspec-users] Problems with RESTfully generated helpers

2007-08-08 Thread Lance Carlson
ActionView::TemplateError in 'Edit Artist Page should render the edit artist form' label_artist_url failed to generate from {:controller=>"artists", :action=>"show"} - you may have ambiguous routes, or you may need to supply additional parameters for this route. content_url has the following requi

Re: [rspec-users] RSpec book?

2007-08-08 Thread Scott Taylor
Speaking of a BDD book, does anyone recommend Dave Astels book? Or should I assume I doing "testing well" if I'm using rspec? Scott On Aug 8, 2007, at 5:53 AM, Ashley Moran wrote: > > > Came across this as a stub page browsing Amazon UK

[rspec-users] Transactional fixtures not working as expected

2007-08-08 Thread Michael Hamann
Hi! I am quite new to BDD and I just wrote my first tests. Suddenly I received unexpected results because in a model test I load only users-fixtures but when the views-fixtures in which I load the posts-fixtures, are run before this model-test, the posts-fixtures are loaded too. I test for example

Re: [rspec-users] Problems with RESTfully generated helpers

2007-08-08 Thread Lance Carlson
I just passed label_artist_path(@label.id, @artist.id) into the view and it worked.. but I really don't want to have to pass those parameters in all my views. It looks ugly. Does anyone know a way around this without stubbing? It seems useless to test this view without allowing those methods to act

Re: [rspec-users] RSpec book?

2007-08-08 Thread Pat Maddox
It's dated, as far as the Java side goes. A lot of the examples don't work anymore. This wouldn't be a problem if it were just writing classes and text-based programs (because then it's cake to do it in Ruby ;), but in his example he creates a full-blown GUI app. So it's kind of hard to follow a

Re: [rspec-users] Problems with RESTfully generated helpers

2007-08-08 Thread David Chelimsky
On 8/8/07, Lance Carlson <[EMAIL PROTECTED]> wrote: > I just passed label_artist_path(@label.id, @artist.id) into the view > and it worked.. but I really don't want to have to pass those > parameters in all my views. It looks ugly. Does anyone know a way > around this without stubbing? It seems use

Re: [rspec-users] Problems with RESTfully generated helpers

2007-08-08 Thread Lance Carlson
All I'm doing is passing the instance variables @label and @artist in the controller to the view using this code: @label = current_user.labels.find(params[:label_id]) @artist = params[:id].nil? ? Artist.new : @label.artists.find(params[:id]) By sending these two instance variables to the view, I

Re: [rspec-users] Problems with RESTfully generated helpers

2007-08-08 Thread David Chelimsky
On 8/8/07, Lance Carlson <[EMAIL PROTECTED]> wrote: > All I'm doing is passing the instance variables @label and @artist in > the controller to the view using this code: > > @label = current_user.labels.find(params[:label_id]) > @artist = params[:id].nil? ? Artist.new : @label.artists.find(params[:

Re: [rspec-users] Problems with RESTfully generated helpers

2007-08-08 Thread Lance Carlson
I just visited the action in my browser and i don't get any errors. I am also running on edge rails as the application relies on ActiveResource. Can you show me the code you created? On 8/8/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 8/8/07, Lance Carlson <[EMAIL PROTECTED]> wrote: > > All

Re: [rspec-users] using RSpec's trunk in non-rails projects w/ Autotest

2007-08-08 Thread Nick Sieger
On 8/6/07, Scott Taylor <[EMAIL PROTECTED]> wrote: > > > I believe for rails projects you can put rspec's code repos into > vendor/plugins, and autotest will automatically use the rspec binary > in that directory, and not the gem installed. > > Is there an easy way to do this for non-rails projects

Re: [rspec-users] using RSpec's trunk in non-rails projects w/ Autotest

2007-08-08 Thread Scott Taylor
Hey Nick, Good to hear from you (as the original developer of the autotest compatibility issue). I was working on the same issue David was (to fix autotest to work for RSpec's trunk), only to find that David had modified it. I have refactored the autotest plugin to use vendor/plugin/rspec/b

Re: [rspec-users] using RSpec's trunk in non-rails projects w/ Autotest

2007-08-08 Thread David Chelimsky
On 8/8/07, Scott Taylor <[EMAIL PROTECTED]> wrote: > I was working on the same issue David was (to fix autotest to work > for RSpec's trunk), only to find that David had modified it. Sorry - I saw the RFE and was taking a look at solutions and it was too easy to not just do. > I have refactored t

Re: [rspec-users] using RSpec's trunk in non-rails projects w/ Autotest

2007-08-08 Thread Scott Taylor
On Aug 8, 2007, at 4:30 PM, David Chelimsky wrote: > On 8/8/07, Scott Taylor <[EMAIL PROTECTED]> wrote: >> I was working on the same issue David was (to fix autotest to work >> for RSpec's trunk), only to find that David had modified it. > > Sorry - I saw the RFE and was taking a look at solution

Re: [rspec-users] using RSpec's trunk in non-rails projects w/ Autotest

2007-08-08 Thread David Chelimsky
On 8/8/07, Scott Taylor <[EMAIL PROTECTED]> wrote: > > On Aug 8, 2007, at 4:30 PM, David Chelimsky wrote: > > > On 8/8/07, Scott Taylor <[EMAIL PROTECTED]> wrote: > >> I was working on the same issue David was (to fix autotest to work > >> for RSpec's trunk), only to find that David had modified it

Re: [rspec-users] Problems with RESTfully generated helpers

2007-08-08 Thread Lance Carlson
David, I know for a fact that these helpers do not require arguments to be sent to them. Does anyone have any idea why rspec is forcing this to happen? On 8/8/07, Lance Carlson <[EMAIL PROTECTED]> wrote: > I just visited the action in my browser and i don't get any errors. I > am also running on e

Re: [rspec-users] Problems with RESTfully generated helpers

2007-08-08 Thread Jay Levitt
David Chelimsky wrote: > On 8/8/07, Lance Carlson <[EMAIL PROTECTED]> wrote: >> All I'm doing is passing the instance variables @label and @artist in >> the controller to the view using this code: >> >> @label = current_user.labels.find(params[:label_id]) >> @artist = params[:id].nil? ? Artist.new

Re: [rspec-users] Problems with RESTfully generated helpers

2007-08-08 Thread Lance Carlson
Yes, map.resources :labels do |label| label.resources :artists end On 8/8/07, Jay Levitt <[EMAIL PROTECTED]> wrote: > David Chelimsky wrote: > > On 8/8/07, Lance Carlson <[EMAIL PROTECTED]> wrote: > >> All I'm doing is passing the instance variables @label and @artist in > >> the controll

[rspec-users] Can't seem to spec a ActiveRecord::RecordInvalid exception properly...

2007-08-08 Thread Fischer, Daniel
1 def create 2 @user = User.new(params[:user]) 3 @user.save! 4 self.current_user = @user 5 redirect_to user_path(@user) 6 flash[:notice] = "Thanks for signing up!" 7 rescue ActiveRecord::RecordInvalid 8 render :action => 'new' 9 end I can't seem to properly s

Re: [rspec-users] Can't seem to spec a ActiveRecord::RecordInvalid exception properly...

2007-08-08 Thread Lance Carlson
Does it redirect instead? On 8/8/07, Fischer, Daniel <[EMAIL PROTECTED]> wrote: > 1 def create > 2 @user = User.new(params[:user]) > 3 @user.save! > 4 self.current_user = @user > 5 redirect_to user_path(@user) > 6 flash[:notice] = "Thanks for signing up!" > 7 rescue

Re: [rspec-users] Can't seem to spec a ActiveRecord::RecordInvalid exception properly...

2007-08-08 Thread Fischer, Daniel
It's redirecting to /users/1 so it's not causing a fail on the exception, which I don't know why. My question is how to properly do this in rSpec? On 8/8/07, Lance Carlson <[EMAIL PROTECTED]> wrote: > > Does it redirect instead? > > On 8/8/07, Fischer, Daniel <[EMAIL PROTECTED]> wrote: > > 1 de

[rspec-users] rspec with autotest on a windows machine

2007-08-08 Thread David Parker
Hello all, I'm new to rSpec but after reading a couple of tutorials I've become enamored. Anyway, I am at minute 42 of the rSpec basics screencast ( peepcode.com) and I'm having the following error running autotest w/rSpec: D:\ruby\projects\forecaster>autotest loading autotest/rails_rspec c:\ruby\

Re: [rspec-users] Can't seem to spec a ActiveRecord::RecordInvalid exception properly...

2007-08-08 Thread Lance Carlson
Is it redirecting or is it rendering new? On 8/8/07, Fischer, Daniel <[EMAIL PROTECTED]> wrote: > It's redirecting to /users/1 so it's not causing a fail on the exception, > which I don't know why. My question is how to properly do this in rSpec? > > > On 8/8/07, Lance Carlson <[EMAIL PROTECTED]>

Re: [rspec-users] rspec with autotest on a windows machine

2007-08-08 Thread Scott Taylor
Do you have spec/spec.opts? Scott On Aug 8, 2007, at 5:25 PM, David Parker wrote: > Hello all, > I'm new to rSpec but after reading a couple of tutorials I've > become enamored. Anyway, I am at minute 42 of the rSpec basics > screencast ( peepcode.com) and I'm having the following error

Re: [rspec-users] Can't seem to spec a ActiveRecord::RecordInvalid exception properly...

2007-08-08 Thread David Chelimsky
On 8/8/07, Fischer, Daniel <[EMAIL PROTECTED]> wrote: > 1 def create > 2 @user = User.new(params[:user]) > 3 @user.save! > 4 self.current_user = @user > 5 redirect_to user_path(@user) > 6 flash[:notice] = "Thanks for signing up!" > 7 rescue ActiveRecord::RecordInvalid

Re: [rspec-users] Problems with RESTfully generated helpers

2007-08-08 Thread David Chelimsky
On 8/8/07, Lance Carlson <[EMAIL PROTECTED]> wrote: > I just visited the action in my browser and i don't get any errors. I > am also running on edge rails as the application relies on > ActiveResource. Can you show me the code you created? OK - I've created a small project and am able to reproduc

Re: [rspec-users] Problems with RESTfully generated helpers

2007-08-08 Thread Lance Carlson
Awesome! Thank you! :) On 8/8/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 8/8/07, Lance Carlson <[EMAIL PROTECTED]> wrote: > > I just visited the action in my browser and i don't get any errors. I > > am also running on edge rails as the application relies on > > ActiveResource. Can you sh

[rspec-users] rspec with autotest on a windows machine

2007-08-08 Thread David Parker
Scott, Yes, my spec.opts file contains the following: --colour --format progress --loadby mtime --reverse Thoughts? If this seems like too much of a hassle, or unknown, I should say that I plan on "upgrading" my windows machine to Ubuntu Linux in the next week or two... Thanks, David Parker

Re: [rspec-users] Problems with RESTfully generated helpers

2007-08-08 Thread David Chelimsky
On 8/8/07, Lance Carlson <[EMAIL PROTECTED]> wrote: > Awesome! Thank you! :) Don't thank me yet. I've spent some time trying to track this down and I've found my way into some methods in routing.rb that are dynamically generated (and so you can't )(*&)(*& read them to debug them quite so easily) t

Re: [rspec-users] RSpec book?

2007-08-08 Thread David Chelimsky
On 8/8/07, Ashley Moran <[EMAIL PROTECTED]> wrote: > > > Came across this as a stub page browsing Amazon UK. This is good > news! I'm surprised it hasn't been discussed on the list before. > Was Chad keeping it a secret? > > I hope it will h

Re: [rspec-users] RSpec book?

2007-08-08 Thread David Chelimsky
On 8/8/07, Ashley Moran <[EMAIL PROTECTED]> wrote: > I'm still waiting for that > magic book I can give to someone and say "here - read this, it tells > you how to build software". Have you read this one? http://www.amazon.com/Software-Development-Principles-Patterns-Practices/dp/0135974445/ref=p

Re: [rspec-users] RSpec book?

2007-08-08 Thread Kevin Williams
Cool. The more exposure we can give BDD/RSpec, the better. I'll probably read both. :) On 8/8/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 8/8/07, Ashley Moran <[EMAIL PROTECTED]> wrote: > > > > > > Came across this as a stub page brow

Re: [rspec-users] RSpec book?

2007-08-08 Thread M. Edward (Ed) Borasky
Ashley Moran wrote: > I hope it will have plenty of BDD theory. I'm still waiting for that > magic book I can give to someone and say "here - read this, it tells > you how to build software". I have two copies, but as far as I know it's still in print. If you can't find it, let me know -- I'l

Re: [rspec-users] RSpec book?

2007-08-08 Thread Obie Fernandez
I'm including a chapter about RSpec and its Rails plugin in my book, The Rails Way. It'll be out in October. I'm also rallying for an RSpec book to be added to our Professional Ruby Series at Addison-Wesley. Stay tuned for more on that. -- Obie Fernandez http://jroller.com/obie/ Pre-order my boo

Re: [rspec-users] RSpec book?

2007-08-08 Thread Shane Mingins
Hi Obie I am patiently waiting for October as I am really look forward to this book! Cheers Shane On 9/08/2007, at 5:09 PM, Obie Fernandez wrote: I'm including a chapter about RSpec and its Rails plugin in my book, The Rails Way. It'll be out in October. I'm also rallying for an RSpec book

Re: [rspec-users] Any liberally-licensed open source projects out there that make good use of RSpec?

2007-08-08 Thread Obie Fernandez
Thanks, Scott. Checking it out now. On 7/31/07, Scott Taylor <[EMAIL PROTECTED]> wrote: > > I've just started DatedBackup (an rsnapshot-like utility), which has > about 500 LOC at the moment. It is licensed under the GPL, and has > 190 example specs. If you are interested, download the trunk fro

Re: [rspec-users] Any liberally-licensed open source projects out there that make good use of RSpec?

2007-08-08 Thread Daniel N
On 8/9/07, Obie Fernandez <[EMAIL PROTECTED]> wrote: > > Thanks, Scott. Checking it out now. > > On 7/31/07, Scott Taylor <[EMAIL PROTECTED]> wrote: > > > > I've just started DatedBackup (an rsnapshot-like utility), which has > > about 500 LOC at the moment. It is licensed under the GPL, and has >

Re: [rspec-users] Any liberally-licensed open source projects out there that make good use of RSpec?

2007-08-08 Thread Obie Fernandez
Any idea if it's kosher to include snippets of GPL'd code in a commercial publication? MIT license is no problem, but the GPL makes me nervous about that. On 7/31/07, Scott Taylor <[EMAIL PROTECTED]> wrote: > > I've just started DatedBackup (an rsnapshot-like utility), which has > about 500 LOC at