Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Code Fellows Kickoff (D32 & D33)

Avatar for Brook Riggio Brook Riggio
March 02, 2015
130

Code Fellows Kickoff (D32 & D33)

Welcome to the new students!

Avatar for Brook Riggio

Brook Riggio

March 02, 2015

Transcript

  1. Brook Riggio @brookr Runs a Seattle based Web App Consultancy,

    and teaches Web Development in a variety of contexts
  2. About Us Brook ✤ Fondly remembers Christmas of '88 ✤

    Basic -> Java -> ASP -> SQL -> PHP -> Rails -> Ruby ✤ Freelance consulting since 2004 ✤ Independent instructor -> UW & Code Fellows ✤ Excited about your latent super powers
  3. About Us Dexter ✤ Breaking Making websites since 2005 ✤

    HTML -> CSS -> Javascript -> Sass ✤ Code Fellows UI graduate ✤ Teaching with Code Fellows since 2014
  4. This is more like work than traditional classes Things will

    be ambiguous We are here to help, coach, guide, connect dots, and lastly, instruct.
  5. 90% 75% 50% 30% 20% 10% Teaching others Practice Doing

    Discussion Demonstration Audiovisual Reading Lecture Learning Pyramid Average student retention rate
  6. ==

  7. 15

  8. A Good Question • Saves time • Keeps everyone happy

    • (Im)proves your communication skills • (Im)proves your diagnostic skills • Is about one specific issue
  9. A Good Question has 4 parts 1.Context: Project Name, or

    if new, what the app does 2.Expected Outcome 3.Unexpected behavior 4.Error message, line#, and Diagnosis Steps taken
  10. A Good Question •On my Portfolio site / Comments •I

    was trying to add a comment •I’m getting an undefined method for Nil and I can’t add a comment •I looked at comments_controller.rb and I can’t figure out what is nil on line 39
  11. What's a Gist? • Don't spam the #channel on IRC

    • Post large blocks of text to https://gist.github.com • Post multiple related files and a stack trace • Name your files with the proper extension: .rb .yaml .txt • So that syntax highlighting works
  12. Ruby on Rails Used by companies big & small Rapid

    Prototyping Startups Large-scale deployments Enterprise external/internal
  13. For me the purpose of life is partly to have

    joy. Programmers often feel joy when they can concentrate on the creative side of programming, So Ruby is designed to make programmers happy まつもとゆきひろ
  14. What makes Rails work so well? • Convention over Configuration

    • Promotes best practices • MVC (Model-View-Controller) • REST (REpresentational State Transfer) • ORM (Object Relational Mapping)
  15. MVC Model talks to the database View makes data look

    good Controller handles user requests
  16. Install Process Overview Mac Command Line Tools:
 xcode-select —install •

    Install:
 - Homebrew
 - node.js
 - version manager? gem install rails Ubuntu • Install:
 - build-essential, etc.
 - Nodejs
 - version manager? gem install rails Report:
 ruby -v
 rails -v
  17. The Story of our App • BDD • Design •

    MVC • AuthAuth • OAuth • Email • Background Jobs
  18. The Agile Manifesto We are uncovering better ways of developing


    software by doing it and helping others do it.
 Through this work we have come to value: Individuals and interactions over processes and tools
 Working software over comprehensive documentation
 Customer collaboration over contract negotiation
 Responding to change over following a plan That is, while there is value in the items on
 the right, we value the items on the left more. http://agilemanifesto.org/
  19. How do you test web apps now? • click •

    click • click • click • type • click • click • click • type • click • click • type
  20. You have a test plan. But it sucks! ✓ You

    just haven’t written it ✓ Write it down ✓ Better yet, automate it
  21. Types of Testing • Unit • Functional • Integration •

    Acceptance • Regression
 FAIL PASS REFACTOR
  22. FAIL PASS REFACTO R Types of Testing - Ruby on

    Rails • Unit == Model • Functional == Controller • Integration (system wide, including Views) • Acceptance (behavior of the system • Regression (any of the above,
 when you find a bug)

  23. Testing Religious War! • Test Driven Development ( TDD )

    • Using tests to drive the design • Behavior Driven Development ( BDD ) • Emphasizes outside-in development from business goals • Uses examples (user stories) • Creates a shared language between developer and client (management)
  24. PhantomJS / Webkit • Simulates how a real user would

    interact with your app. • Headless • Using browser: Selenium
  25. Acceptance Testing basics # Navigating visit('/projects') visit(post_comments_path(post)) #rails route helper

    # Clicking links and buttons click_link('id-of-link') click_link('Link Text') click_button('Save') click_on('Link Text') # Click either a link or a button click_on('Button Value') source: https://gist.github.com/zhengjia/428105
  26. Acceptance testing basics - forms source: https://gist.github.com/zhengjia/428105 # Interacting with

    forms fill_in('First Name', :with => 'John') fill_in('Password', :with => 'Seekrit') fill_in('Description', :with => 'Really Long Text…') choose('A Radio Button') check('A Checkbox') uncheck('A Checkbox') attach_file('Image', '/path/to/image.jpg') select('Option', :from => 'Select Box')
  27. Capybara - the session object • page.text • no html

    • page.body • html • save_and_open_page • opens the page's html in your browser (needs the launchy gem) http://rubydoc.info/github/jnicklas/capybara/master/Capybara/Session
  28. spec/spec_helper.rb require "minitest/autorun" require "minitest/spec" class FeatureSpec < MiniTest::Spec require

    "capybara/webkit" include Capybara::DSL Capybara.default_driver = :webkit register_spec_type(/page$/, self) end
  29. spec/features/search_spec.rb require "spec_helper" describe "My search page" do it "has

    results" do visit "http://google.com" fill_in "q", with: "Code Fellows" click_on "Google Search" page.text.must_include "codefellows.org" page.text.must_include "twitter.com/CodeFellowsOrg" end end
  30. spec/features/welcome_page_spec.rb require "spec_helper" describe "A local web page" do it

    "has a welcome headline" do visit "http://localhost:4000/public/" page.text.must_include "Welcome aboard" end end
  31. spec/features/rails_new_spec.rb require "spec_helper" describe "My Rails App welcome page" do

    it "shows the welcome message" do visit "http://localhost:3000" page.text.must_include "Welcome aboard" end end