Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Testing with Rspec on Rails
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Shinn Chong
July 16, 2014
Programming
32
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Testing with Rspec on Rails
Introduction to Testing
Shinn Chong
July 16, 2014
Other Decks in Programming
See All in Programming
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
180
dotNET_vulnclicker_intro.pdf
deka_morita
0
140
JIS keyboard support in Omarchy
lef237
0
120
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
2
570
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
170
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
6.6k
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
270
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
420
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
1
430
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
430
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
480
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Git: the NoSQL Database
bkeepers
PRO
433
67k
Designing for Performance
lara
612
70k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
320
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
Visualization
eitanlees
153
17k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
260
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
600
How STYLIGHT went responsive
nonsquared
100
6.3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Transcript
Testing with RSpec on Rails
Why testing? • Delivery with confident • Know your application
flow • Regression testing • Leads to a more manageable codebase • YOLO!
The “spec” folder ? ? ?
Feature specs • AKA Integration Testing • AKA Acceptance Testing
• AKA End-to-end testing • Walk through your entire application • Fully automated with Capybara • features/ with RSpec
Controller specs • Testing for multiple paths • Check for
invalid variables in the controller • Easier to write
Model specs • Unit Testing • ‘.class_method’ • ‘#instance_method’
Routing specs • Write tests for route.rb • To test
the available routes • Especially useful for large application • Easiest to implement
Factories • Factory Girl • Fixtures replacement • Setting up
Ruby objects as test data • Good for building multiple strategies • saved instances (create) • unsaved instance (build) • attribute hashes (attributes_for) • Alternatively, Fabrication
Tools • Guard • Faker • Capybara • selenium /
capybara-webkit • database_cleaner • shoulda-matchers • spring / zeus / spork
http://www.justinweiss.com/blog/2014/06/02/ how-to-learn-tdd-without-getting-overwhelmed/ How to Learn TDD Without Getting Overwhelmed?
Everyday Rails Testing with RSpec http://everydayrails.com/rspecbook/ References
http://betterspecs.org/ References
Questions?