# Share an RSpec HTML Report — One Link Per Run

Canonical: https://commareports.com/share-rspec-report
Published: 2026-08-24

> rspec --format html writes a single self-contained file. Publish it to Comma for a URL your team can open, comment on the failing spec, and compare against the last run.

# Share an RSpec HTML report

Ruby teams have a good HTML formatter built in and almost nobody uses it,
because the output has nowhere to go. `rspec --format html --out rspec.html`
produces a clean, self-contained document — and then it sits in the working
directory of whichever machine ran the suite, so the actual sharing mechanism
stays what it always was: pasting a stack trace into Slack and hoping the
indentation survives.

## Publish it

```bash
bundle exec rspec --format progress --format html --out rspec.html
```

```ruby
require "net/http"; require "json"; require "uri"

uri = URI("https://commareports.com/api/v1/reports")
res = Net::HTTP.post(
  uri,
  { title: "Specs — #{`git rev-parse --short HEAD`.strip}",
    html: File.read("rspec.html") }.to_json,
  "Authorization" => "Bearer #{ENV.fetch('COMMA_API_TOKEN')}",
  "Content-Type"  => "application/json",
)
puts JSON.parse(res.body)["url"]
```

Two formatters in one run means CI keeps its dots and you still get the
document. No second suite execution, no separate reporting gem.

## From CI, one URL per suite

```bash
curl -fsS -X PATCH "https://commareports.com/api/v1/reports/$REPORT_ID" \
  -H "Authorization: Bearer $COMMA_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d "$(jq -n --rawfile html rspec.html '{html: $html}')"
```

Use a [scoped token](/docs/api-tokens) limited to `reports:write`. PATCHing
one id appends a revision per run at a stable URL, which turns the two
questions everyone actually asks — _was this failing before?_ and _what
changed?_ — into a [diff](/docs/ci) rather than a memory test.

Provider wiring: [GitHub Actions](/ci/github-actions-html-report),
[GitLab CI](/ci/gitlab-ci-html-report),
[CircleCI](/ci/circleci-html-report),
[Bitbucket Pipelines](/ci/bitbucket-pipelines-html-report).

## The part Slack can't do

A pasted backtrace is a dead end: no history, no anchor, and the reply that
explains it scrolls away in an hour. A published report gives the failure an
address.

- **Anchored comments** on the example that failed — see
  [commenting on HTML](/comment-on-html).
- **Revision history**, so a flaky spec's pattern is visible.
- **Access per report** — private, team, domain-gated, or named reviewers.
  See the [sharing model](/docs/sharing).

## Limits

- **HTML body: 5 MB.** A very large suite's HTML can approach it; split by
  spec directory and publish one report per suite.
- **Scripts run, sandboxed:** `allow-scripts`, no `allow-same-origin`.
- **60 requests/minute per token.**

## Try it

Comma is free — unlimited reports, unlimited commenters, unlimited revision
history.

**[Publish a spec report →](https://commareports.com/)**

### Related

- [Share a pytest report](/share-pytest-report) · [Share a Jest report](/share-jest-report)
- [Share a Cucumber report](/share-cucumber-report) · [Share a JUnit report](/share-junit-report)
- [Publish from CI](/docs/ci) · [Comment on HTML](/comment-on-html)
