Re: [rspec-users] Test doubles: expect "x" and don't care about anything else

2009-06-28 Thread Wincent Colaiuta
El 28/6/2009, a las 23:04, Matt Wynne escribió: On 28 Jun 2009, at 13:07, Wincent Colaiuta wrote: I've had one of my recurring doubts about test doubles come up again. The full post is here but I'll abbreviate the content in this message in any case: https://wincent.com/blog/thinking-abou

Re: [rspec-users] Testing a Create action to make sure the User is assigned to a new Model

2009-06-28 Thread Matt Wynne
On 28 Jun 2009, at 11:33, Michael wrote: I'm trying to figure out how to test that the current_user does end up being attached to a new model that is being created which happens to be an Album. Here is the Controller code. def create @album = current_user.albums.new params[:album] if @

Re: [rspec-users] Test doubles: expect "x" and don't care about anything else

2009-06-28 Thread Matt Wynne
On 28 Jun 2009, at 13:07, Wincent Colaiuta wrote: I've had one of my recurring doubts about test doubles come up again. The full post is here but I'll abbreviate the content in this message in any case: https://wincent.com/blog/thinking-about-switching-to-rr Basically, in one of my contr

Re: [rspec-users] Testing with activerecord at ThoughtWorks (Stubbing vs real DB)

2009-06-28 Thread oren
Awesome presentation, thanks for clarifying it Ben. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Integrate or isolate views?

2009-06-28 Thread Ben Mabey
Jesse Crockett wrote: Ben Mabey wrote: On Jun 28, 2009, at 8:32 AM, Jesse Crockett wrote: When I use integrate_views, can I write view spec in what would otherwise be isolated controller spec? Correct, by default RSpec's controller specs will not render the view. This allows y

Re: [rspec-users] Integrate or isolate views?

2009-06-28 Thread Jesse Crockett
Sarah Allen wrote: > I find that testing views independently is useful just to catch HTML > errors that can sometime creep in during a re-factor. These check > important details that would be more tedious using cucumber. The > controller specs establish the post-condition for the controller > ind

Re: [rspec-users] Integrate or isolate views?

2009-06-28 Thread Jesse Crockett
Ben Mabey wrote: > On Jun 28, 2009, at 8:32 AM, Jesse Crockett wrote: > >> When I use integrate_views, can I write view spec in what would >> otherwise be isolated controller spec? > > Correct, by default RSpec's controller specs will not render the > view. This allows you to test the controller

Re: [rspec-users] Integrate or isolate views?

2009-06-28 Thread Sarah Allen
I find that testing views independently is useful just to catch HTML errors that can sometime creep in during a re-factor. These check important details that would be more tedious using cucumber. The controller specs establish the post-condition for the controller independent of the view.

[rspec-users] Testing a Create action to make sure the User is assigned to a new Model

2009-06-28 Thread Michael
I'm trying to figure out how to test that the current_user does end up being attached to a new model that is being created which happens to be an Album. Here is the Controller code. def create @album = current_user.albums.new params[:album] if @album.save flash[:notice] = "The alb

[rspec-users] Testing a Create action to make sure the User is assigned to a new Model

2009-06-28 Thread Michael
I'm trying to figure out how to test that the current_user does end up being attached to a new model that is being created which happens to be an Album. Here is the Controller code. def create @album = current_user.albums.new params[:album] if @album.save flash[:notice] = "The alb

Re: [rspec-users] Integrate or isolate views?

2009-06-28 Thread Ben Mabey
On Jun 28, 2009, at 8:32 AM, Jesse Crockett wrote: Hello, I've been trying for two years to pick up BDD. I'm making progress, have just read through the chapters in The RSpec Book on spec'ing views and controllers. What is the difference between using integrate_views and doing what seems

[rspec-users] Integrate or isolate views?

2009-06-28 Thread Jesse Crockett
Hello, I've been trying for two years to pick up BDD. I'm making progress, have just read through the chapters in The RSpec Book on spec'ing views and controllers. What is the difference between using integrate_views and doing what seems to be a lot of extra work to test the views in isolation?

[rspec-users] Test doubles: expect "x" and don't care about anything else

2009-06-28 Thread Wincent Colaiuta
I've had one of my recurring doubts about test doubles come up again. The full post is here but I'll abbreviate the content in this message in any case: https://wincent.com/blog/thinking-about-switching-to-rr Basically, in one of my controller specs I wanted to verify that the following