Skip to content

Instantly share code, notes, and snippets.

@JoeDupuis
Created June 7, 2023 05:19
Show Gist options
  • Save JoeDupuis/74eec3924b0fbc8ca4c1030b8a38c9d9 to your computer and use it in GitHub Desktop.
Save JoeDupuis/74eec3924b0fbc8ca4c1030b8a38c9d9 to your computer and use it in GitHub Desktop.
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem "rails", github: "rails/rails", branch: "main"
gem "capybara"
gem "selenium-webdriver"
gem "selenium"
gem "pry"
gem "rack", "2.2.4"
gem "puma", "~> 5.0"
GIT
remote: https://github.com/rails/rails.git
revision: 655278edeb82ec5f081313abf9c9f59c8be76b22
branch: main
specs:
actioncable (7.1.0.alpha)
actionpack (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.1.0.alpha)
actionpack (= 7.1.0.alpha)
activejob (= 7.1.0.alpha)
activerecord (= 7.1.0.alpha)
activestorage (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.0.alpha)
actionpack (= 7.1.0.alpha)
actionview (= 7.1.0.alpha)
activejob (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.1.0.alpha)
actionview (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
nokogiri (>= 1.8.5)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.0.alpha)
actionpack (= 7.1.0.alpha)
activerecord (= 7.1.0.alpha)
activestorage (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.1.0.alpha)
activesupport (= 7.1.0.alpha)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.6)
activejob (7.1.0.alpha)
activesupport (= 7.1.0.alpha)
globalid (>= 0.3.6)
activemodel (7.1.0.alpha)
activesupport (= 7.1.0.alpha)
activerecord (7.1.0.alpha)
activemodel (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
activestorage (7.1.0.alpha)
actionpack (= 7.1.0.alpha)
activejob (= 7.1.0.alpha)
activerecord (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
marcel (~> 1.0)
activesupport (7.1.0.alpha)
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
rails (7.1.0.alpha)
actioncable (= 7.1.0.alpha)
actionmailbox (= 7.1.0.alpha)
actionmailer (= 7.1.0.alpha)
actionpack (= 7.1.0.alpha)
actiontext (= 7.1.0.alpha)
actionview (= 7.1.0.alpha)
activejob (= 7.1.0.alpha)
activemodel (= 7.1.0.alpha)
activerecord (= 7.1.0.alpha)
activestorage (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
bundler (>= 1.15.0)
railties (= 7.1.0.alpha)
railties (7.1.0.alpha)
actionpack (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
irb
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0)
builder (3.2.4)
capybara (3.39.1)
addressable
matrix
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
coderay (1.1.3)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
crass (1.0.6)
date (3.3.3)
erubi (1.12.0)
globalid (1.1.0)
activesupport (>= 5.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
io-console (0.6.0)
irb (1.7.0)
reline (>= 0.3.0)
jar_wrapper (0.1.8)
zip
loofah (2.21.3)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
marcel (1.0.2)
matrix (0.4.2)
method_source (1.0.0)
mini_mime (1.1.2)
minitest (5.18.0)
net-imap (0.3.4)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
timeout
net-smtp (0.3.3)
net-protocol
nio4r (2.5.9)
nokogiri (1.15.2-x86_64-linux)
racc (~> 1.4)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.0.1)
puma (5.6.5)
nio4r (~> 2.0)
racc (1.6.2)
rack (2.2.4)
rack-session (1.0.1)
rack (< 3)
rack-test (2.1.0)
rack (>= 1.3)
rackup (1.0.0)
rack (< 3)
webrick
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
rake (13.0.6)
regexp_parser (2.8.0)
reline (0.3.5)
io-console (~> 0.5)
rexml (3.2.5)
rubyzip (2.3.2)
selenium (0.2.11)
jar_wrapper
selenium-webdriver (4.9.1)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
thor (1.2.2)
timeout (0.3.2)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
webrick (1.8.1)
websocket (1.2.9)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.8)
zip (2.0.2)
PLATFORMS
x86_64-linux
DEPENDENCIES
capybara
pry
puma (~> 5.0)
rack (= 2.2.4)
rails!
selenium
selenium-webdriver
BUNDLED WITH
2.3.7
# frozen_string_literal: true
require "rails/all"
require "minitest/autorun"
require "capybara"
require "pry"
class TestApp < Rails::Application
config.root = __dir__
config.hosts << "example.org"
secrets.secret_key_base = "secret_key_base"
config.consider_all_requests_local = true
config.logger = Logger.new($stdout)
Rails.logger = config.logger
routes.draw do
get "/" => "test#index"
get "/page" => "test#other_page"
end
end
class TestController < ActionController::Base
include Rails.application.routes.url_helpers
def index
render inline: <<-EOF
<!DOCTYPE html>
<html>
<head>
<title>TestApp</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= javascript_tag type: :module do %>
import "https://cdn.skypack.dev/@hotwired/turbo@#{params[:turbo_version]}"
<% end %>
</head>
<turbo-frame id="unique-id" src="/page?turbo_version=#{params[:turbo_version]}">
Loading...
</turbo-frame>
<body>
</body>
</html>
EOF
end
def other_page
raise StandardError.new
render inline: <<-EOF
<!DOCTYPE html>
<html>
<head>
<title>TestApp</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= javascript_tag type: :module do %>
import "https://cdn.skypack.dev/@hotwired/turbo@#{params[:turbo_version]}"
<% end %>
</head>
<turbo-frame id="unique-id">
Loaded
</turbo-frame>
<body>
</body>
</html>
EOF
end
end
Capybara.server = :webrick
class BugTest < ActionDispatch::SystemTestCase
driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
def take_failed_screenshot; end
def test_old_version
visit "/?turbo_version=7.2.5"
assert_text "StandardError in TestController#other_page"
assert_text "Extracted source"
end
def test_new_version
visit "/?turbo_version=7.3.0"
assert_text "StandardError in TestController#other_page"
assert_text "Extracted source"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment