Read my latest article: Announcing RailsDeveloper (posted Wed, 01 Sep 2010 17:01:00 GMT)

RSpec: It Should Behave Like

Posted by Robby Russell Wed, 20 Aug 2008 02:47:00 GMT

188 comments Latest by LOUIS ANNIE Thu, 02 Sep 2010 06:00:48 GMT

I was going through an older project of ours and cleaning up some specs and noticed how often we were doing the same thing in several places. When we started the project, we didn’t get the benefits of shared groups. Now that we have some time to go through and update some of our older specs, I’ve been trying to take advantage of the features currently available in RSpec. One feature that I haven’t seen a lot of mention of by people is shared groups, so I thought I’d take a few minutes to write up a quick intro to using it.

To pick some low-hanging fruit, let’s take an all-too-familiar method, which you might be familiar with… login_required. Sound familiar? Have you found yourself stubbing login_required over and over throughout your specs?

describe Admin::DohickiesController, 'index' do

  before( :each ) do
    controller.stub!( :login_required )
    Dohicky.should_receive( :paginate ).and_return( Array.new )
    get :index
  end

 ...
end

If you’re requiring that a user should be logged in when interacting with most of the application (as in the case of an administration section/namespace), you might want to consolidate some of your work into one shared specification group. The basic premise behind this is that you can write a typical describe block and load it into any other spec groups that you need. For example, in our case, we’ll need to stub login_required in several places. We can set this up in one shared group and reference it wherever necessary.

For example, here is what we’ll start off with.

describe "an admin user is signed in" do
  before( :each ) do
    controller.stub!( :login_required )
  end
end

describe Admin::DohickiesController, 'index' do
  ...

However, the new describe block isn’t accessible from the block at the bottom of the example… yet. To do this, we just need to pass the option: :shared => true as you’ll see in the following example.

describe "an admin user is signed in", :shared => true do
  before( :each ) do
    controller.stub!( :login_required )
  end
end

Great, now we can reference it by referring to it with: it_should_behave_like SharedGroupName. In our example above, this would look like:

describe "an admin user is signed in" do
  before( :each ) do
    controller.stub!( :login_required )
  end
end

describe Admin::DohickiesController, 'index' do
  it_should_behave_like "an admin user is signed in"

  before( :each ) do
    Dohicky.should_receive( :paginate ).and_return( Array.new )
    get :index
  end

 ...
end

describe Admin::DohickiesController, 'new' do
  it_should_behave_like "an admin user is signed in"

  before( :each ) do
    @dohicky = mock_model( Dohicky )
    Dohicky.should_receive( :new ).and_return( @dohicky )
    get :new
  end

  ...

That’s it! Pretty simple, eh? We can now reference this shared group in any describe blocks that we want to. A benefit to this approach is that we can make change the authentication system (say, we decide to switch it entirely and/or even just change method names, set any other prerequisites necessary when an admin is signed in), we’ll have a single place to change in our specs. (tip: you can put these in your spec_helper file)

You can learn more about it_should_behave_like and other helpful features on the RSpec documentation site.

If you have any suggestions on better ways of handling things like this, please follow up and share your solutions. I’m always looking to sharpen my tools. :-)

Update

In response, Bryan Helmkamp suggests that a better solution is to define a method in our specs like, for example: build_mock_user_and_login. then calling it in our before(:each). So, maybe the approach above isn’t the most ideal method but I did wantt o draw some attention to it_should_behave_like. I suppose that I need a better example.. another post, perhaps? :-)

Also, Ed Spencer has posted an article titled, DRYing up your CRUD controller RSpecs, which will introduce you mor to it_should_behave_like.

Thanks for feedback people!

Related Posts

Subscribe to my RSS feed Enjoying the content? Be sure to subscribe to my RSS feed.
Comments

