Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// The optional 'workspaceFolder' property is the path VS Code should open by default when
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/app",
"workspaceFolder": "/home/dev/app",
// "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}"

// Features to add to the dev container. More info: https://containers.dev/features.
Expand All @@ -34,5 +34,5 @@
// "customizations": {},

// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "reid"
// "remoteUser": "devcontainer"
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ demo/.yarn-integrity
demo/vendor/bundle

# For stuff that gets created if using the Dockerfile image
# These are likely no longer needed.
/.bundle/
.cache/
vendor/bundle

# Neither are many of these, I think.
# or .local/share/pry/pry_history if you need to be more exact
.local/
.irb_history
Expand Down
11 changes: 8 additions & 3 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@
# https://medium.com/@retrorubies/chrome-as-a-service-for-rails-testing-b1a45e70fec1
services:
web:
image: lenchoreyes/jade:rails-app-${RUBY_VERSION:-3.3}-sqlite-${DISTRO:-bookworm}
image: lenchoreyes/jade:rails-app-${RUBY_VERSION:-4.0}-sqlite-trixie
stdin_open: true
tty: true
user: "dev:dev"
volumes:
- .:/app:cached
- .:/home/dev/app
- dev_home:/home/dev
environment:
- HISTFILE=/app/.bash_history
- SELENIUM_HOST=selenium
- SELENIUM_PORT=4444
- TEST_APP_HOST=web
- TEST_APP_PORT=3001
ports:
- "3000"
- "3001"
- "5990"
command: /bin/bash

selenium:
Expand All @@ -34,3 +36,6 @@ services:
- LANG_WHICH=en
ports:
- "7900"

volumes:
dev_home:
5 changes: 3 additions & 2 deletions demo/test/system/bootstrap_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class BootstrapTest < ApplicationSystemTestCase
screenshot_group :readme

readme = File.read(File.expand_path("../../../README.md", __dir__))
screenshot_index = 0
augmented_readme = readme.gsub(REGEXP) do |_|
erb = Regexp.last_match(1)
header = Regexp.last_match(2)
Expand All @@ -49,7 +50,6 @@ class BootstrapTest < ApplicationSystemTestCase

visit fragment_path erb: wrapped_erb
wrapper = find(".fragment")
i = @screenshot_counter
screenshot :example, crop: bounds(wrapper)
wrapper = wrapper.find("form") if wrapped_erb != erb
html = wrapper["innerHTML"].strip.gsub("><", ">\n<")
Expand All @@ -65,8 +65,9 @@ class BootstrapTest < ApplicationSystemTestCase
end
html = doc.to_html
image = <<~MD
![Example #{i}](demo/doc/screenshots/bootstrap/readme/#{format('%02i', i)}_example.png "Example #{i}")
![Example #{screenshot_index}](demo/doc/screenshots/bootstrap/readme/#{format('%02i', screenshot_index)}_example.png "Example #{screenshot_index}")
MD
screenshot_index += 1
html = <<~MD

#{header || 'Generated HTML:'}
Expand Down