Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Teaching RSpec to play nice with Rails
Search
Penelope Phippen
April 25, 2017
Technology
2
160
Teaching RSpec to play nice with Rails
Presented at Railsconf 2017. Video here:
https://www.youtube.com/watch?v=jyPfrK1y1nc
Penelope Phippen
April 25, 2017
Tweet
Share
More Decks by Penelope Phippen
See All by Penelope Phippen
Introducing Rubyfmt
penelope_zone
0
600
How RSpec Works
penelope_zone
0
6.8k
Quick and easy browser testing using RSpec and Rails 5.1
penelope_zone
1
100
Little machines that eat strings
penelope_zone
1
120
What is processor (brighton ruby edition)
penelope_zone
0
130
What is processor?
penelope_zone
1
380
extremely defensive coding - rubyconf edition
penelope_zone
0
290
Agile, etc.
penelope_zone
2
240
Extremely Defensive Coding
penelope_zone
0
120
Other Decks in Technology
See All in Technology
使って学ぼう MCP (と GitHub Codespaces)
tsubakimoto_s
1
200
【Developers Summit 2026】Memory Is All You Need:コンテキストの「最適化」から「継続性」へ ~RAGを進化させるメモリエンジニアリングの最前線~
shisyu_gaku
3
360
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
10
74k
Oracle Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
3
720
生成AIで始める業務改革 - 製造業編 in 福島 -
daikikanemitsu
2
620
プロダクト開発の品質を守るAIコードレビュー:事例に見る導入ポイント
moongift
PRO
1
130
Goで実現する堅牢なアーキテクチャ:DDD、gRPC-connect、そしてAI協調開発の実践
fujidomoe
3
500
ECSネイティブのBlue/Green デプロイを攻略しよう ~CodeDeployとの違いから、デプロイフロー実装まで~
ideaws
3
290
AIで「ふとした疑問」を即座に検証する 〜定量で圧倒するN1理解〜
kakehashi
PRO
3
580
「OSアップデート:年に一度の「大仕事」を乗り切るQA戦略」_Mobile Tech Flex 〜4社合同!私たちのモバイル開発自慢大会〜
gu3
0
190
AWSが推進するAI駆動開発ライフサイクル入門 〜 AI駆動開発時代に必要な人材とは 〜/ introduction_to_aidlc_and_skills
fatsushi
7
3.6k
EMから現場に戻って見えた2026年の開発者視点
sudoakiy
1
270
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
140
AI: The stuff that nobody shows you
jnunemaker
PRO
3
310
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
610
Designing for humans not robots
tammielis
254
26k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
270
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
120
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Google's AI Overviews - The New Search
badams
0
920
Transcript
Teaching RSpec to play nice with Rails @samphippen
Friends, it’s good to be back
Last year I had a life threatening illness
None
A precious bag of ceftriaxone, saving my life
None
Thanks @searls
Thanks @searls #samphippenisjustin searlsconfirmed
5.1
Yes*
ActionChatbox::TestCase
ActionDispatch ::BeliefSystemTestCase
Have some faith in us
5.1 has not been released yet
No changes required by you
Released soon in 3.6.0
No system test integration
but I would welcome a PR
RSpec + Rails
RSpec
RSpec isn’t a monolith
gem “rspec”, “~> 3.5”
Does nothing on it’s own
None
None
None
None
Internal shared code
rspec-rails
None
None
RSpec Rails
RSpec Rails our code Your rails version
gem “rspec”, “~> 3.5” gem “rspec-rails”, “~> 3.5”
gem “rspec-rails”, “~> 3.5”
Rails
Rails is a big complicated library
RSpec is extremely permissive about rails versions
>= 3.0
None
None
None
Don’t ask
5
RSpec’s rails 5 compatability was not a smooth ride
Lesson 1: 5.0 means they break things
None
None
None
None
None
Let’s just make sure this works with RSpec
None
View specs don’t work
Specifically path helpers
None
None
Switch back to working version of rails
None
Work out what changed
controller .singleton_class .ancestors
None
None
So we lost 3 random anonymous modules
WTF even are they?
actionpack-5.0.0.beta2/ lib/action_dispatch/ routing/route_set.rb:283
At this point we call in an emergency rails maintainer
None
None
None
This is a huge win for collaboration
Lesson 2: Some bugs are in Rails
None
What the hell is a signed cookie?
None
None
None
None
None
So now the fun begins
git clone rails/rails
Point the app at that rails clone
git bisect bad
git checkout v4.2.0.beta4
git bisect good
None
None
None
and then I left it for a while
and went to Rubyconf
“You have a breaking commit sha? Show me”
None
None
None
“can be replicated purely with Rails using public API”
There exists a twisty turny maze of dependencies
Before filling an issue on a gem, check it’s not
in a dep
Lesson 3: Sometimes you can’t call in @sgrif
None
None
None
None
“I made a short screencast”
None
None
Do the bisect shimmy and shake
None
None
None
None
Explaining a lot of context in a PR message is
super useful
None
Gets merged!
None
It is fine to poke a maintainer to close an
issue once they’ve fixed it
Summary
A lot of bugs that appear in RSpec can be
because of rails
Literally every fix we saw today was in a rails
gem
A Rails reproduction script is a great place to start
None
I will almost always ask you for a reproduction sample
app
Just calling @sgrif is a great way to get rails
bugs fixed
None
Working on open source is really hard
None
This work represented 40+ hours of donated maintainer time
Hug a maintainer
Find some time to work on open source
Pay a maintainer?
None
None
Thanks @samphippen
[email protected]
Let’s have some questions