Save 37% off PRO during our Black Friday Sale! »

Integration Testing Engines

Integration Testing Engines

This was a talk that covers the ways that you can integration test engines.

Be66f1ccc28a6a3dfb248454b8513b17?s=128

Ryan Bigg

April 26, 2012
Tweet

Transcript

  1. Integration testing engines Thursday, 26 April 12

  2. Disagree. Thursday, 26 April 12

  3. Rails.application.routes.draw Thursday, 26 April 12

  4. Rails.application.routes.draw bullshit. Thursday, 26 April 12

  5. Nooooooo do not draw routes on the application!!! Fuck. I

    want to jump on stage. #railsconf https://twitter.com/ryanbigg/status/194501115524554754 Thursday, 26 April 12
  6. Your::Engine.routes.draw Thursday, 26 April 12

  7. Your::Engine.routes.draw real talk. Thursday, 26 April 12

  8. Strongly Disagree. Thursday, 26 April 12

  9. mount Your::Engine, :at => “path” Thursday, 26 April 12

  10. mount Your::Engine, :at => “/” Thursday, 26 April 12

  11. OMG!!! MY ROUTES ARE BROKEN!!! Thursday, 26 April 12

  12. No. They’re not “broken” Thursday, 26 April 12

  13. They are elsewhere. Thursday, 26 April 12

  14. module Your class Engine < Rails::Engine isolate_namespace end end Thursday,

    26 April 12
  15. Your::Engine.routes.draw do resources :people end Thursday, 26 April 12

  16. Rails.application.routes.draw do resources :people end Thursday, 26 April 12

  17. your_engine.people_path main_app.people_path Thursday, 26 April 12

  18. describe Spree::ProductsController it “should get all products” do get :index

    end end Thursday, 26 April 12
  19. Thursday, 26 April 12

  20. No route matches { :controller => “Spree::ProductsController”, :action => “index”

    } Thursday, 26 April 12
  21. Lies, damned lies. Thursday, 26 April 12

  22. describe Spree::ProductsController it “should get all products” do get :index,

    :use_route => :spree end end Thursday, 26 April 12
  23. describe “products” do it “sees products” do visit products_path end

    end Thursday, 26 April 12
  24. Thursday, 26 April 12

  25. undefined method `products_path’ Thursday, 26 April 12

  26. Lies, damned lies. (again) Thursday, 26 April 12

  27. module Spree::Core::UrlHelpers def spree Spree::Core::Engine.routes.url_helpers end end Thursday, 26 April

    12
  28. describe “products” do it “sees products” do visit spree.products_path end

    end Thursday, 26 April 12
  29. Thursday, 26 April 12

  30. Rails 3 in Action manning.com/katz Chapter Thursday, 26 April 12