Leave a response

  1. Avatar
    Dylan Wed, 20 Aug 2008 03:31:16 GMT

    I’d +1 this approach too :)

    When defining the shared example, you can also use:
    share_examples_for "Logged In Admin" do

    (think this may be the preferred way ?)

    ... or, a funkier, more “ruby” like way, ala:
    share_as :LoggedInAdmin

    ... where you can include that like:
    include LoggedInAdmin

    Also, it sometimes helps to create your mocks in them as well, like:

    share_examples_for "Logged In Admin" do
      controller.stub!( :login_required )
      @mock_admin_user = mock_model(User, {:is_admin => true})
    end
    

    Shared Behaviours FTW !

  2. Avatar
    Bryan Helmkamp Wed, 20 Aug 2008 04:28:49 GMT

    I’m not a big fan of this usage of shared examples. Expanded, here’s what the code in your example says:

    “Admin::DohickiesController#new should behave like an admin user is signed in.”

    The problem is it’s taking what’s context and putting it in the place of an outcome (as in, the piece after the should).

    That said, I agree that duplicating the stub for login_required all over is not ideal because you might refactor to a different login system later. I usually handle this by defining a method in my specs like “build_mock_user_and_login”.

    If all I care about is being logged in, I can call that from the before(:each) or inside each example. The method returns a mock_model, so I can also capture the result of it and use that object in the remainder of the example. One nice thing about this approach is that if I refactor away from login_required, I only have one place to update for all the specs that aren’t specifically concerned with login.

    You do have to repeat the call to build_mock_user_and_login, but that duplication isn’t really any worse than duplicating “it_should_behave_like ‘an admin user is signed in’”. Both are essentially declarative.

    Cheers,

    -Bryan

  3. Avatar
    Lar Van Der Jagt Wed, 20 Aug 2008 05:50:03 GMT

    Glad to see you posting some more, any further RSpec tips are especially appreciated!

  4. Avatar
    grosser Wed, 20 Aug 2008 05:58:54 GMT

    I normally also go with just defining a method, it not ‘as’ readable but you can pass arguments and they are easy to find via method-lookup(eclipse).

  5. Avatar
    ander Wed, 20 Aug 2008 06:17:35 GMT

    Conveniently there’s the controller instance you can get to in (shared) controller specs. Is there something similar built in for model specs? Or do I have to define e.g. a get_instance method in the actual model spec (which includes the it_should_behave_like ..) to get an instance of the model in the shared spec?

    Cheers.

  6. Avatar
    Nick Wed, 20 Aug 2008 06:40:27 GMT

    We generally add a login_user method to spec_helper. Then we can use that anywhere we need it. Similarly for login_admin_user.

  7. Avatar
    Dylan Wed, 20 Aug 2008 08:57:25 GMT

    I agree with Bryan, and personally think that shared examples can be a good substitute for always having to use the before block for everything. For example, using them for before_filters.

    Once you test the before_filter in isolation, you should be free to stub it out in other tests, so that those tests are then being tested in isolation. It reads well too.

    In regard to using them for the logged_in example, I’d personally opt for showing that within the actual request. Here’s an example of how I would usually do this fwiw:

    shared_examples_for "Green Dohicky In Context" do
      before 
        @mock_green_dohicky = mock_model(Dohicky, {:color => 'green'})
        @mock_green_dohicky.should_receive(:aoeu).and_return(:stnh)
    end
    
    describe DohickiesController do
      describe "responding to GET /new" 
        describe "as an admin user" do
          it_should_behave_like "Green Dohicky In Context" 
    
          before do
            Dohicky.stub!(:paginate).and_return(Array.new)
          end
    
          def do_get
             logged_in_as_admin { get :new }
          end
    
          it "should return an array from a call to Dohicky.paginate" do
            before_get { Dohicky.should_receive(:paginate).and_return(Array.new) }
          end
    
          it "should do something with the green dohicky" do
             during_get { @mock_green_dohicky.should do_something }
          end
    
          it "should do something else with the green dohicky" do
            ...
          end
        end
    
       describe "as a non logged in user" do
         it_should_behave_like "Green Dohicky In Context" 
           ...
         end
       end
     end
    

    But yeah, would usually test the before_filters specific to that controller in that test, and push the global shared_examples out to spec_helper or another module.

    Oh… and I also use this awesomeness (that should be a word) for cleaning up some of the scope fun… ie: making the request in the right place: http://gist.github.com/6343

    What do you think ? That’s my “seems-to-be-ever-changing” controller approach at the moment ;)

  8. Avatar
    Ed Spencer Wed, 20 Aug 2008 10:59:32 GMT

    Nice to see this feature getting some exposure, in fact you inspired me to write up how I handle shared example groups when testing CRUD actions. Shared Example Groups are an awesome but underused feature of the RSpec library.

    One minor point though – you’re currently putting the expectation that Dohicky.should_receive( :paginate ).and_return( Array.new ) in your before(:each) block. It might just be a matter of one style vs another but I would probably use stub! there and put the expectation into an it “should” do … end block, as you’re currently making the same expectation many times over.

    I think you’re also missing the :shared => true at the top of your last code example.

  9. Avatar
    Glenn Wed, 20 Aug 2008 11:41:18 GMT

    I think this is one of the most underused aspects of Rspec, and it’s so powerful. I only discovered it because a colleague refactored some tests when I was on holiday, so the more you can do to get the news out there the better ;)

  10. Avatar
    Robby Russell Wed, 20 Aug 2008 15:07:28 GMT Recommend me on Working with Rails

    @Bryan,

    Thanks for sharing your thoughts on using a method to do this as well. I’ll have to play around a bit and see how readable I can make this, which is one of my goals when writing specs.

    @ander:

    Yep, you can use it_should_behave_like in model specs as well.

    @ed:

    Great tutorial, I’ll have to give that a whirl in the near future.

  11. Avatar
    Mark Wilden Wed, 20 Aug 2008 23:33:44 GMT

    One caveat is that if a shared spec fails, you don’t see it in the call stack.

    David Chelimsky suggested using—backtrace, but I never got around to trying it.

  12. Avatar
    ander Thu, 21 Aug 2008 06:36:16 GMT

    I was trying to point out that shared controller specs have easy access to the controller by just saying “controller”, whereas shared model specs apparently have to do some custom stuff to get to the model.

    Here are some thoughts: http://exceptionisarule.blogspot.com/2008/08/rspec-shared-model-specs.html

  13. Avatar
    ander Thu, 21 Aug 2008 06:39:33 GMT

    What I was trying to say is that shared controller specs have an easy access to the controller by just saying “controller”, whereas shared model specs have to do some custom stuff to get to the model.

    Some thoughts: http://exceptionisarule.blogspot.com/2008/08/rspec-shared-model-specs.html

  14. Avatar
    Chuck Remes Thu, 21 Aug 2008 15:54:21 GMT

    This has been one of the most useful blog postings ever (for me). While I was already using #shared_examples_for to great effect, I was not creating helper methods for my #before blocks. I am currently refactoring a beast of a spec to use these techniques.

    Thank you for the post and the comments!

  15. Avatar
    Ryan Bates Thu, 21 Aug 2008 18:18:30 GMT

    I prefer to put shared spec behavior in a controller macros file. Then you can include that in your spec helper:

    config.include(ControllerMacros, :type => :controller)
    

    Now all the methods in ControllerMacros are available to use in any controller specs.

  16. Avatar
    John Yerhot Thu, 21 Aug 2008 20:27:52 GMT

    I’m pretty new to Rspec, but this post and everyone’s comments/thoughts are great. Thanks!

  17. Avatar
    uggs Sat, 27 Feb 2010 03:58:27 GMT

    if you want to buy here is some good Website for another you can see this any more jordan shoes air jordan shoes michael jordan shoes

  18. Avatar
    ngan hang Mon, 08 Mar 2010 08:37:53 GMT

    Good resoure, keep up great job.

  19. Avatar
    Rapidshare SE Mon, 08 Mar 2010 17:09:26 GMT

    Thanks for a great explanation. At last I’ve cleared everything about this Login thing.

  20. Avatar
    sonnerie gratuite pour portable Fri, 26 Mar 2010 03:45:34 GMT

    That’s great! You have made a very useful and informative post. Thanks a lot for sharing.

  21. Avatar
    http://hotwallpapers4u.com Sun, 28 Mar 2010 10:51:00 GMT

    these look & sound heavenly. Why is it that healthy food, while appealing if made well, does not pull us in the way such decadent snacks do? sigh. In spite of my mini-lament, I think these look appetizing.

  22. Avatar
    buy salwar kameez Sun, 28 Mar 2010 19:55:09 GMT

    In the example above, the single line comment is like PHP, use the number symbol “#”. For over six line of code, use “=begin” before the first line and “=end” after the last six. Do not use any indentation.

  23. Avatar
    Airport Car Rentals Wed, 07 Apr 2010 22:08:35 GMT

    I’m curious as to why you want to log on unit tests. It’s not like you are receiving diagnostic information from its application in development mode you do not want filling up simple production records .. makes statements should do the trick unit testing, should not they?

  24. Avatar
    watchanimeonline Sat, 10 Apr 2010 13:20:38 GMT

    I am using robby on rails in many projects i have found its very easy to implement in the web projects thanks for sharing very nice article.

    cheers, Paul

  25. Avatar
    freshlook contact lenses Sat, 10 Apr 2010 18:33:25 GMT

    simply click the “Enabled” checkbox as well as the “Default” radio button next to the template that you wish to activate and then click on the “Save configuration” button that is located at the bottom of the page.

  26. Avatar
    Janette Tue, 13 Apr 2010 12:47:08 GMT

    Thanks Ryan. The info you shared has proved itself quite useful. Im thankful to you for this info. Please in the meantime share some more. ive put all the samples over the web. MOBILE KITCHENS

    Cheers.

  27. Avatar
    http://www.suprashoesale.com Wed, 14 Apr 2010 02:15:34 GMT

    Supra footwear appears in fashion market for a long time, and come in over 65 different color variations and styles these days.

  28. Avatar
    jessie Fri, 16 Apr 2010 07:49:07 GMT

    I have no idea about this until today!!!!

    free ads |part time jobs|latex mattress

  29. Avatar
    plantar injury">Cara Michelle Sun, 18 Apr 2010 03:38:06 GMT

    Its one of my favorite post. Thanks for sharing informative information.

    plantar injury

  30. Avatar
    Mobile Kitchens Mon, 19 Apr 2010 17:35:24 GMT

    it is very useful and informative post for me. thanks for shearing.

  31. Avatar
    mobile kitchen Wed, 21 Apr 2010 18:53:41 GMT

    I can use cucumber to the rails. It definitely makes my job easier at work with this. This is a great tool to use. Thanks for the great information.

  32. Avatar
    mobile kitchens Wed, 21 Apr 2010 20:00:05 GMT

    That’s great! They have a very useful and informative post. Thank you for sharing.

  33. Avatar
    mobile kitchen rental Sun, 25 Apr 2010 18:00:24 GMT

    well work i need this for my customer thanks dear

  34. Avatar
    portable kitchen rental Sun, 25 Apr 2010 18:30:43 GMT

    really great also for me i do my own work in the help of this post thanks

  35. Avatar
    craftmatic beds Tue, 27 Apr 2010 02:30:32 GMT

    The method you talked here is good, thanks! It will help me a lot.

  36. Avatar
    Atlantis Hotel Tue, 04 May 2010 02:38:16 GMT

    It definitely makes my job easier at work with this. This is a great tool to use. Thanks for the great information.

  37. Avatar
    Physiotherapy Tue, 04 May 2010 02:39:17 GMT

    the template that you wish to activate and then click on the “Save configuration” button that is located at the bottom of the page.

  38. Avatar
    Tech Web Tue, 04 May 2010 06:07:26 GMT

    Good post. Keep valid up. Really informative post. thanks considering sharing this article.

  39. Avatar
    Abercrombie Tue, 04 May 2010 07:13:02 GMT
  40. Avatar
    mobile kitchen rental Sat, 08 May 2010 19:11:55 GMT

    The method discussed here is good, thanks! It will help me a lot.

  41. Avatar
    SX guitars Mon, 10 May 2010 03:48:13 GMT

    Trees and forests grow the wood used to make guitars. Find it here.

  42. Avatar
    Jumping Stilts Mon, 10 May 2010 20:47:40 GMT

    RSpec has some really useful shared groups features that can make organizing projects so much easier. Glad to see somewhat of a feature on it!

  43. Avatar
    wholesale laptop adapter Thu, 13 May 2010 06:32:48 GMT

    When we started the project, we didn’t get the benefits of shared groups.

  44. Avatar
    ED Hardy outlet Thu, 13 May 2010 16:38:53 GMT
  45. Avatar
    mobile kitchen rental Sun, 16 May 2010 06:40:29 GMT

    I admire the valuable information you provide in your articles.

  46. Avatar
    High School Diploma Tue, 18 May 2010 13:07:46 GMT

    Thank you for sharing this information.It is really nice.Keep posting. High School Diploma

  47. Avatar
    http://www.amandadollar.com Thu, 20 May 2010 06:14:30 GMT

    M N O P Q R S T U V W X Y

  48. Avatar
    china wholesale Thu, 20 May 2010 08:40:57 GMT
  49. Avatar
    alicante Thu, 20 May 2010 08:41:45 GMT
  50. Avatar
    download toy story 3 Fri, 21 May 2010 09:26:13 GMT

    I normally also go with just defining a method, it not ‘as’ readable but you can pass arguments and they are easy to find via method-lookup(eclipse).

  51. Avatar
    download jonah hex Fri, 21 May 2010 09:26:32 GMT

    I admire the valuable information you provide in your articles.

  52. Avatar
    High School Diploma Mon, 24 May 2010 17:38:48 GMT

    Thank you for sharing this information.It is really nice.Keep posting. High School Diploma

  53. Avatar
    thermal imaging camera Thu, 27 May 2010 09:09:08 GMT

    Gret article and very informative

  54. Avatar
    Free Unlimited Hosting Thu, 27 May 2010 10:55:15 GMT

    Improve readability and remove duplication in RSpec by making use of matchers and macros.

  55. Avatar
    sonnerie portable Fri, 28 May 2010 07:39:18 GMT

    That’s great! You have made a very useful and informative post. Thanks a lot for sharing.

  56. Avatar
    Online Fri, 28 May 2010 13:00:13 GMT

    Glad to see you posting some more, any further RSpec tips are especially appreciated!

  57. Avatar
    ProTV Fri, 28 May 2010 13:01:40 GMT

    Hi. Thank you a lot for this information. I’ll follow you on each post you write ;) .Nice words

  58. Avatar
    hotfile search Mon, 31 May 2010 15:12:43 GMT

    Ruby on rails is one of the most flexible platform, especially for things like shared groups. RSpec is a bright example for that. Thanks to the author for sharing his approach to this kind of tasks.

  59. Avatar
    watch tv online Tue, 01 Jun 2010 14:45:37 GMT

    hi, thanks for your good work , well job.

  60. Avatar
    craigslist search Wed, 02 Jun 2010 10:47:43 GMT

    you are doing very good job, keep it up man.

  61. Avatar
    discount mbt shoes Thu, 03 Jun 2010 08:20:05 GMT

    ewr

  62. Avatar
    air jordan 18 Thu, 03 Jun 2010 08:20:16 GMT

    werew

  63. Avatar
    Natural Peanut Butter Fri, 04 Jun 2010 06:51:01 GMT

    This looks absolutely perfect. All these tinny details are made with lot of background knowledge. I like it a lot. Keep on taking action!

  64. Avatar
    santa letters Sat, 05 Jun 2010 18:21:46 GMT

    I’ve been looking a little more help.I admire what you’ve done here. Good to see your light on this important issue can be easily seen. Awesome post and waiting for future update.

  65. Avatar
    bed bug bite Sat, 05 Jun 2010 20:27:40 GMT

    Hope this instruction will be help of many other people. [ http://www.bedbugsbully.com/ bed bug bite ] [ http://www.plantar-fasciitistreatment.com/ plantar fasciitis cure ] Thanks for informative sharing.

  66. Avatar
    Donald Smith Tue, 08 Jun 2010 10:44:38 GMT

    This code helps me in project. Free Unlimited Hosting

  67. Avatar
    medical tourism Tue, 08 Jun 2010 14:43:26 GMT

    I really am so glad you posted this information! I’ve been looking for some extra help.

  68. Avatar
    prom dresses Thu, 10 Jun 2010 07:16:22 GMT

    I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post. dresses for prom

  69. Avatar
    designer handbags reviews Fri, 11 Jun 2010 10:26:09 GMT

    .I admire what you’ve done here. Good to see your light on this important issue can be easily seen. Awesome post and waiting for future update.

  70. Avatar
    Jordan Sneaker Fri, 11 Jun 2010 13:08:57 GMT

    I think that I really am so glad you posted this information! I’ve been looking for some extra help.

    Thanks for sharing us.

  71. Avatar
    half marathon training schedule">half marathon training schedule Sat, 12 Jun 2010 05:43:17 GMT

    Ideally before starting a half marathon program, you should have been training for about six months. http://www.halfmarathontrainingschedule.net/ half marathon training schedule

  72. Avatar
    Fax Online Sun, 13 Jun 2010 10:50:13 GMT

    what looks as if my tenth installment (actually, it’s the fourth) of showing you how I setup my development surroundings on a fresh OSX install. In this case, I’m actually getting a MacBook setup for a brand spanking new worker with Snow Leopard.

  73. Avatar
    Frank Klung Sun, 13 Jun 2010 17:31:20 GMT
  74. Avatar
    bicycle shoes Mon, 14 Jun 2010 09:15:04 GMT

    I am glad I found it informative so Site has been added to my RSS feed for later browsing. [ sidi cycling shoes ] [ road bike shoes ] [ shimano cycling shoes ] [ diadora cycling shoes ]

  75. Avatar
    Nichol Mon, 14 Jun 2010 13:05:49 GMT

    Hi Your blog is very nice. I have really learnt a lot from this blog thanks

    Virtual Assistant

  76. Avatar
    1 2 marathon training schedule Mon, 14 Jun 2010 16:49:40 GMT

    Ideally before starting a half marathon program, you should have been training for about six months.

  77. Avatar
    Frequent Flyer Miles Tue, 15 Jun 2010 09:51:18 GMT

    I believe this blog post is one of the most informative thing not only for the technique learner but also for necessary for all stage people. [ Promotional Products ] [ Promotional Items ] [ AAdvantage Miles ] [ American Airlines AAdvantage Miles ] [Business Gifts ]

  78. Avatar
    Erase Bad Credit Wed, 16 Jun 2010 05:50:56 GMT

    It Should Behave Like · Spec Your Views · Audit Your Rails RSpec is certainly my favorite Ruby tool and I’m glad to say that most of my SD.rb

  79. i wish your project success :)

  80. Avatar
    hosting murah indonesia indositehost.com Thu, 17 Jun 2010 03:03:08 GMT

    keep spirit dude

  81. Avatar
    janome 6500 Thu, 17 Jun 2010 07:19:16 GMT

    Site has been added to my RSS feed for later browsing because your blog is necessary forever.

  82. Avatar
    janome 6500 Thu, 17 Jun 2010 07:23:07 GMT

    Site has been added to my RSS feed for later browsing because your blog is necessary forever.

  83. Avatar
    trend maker Fri, 18 Jun 2010 10:49:06 GMT
  84. Avatar
    Corporate Gifts Fri, 18 Jun 2010 19:42:52 GMT

    Let me accord an example. Let us say I afflicted the interface on User and on the methods apropos to permissions. My User assemblage analysis break, and I fix those. But now my angle are in fact broken, but because the decoupled appearance tests analysis adjoin the mock, they still pass: a apocryphal positive. And I accept no adumbration from my testing framework that my appliance is broken.

  85. Avatar
    Corporate Gifts Fri, 18 Jun 2010 19:43:37 GMT

    It is too bad it’s so harder to signup for a new annual at TrustCommerce. I had the exact aforementioned bad acquaintance if I aboriginal approved to signup. Thankfully the annual and abutment is abundant already a customer.

  86. Avatar
    acne treatments Fri, 18 Jun 2010 19:45:01 GMT

    Nice information, many thanks to the author. It is incomprehensible to me now, but in general, the usefulness and significance is overwhelming. Thanks again and good luck!

  87. Avatar
    max air 360 Sun, 20 Jun 2010 02:04:33 GMT

    Kobe Bryant Jerseys

  88. Avatar
    Kobe Bryant Jerseys Sun, 20 Jun 2010 02:04:39 GMT

    Kobe Bryant Jerseys

  89. Avatar
    Pallet Jacks Sun, 20 Jun 2010 06:28:52 GMT

    I enjoyed every bit of it and I’ve bookmarked to check out new things for good blog visit.I post.Really glad you posted this information! I’ve been looking for some extra help.

  90. Avatar
    asdfsdf Mon, 21 Jun 2010 04:01:21 GMT

    TrustCommerce. I had the exaced hardy shirtst aforementioned bad acquaintance if I aboriginal approved to signup. Thankfully the annual and abutment is abundant already a customer.ugg boots sale

  91. Avatar
    peninggi badan Tue, 22 Jun 2010 08:05:35 GMT

    For example, in our case, we’ll need to stub login_required in several places. We can set this up in one shared group and reference it wherever necessary.

  92. Avatar
    peninggi badan Tue, 22 Jun 2010 08:05:41 GMT

    For example, in our case, we’ll need to stub login_required in several places. We can set this up in one shared group and reference it wherever necessary.

  93. Avatar
    Pallet Jacks Tue, 22 Jun 2010 09:10:51 GMT

    Good post! Thanks for your information! Please come to the ugg brand world. theseare all supplies jiffy thanks for share.medical tourismis also a snap.

  94. Avatar
    Self Dumping Hopper Tue, 22 Jun 2010 09:11:52 GMT

    well done.nice job.

  95. Avatar
    marathon training schedule Wed, 23 Jun 2010 08:11:08 GMT

    As this information is educational so this site has been added to my RSS feed for later browsing.

  96. Avatar
    POP Displays Thu, 24 Jun 2010 11:19:10 GMT

    What really helps a post back to this again and again. Thanks! You are so beautiful. Nice to know:) By the way, you have a beautiful look … I like it!

  97. Avatar
    Trade Show Giveaways Sat, 26 Jun 2010 20:52:14 GMT

    I believe this blog post is one of the most informative thing not only for the technique learner but also for necessary for all stage people.

  98. Avatar
    Citibank AAdvantage Sat, 26 Jun 2010 21:40:37 GMT

    I believe this blog post is one of the most informative thing not only for the technique learner but also for necessary for all stage people.

  99. Avatar
    Branding Items Sun, 27 Jun 2010 12:28:51 GMT

    I believe this blog post is one of the most informative thing not only for the technique learner but also for necessary for all stage people.

  100. Avatar
    Alex Sun, 27 Jun 2010 17:59:10 GMT

    Thanks for a great explanation. At last I’ve cleared everything about this Login thing. find more solutions at rapidshare http://freshdls.com | http://legendarydevils.com | http://rsindex.net | http://ldevils.com

  101. Avatar
    Windshield Replacement Mon, 28 Jun 2010 12:39:51 GMT

    I could not leave your site before you say that I liked a lot the quality of information you offer. It will often to check up on new things to post!

  102. Avatar
    china copper price Thu, 01 Jul 2010 08:21:53 GMT
  103. Avatar
    road bike shoes Fri, 02 Jul 2010 04:36:56 GMT

    This thread is useful for the technical knowledge finders. I am glad I found it informative so Site has been added to my RSS feed for later browsing.

  104. Avatar
    road bike shoes Fri, 02 Jul 2010 04:37:05 GMT

    This thread is useful for the technical knowledge finders. I am glad I found it informative so Site has been added to my RSS feed for later browsing.

  105. Avatar
    china wholesale Fri, 02 Jul 2010 11:13:16 GMT

    Trademic.com is a business-to-business (B2B) comprehensive trade solution providerofferingone-stop trade wholesale china services to international buyers who are interested in purchasing directly from China. We provide our buyers with an efficient china wholesale and manageable procurement process covering international supply chain and streamlining trade channels. wholesale dvdtrading company nor a seller, but rather an online business wholesale jewelryplatform where you can purchase directly from China. Our Mission wholesale handbags

  106. Avatar
    office chairs Sat, 03 Jul 2010 12:43:32 GMT

    office chairs

    This ergonomic high back office chair extends the full length of the back,up to the shoulders and includes support for the head and neck. Our chairs are crafted to perfection and designed to the bodies natural shape, you will find complete comfort with its PU leather material and padded arm rests.

    The chair is fitted with optimised functions which include gas height adjustment and tilt mechanism, to allow for greater comfort and allowing you to find your ideal position.

    Our executive range of office chairs are built to be Safe, to last for years and cannot be beat in any head to head comparison in its class. Easy assemble, a strong nylon base and 360° swivel, top this PU leather, a fantastic executive look.

  107. Avatar
    Kids Games Mon, 05 Jul 2010 14:44:39 GMT

    TANKS FOR SHARE.

  108. Avatar
    Branding Items Mon, 05 Jul 2010 18:03:49 GMT

    I believe this blog post is one of the most informative thing not only for the technique learner but also for necessary for all stage people.

  109. Avatar
    DOFOLLOW BLOG Mon, 05 Jul 2010 18:07:44 GMT

    Are you looking for dofollow blog for commenting that will give you site a dofollow backlinks if so come here and post comment DOFOLLOW BLOG

  110. Avatar
    marathon training Thu, 08 Jul 2010 15:54:31 GMT

    As this information is educational so this site has been added to my RSS feed for later browsing. To know more about marathon training

  111. Avatar
    marathon training program Thu, 08 Jul 2010 15:57:21 GMT

    As this information is educational so this site has been added to my RSS feed for later browsing. To know more about marathon training

  112. Avatar
    Used motorcycle engines Thu, 08 Jul 2010 16:29:38 GMT

    Our executive range of office chairs are built to be Safe, to last for years and cannot be beat in any head to head comparison in its class. Easy assemble, a strong nylon base and 360° swivel, top this PU leather, a fantastic executive look.

  113. Avatar
    Fair Play FIFA World Cup AFSEL 2010 Fri, 09 Jul 2010 20:50:31 GMT
  114. Avatar
    nasirdallas Wed, 14 Jul 2010 12:44:05 GMT

    This is such a great resource that you are providing and you give it away for free. I love seeing websites that understand the value of providing a quality resource for free. It’s the old what goes around comes around routine. call center outsourcingr

  115. Avatar
    nasirdallas Wed, 14 Jul 2010 12:44:35 GMT

    There are certainly a lot of details like that to take into consideration. That’s a great point to bring up. I offer the thoughts above as general inspiration but clearly there are questions like the one you bring up where the most important thing will be working in honest good faith. canada pharmacy

  116. Avatar
    sanejenny Wed, 14 Jul 2010 12:53:09 GMT

    That is the name of the trip. Consider what is contributing to the current success and you should be able to achieve more next time.

  117. Avatar
    start sharing not selling Sun, 18 Jul 2010 13:25:17 GMT

    nice post man thanks for share it to us

  118. Avatar
    video games Tue, 20 Jul 2010 07:30:11 GMT

    Good job! Your post is a prime example of why I keep coming back to read the content of their excellent quality that is forever updated. Thanks!

  119. Avatar
    asics shoes Wed, 21 Jul 2010 12:41:19 GMT

    This was a useful post and I think it is rather easy to see from the other comments as well that this post is well written and useful. Keep up the good work Onitsuka Tiger Mexico 66 Brown Beige Onitsuka Tiger Mexico 66 Brown White Onitsuka Tiger Mexico 66 Brown Yellow Onitsuka Tiger Mexico 66 Gold Black

  120. Avatar
    sanejenny Thu, 22 Jul 2010 15:16:56 GMT

    Insurance company’s rank are not determine the buyers totally. They are searching for the best one based on their looking.

  121. Avatar
    natural blood pressure cure Sat, 24 Jul 2010 01:12:50 GMT

    This article gives the light in which we can observe the reality. This is very nice one and gives in depth information. Thanks for this nice article. Good post…..Valuable information for all.

  122. Avatar
    rapidshare Sat, 24 Jul 2010 10:37:17 GMT

    thanx for sharing, you given very good explanation about this and finally i clarified my doubts. http://www.evildrome.com

  123. Avatar
    seattle dui Sat, 24 Jul 2010 10:52:40 GMT

    Your summaries are always top-notch. Thanks for keeping us apprised. I’m reading every word here.

  124. Avatar
    Richard2000 Sun, 25 Jul 2010 13:10:41 GMT

    You do have to repeat the call to build_mock_user_and_login, but that duplication isn’t really any worse than duplicating “it_should_behave_like ‘an admin user is signed in’”. Both are essentially declarative. jump higher save fuel Electronic Cigarette tava tea error fix

  125. Avatar
    patio furniture Sun, 25 Jul 2010 14:28:15 GMT

    They are really have a bad luck, between so many people that do the same thing, they are the most unlucky one. patio furniture

  126. Avatar
    patio furniture Sun, 25 Jul 2010 14:28:22 GMT

    They are really have a bad luck, between so many people that do the same thing, they are the most unlucky one. patio furniture

  127. Avatar
    Auto Glass Dallas Sun, 25 Jul 2010 17:32:43 GMT

    Good article and a summary of the problem nicely. My only problem with the analysis taking into account that much of the population joined the chorus of the mythology of deregulation, given the vested interests lean towards the perpetuation of the current system and given the lack of a popular entertainer for their arguments, I’m not seeing much in the way of change.

  128. Avatar
    best cure for toenail fungus Mon, 26 Jul 2010 01:56:34 GMT

    I am using robby on rails in many projects i have found its very easy to implement in the web projects thanks for sharing very nice article.

  129. Avatar
    fiwedding Mon, 26 Jul 2010 07:50:47 GMT

    Good article and a summary of the problem nicely. My only problem with the analysis taking into account that much of the population joined the chorus of the mythology of deregulation, given the vested interests lean towards the perpetuation of the current system and given the lack of a popular entertainer for their arguments, I’m not seeing much in the way of change.

  130. Avatar
    game tables Mon, 26 Jul 2010 09:48:02 GMT

    That is the name of the trip. Consider what is contributing to the current success and you should be able to achieve more next time. game tables

  131. Avatar
    free music download mp3 Mon, 26 Jul 2010 12:36:38 GMT

    yeah behave is one imporantan things to in my life

  132. Avatar
    Nicholas Mon, 26 Jul 2010 13:57:09 GMT

    If you had some way of rating posts I would for sure give you a high rating my friend!

  133. Avatar
    guanguang99@126.com Tue, 27 Jul 2010 07:41:12 GMT
  134. Avatar
    Mobile programming Thu, 29 Jul 2010 10:42:30 GMT

    hi, i just wanted to say how much i enjoy reading your blog. in a world full of spin, it’s nice to get some fact-based analysis. keep up the good work. Mobile programming

  135. Avatar
    Iraqi dinar Thu, 29 Jul 2010 19:24:57 GMT

    Saying thanks will not very soon be adequate, for the exceptional precision in your lettering. I will accurate away grab your RSS give food to exist in side by side of any up comings.

    http://dinariraqi.net"> Iraqi Dinar

  136. Avatar
    Jhonson Krew Fri, 30 Jul 2010 09:05:27 GMT

    We generally add a login_user method to spec_helper. Then we can use that anywhere we need it. Greatly enjoyable and effective thing. I loved it.

  137. Avatar
    Jhonson Krew Fri, 30 Jul 2010 09:06:10 GMT

    We generally add a login_user method to spec_helper. Then we can use that anywhere we need it. Greatly enjoyable and effective thing. I loved it.

  138. Avatar
    window cleaning Fri, 30 Jul 2010 10:34:38 GMT

    If you had some way of rating posts I would for sure give you a high rating my friend!

  139. Avatar
    place for buy and sell link Fri, 30 Jul 2010 13:42:30 GMT

    well its unique article that i ever seen nice article

  140. Avatar
    uggs outlet Mon, 02 Aug 2010 00:58:07 GMT

    I am also very Website you enjoy the article.And I also have the feeling that it was really a pity that we didn’t meet each other earlier. Ugg news

  141. Avatar
    cracked iphone Tue, 03 Aug 2010 07:00:38 GMT

    Same as you would when your with your girlfriend. Minus the giant amounts of pda… lol just be you you said your sociable. just don’t be too nice or the room-mate might fall for you too! dun dun dun. good luck! cracked iphone

  142. Avatar
    http://www.discountcoachhandbag.com/ Tue, 03 Aug 2010 07:02:25 GMT

    This weekend my friend hold one party and I am invited. I could not take party in my ugg boot and the ed hardy clothing. I just ordered one discount

    christian louboutin pumps in the christian

    louboutin outlet. In the very store there are many styles of air jordan sale and the new ugg sandals. I can not help buy ugg boot again. I love these ugg boot sale

  143. Avatar
    jun Tue, 03 Aug 2010 08:05:16 GMT
  144. Avatar
    Louis Vuitton Monogram Multicolor JUDY PM M40258 Wed, 04 Aug 2010 05:47:33 GMT

    After noticing a few patch requests on Rubyforge.. I decided that I’d put the ShortURL gem up on GitHub as I spend quite a bit of my time there these days. :-)

  145. Avatar
    anti depression medication Wed, 04 Aug 2010 16:27:39 GMT

    In the plumbing business we run across black widow spiders on a daily basis. For some reason they love those damp water meter boxes. If I saw a spider that big in a water box I would quit opening them for good.

  146. Avatar
    Start Sharing Not selling Wed, 04 Aug 2010 20:42:51 GMT

    Interesting information space. I like it. thanks for sharing. Good Luck

    Travel Jakarta Bandung Travel Jakarta bandung | Travel Jakarta Bandung | Blogku adalah ladang uangku

  147. Avatar
    amnotfreedom@gmail.com Thu, 05 Aug 2010 17:15:08 GMT

    This is nice post and very informative. thanks for sharing http://www.ldevils.com

  148. Avatar
    camera bag manufacturer Fri, 06 Aug 2010 03:21:11 GMT

    ing the same thing in several places. When we started the project, we did

  149. Avatar
    carpet cleaner monterey Fri, 06 Aug 2010 13:23:02 GMT

    Nice coding and i am searching for this in the whole google but find it now. Hats on you. Definitely making a bookmark for you.

  150. Avatar
    carpet cleaner monterey Fri, 06 Aug 2010 13:23:03 GMT

    Nice coding and i am searching for this in the whole google but find it now. Hats on you. Definitely making a bookmark for you.

  151. Avatar
    vibram fivefingers Sat, 07 Aug 2010 02:29:14 GMT

    Thank you for your article , happy to visit it.

  152. Avatar
    nike shox Sat, 07 Aug 2010 05:30:50 GMT

    It sounds very funny.

  153. Avatar
    health insurance Sat, 07 Aug 2010 05:57:51 GMT

    great article and tutorial!

  154. Avatar
    auto insurance Sat, 07 Aug 2010 05:59:00 GMT

    amazing pics!

  155. Avatar
    christian louboutin Mon, 09 Aug 2010 00:23:22 GMT

    I have been reading a lot on here and have picked up some great ideas. I am trying a couple of ideas at the moment.

  156. Avatar
    Search Engine Optimization and SEO Services Mon, 09 Aug 2010 06:06:38 GMT

    I agree with Bryan, and personally think that shared examples can be a good substitute for always having to use the before block for everything. For example, using them for before_filters.

  157. Avatar
    Phil Walbridge Mon, 09 Aug 2010 11:13:21 GMT

    we’ll need to stub login_required in several places. We can set this up in one shared group and reference it wherever necessary.

  158. Avatar
    Ice maker troubleshooting Tue, 10 Aug 2010 21:25:50 GMT

    For this matter, once I discussed with one of my friends, not only about the content you talked about, but also to how to improve and develop, but no results. So I am deeply moved by what you said today. mosquito repellent plants popcorn ceiling removal screen door repair small wedding ideas

  159. Avatar
    jordankicks Wed, 11 Aug 2010 01:26:22 GMT

    A bird in the hand is worth two in the bush

  160. Avatar
    iPhone plastic cases Wed, 11 Aug 2010 02:14:04 GMT
  161. Avatar
    http://www.kicksbar.com Wed, 11 Aug 2010 06:51:36 GMT

    jordan air force

    jordan air force Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat. Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. i love jordan air force very much. Duis te feugifacilisi. Duis autem dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit au gue duis dolore te feugat nulla facilisi.

  162. Avatar
    http://www.kicksbar.com Wed, 11 Aug 2010 06:52:42 GMT

    jordan air force Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat. Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. i love jordan air force very much. Duis te feugifacilisi. Duis autem dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit au gue duis dolore te feugat nulla facilisi.

  163. Avatar
    crazy contact lenses Wed, 11 Aug 2010 22:35:03 GMT

    At last. For two weeks I`m looking for a piece of code like this. Thanks!

    Cheers!

  164. Avatar
    netflicks Fri, 13 Aug 2010 21:49:09 GMT

    Great share thanks for the nic epost!

  165. Avatar
    Iraqi Dinar Sat, 14 Aug 2010 01:21:47 GMT

    Net surfing is a very good thing to do regularly, everyone can learn more through this network, as now I am here to your site and I have gotten some useful material from your site, must day thanks to you… Iraqi Dinar

  166. Avatar
    Moroccan furniture Fri, 20 Aug 2010 01:25:52 GMT

    I have read the above comments. It is right for your blog. Thanks for your share. Moroccan furniture

  167. Avatar
    Freelance SEO India Fri, 20 Aug 2010 16:36:46 GMT

    i have found its very easy to implement in the web projects thanks for sharing very nice article.

  168. Avatar
    half marathon training for beginners Sat, 21 Aug 2010 04:40:24 GMT

    Nice and informative and educational post and the most interesting and informative post I’ve ever seen, so the post bookmared my browser for future visits. http://www.halfmarathontrainingschedule.net [ half marathon training plan ]

  169. Avatar
    phentermine no prescription Sat, 21 Aug 2010 12:56:59 GMT

    a typical describe block and load it into any other spec groups that you need. For example, in our case, we’ll need to stub login_required in several places.

  170. Avatar
    Insurance Sat, 21 Aug 2010 21:32:34 GMT

    this shared group in any describe blocks that we want to. A benefit to this approach is that we can make change

  171. Avatar
    eskies Sun, 22 Aug 2010 10:01:52 GMT

    co-create with the world and God. God is seen as an evolving being and we are part of its evolution. This means that we are condemned to freedom, creation and participation.

  172. Avatar
    Learn Poker Sun, 22 Aug 2010 16:37:50 GMT

    just defining a method, it not ‘as’ readable but you can pass arguments and they are easy to find via method-lookup(eclipse).

  173. Avatar
    thomas sabo sale Sun, 22 Aug 2010 19:37:53 GMT

    Next you have to do is download the Drupal theme to your PC or Mac or Unzip with 7Zip Unzip or Stuffit Expander. Read the readme file. I use PSPad now to read the files and check for any additional installation instructions.

  174. Avatar
    playstation card Tue, 24 Aug 2010 01:33:45 GMT

    There’s a lots good data in this blog,i’m from london i found this on google i found this blog very interesting good luck with it i will return to this blog soon. Do you mind if I reference to this blog from my newsletter?

  175. Avatar
    asd Tue, 24 Aug 2010 07:09:58 GMT
  176. Avatar
    Links on High PR Pages Wed, 25 Aug 2010 05:21:53 GMT

    Links on High PR Pages Pretty cool post.It’s really very nice and useful post.Thanks for sharing this with us!it’s my first visit.Pretty cool post.It’s really very nice and useful post.Thanks for sharing this with us!it’s my first visit.

  177. Avatar
    Free Hosting With MYSQL Wed, 25 Aug 2010 05:31:13 GMT

    Free Hosting With MYSQL I’m so happy I stumble upon this blog! A lot of helpful info I really needed to know these stuff, I had a hard time with those foreign characters. Thank you so much

  178. Avatar
    branded shopping Wed, 25 Aug 2010 05:33:27 GMT

    branded shopping An invaluable resource and great addition to my favorites. The new features are well received on this end and will surely help the community share and progress more rapidly.

  179. Avatar
    Contract Hire Deals Wed, 25 Aug 2010 19:57:24 GMT

    By learning these technologies, you open up so much more possibilities than if you narrow yourself to a select few set of components.

  180. Avatar
    David Thu, 26 Aug 2010 03:44:39 GMT

    I too prefer excellent this post. For the information of everyone, the so named new marathon which is becoming more popular nowadays constitutes running, swimming and riding as a triathlon bike ironman. Probably the most expensive component of getting associated with a triathlon or ironman event or training is the bike. It really is imperative that the bicycle you will end up utilizing is fast, gets the proper size and as well can be achieved by your financial allowance. Buy the right triathlon wetsuit. Check out our reviews of the latest triathlon wetsuits.

  181. Avatar
    online forex trading brokers Thu, 26 Aug 2010 16:39:10 GMT

    We’ll explore tips for integrating SDD into your existing workflow and cover technical details for implementing and maintaining stories using cutting-edge tools and libraries.Thanks for the update.Great post

  182. Avatar
    pariloto rezultate Sun, 29 Aug 2010 04:00:47 GMT

    There are some very great sources here and thank you for being so kind to post them here. So we can read them and give our opinion on subject.

  183. Avatar
    Web Design Houston Sun, 29 Aug 2010 20:39:03 GMT

    I wonder if you have an update on the knee. Like you I have been suffering from knee pain for a few years now. It can be very frustrating. I will try some of the suggestions in this document. Thanks in Kindy

  184. Avatar
    Atlanta bankruptcy attorneys Tue, 31 Aug 2010 01:00:50 GMT

    Proud to be that i have gained some knowledge by reading the informative post.I was searching the net and finally i ended up in the nice post.Atlanta bankruptcy attorneys

  185. Avatar
    American sayings Tue, 31 Aug 2010 10:08:08 GMT

    Its great resource. i was finding that type inf and now i get it.thanks for this…

  186. Avatar
    jewelry buyer Houston Tue, 31 Aug 2010 19:32:25 GMT

    This is a very good article that gives in-depth information. The Indonesia men’s team has participated in the Thomas Cup 23 times, won the title 13 times and never failed to qualify. Indonesia has played in the decisive final qualifying round on 18 occasions and never failed to place among the top four. Thanks for sharing.

  187. Avatar
    David Wed, 01 Sep 2010 05:09:07 GMT

    For the information of everyone, the so named new marathon which is becoming more popular nowadays constitutes running, swimming and riding on a triathlon bike. Probably the most expensive component of getting associated with a triathlon or ironman event or training is the bike. It really is imperative that the bicycle you will end up utilizing is fast, gets the proper size and as well can be achieved by your financial allowance. Buy the right triathlon wetsuit. Check out our reviews of the latest triathlon wetsuits.

  188. Avatar
    LOUIS ANNIE Thu, 02 Sep 2010 06:00:48 GMT

Share your thoughts... (really...I want to hear them)

Comments