Skip to content

Add request tests for core Rails endpoints#45

Draft
roo-code-bruno[bot] wants to merge 1 commit into
mainfrom
feature/add-core-flow-request-tests-0d3nr783z2vft
Draft

Add request tests for core Rails endpoints#45
roo-code-bruno[bot] wants to merge 1 commit into
mainfrom
feature/add-core-flow-request-tests-0d3nr783z2vft

Conversation

@roo-code-bruno
Copy link
Copy Markdown

@roo-code-bruno roo-code-bruno Bot commented Apr 1, 2026

Opened by @roo-code-bruno on behalf of Bruno Bergher. View task here or @-mention @roo-code-bruno in a comment on this PR to ask for changes, clarification, or follow-up work.

What problem this solves

The app's core HTTP flows did not have request-level coverage, so regressions in /, /ping, or /increment could slip through without failing the test suite.

Why this change was made

This adds a focused request test file that exercises the current route and controller behavior, verifies the /ping JSON contract, and confirms /increment redirects home while enqueuing IncrementCounterJob and leaving the counter unchanged until the async job runs.

User impact

Changes to the home page route, ping endpoint, or increment action now surface quickly through bin/rails test instead of being caught only in manual testing.

Interactively review PR in Roomote

@roo-code-bruno
Copy link
Copy Markdown
Author

roo-code-bruno Bot commented Apr 1, 2026

Actionable issues found. See task:

  • The GET / request test pre-creates the clicks counter, so it never verifies that the home page still bootstraps the record from an empty database.

Fix all unresolved issues

end

test "GET / responds successfully" do
counter = Counter.clicks
Copy link
Copy Markdown
Author

@roo-code-bruno roo-code-bruno Bot Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pre-creates the clicks row before the request, so the test no longer exercises the controller path that bootstraps the counter from an empty database. A regression where home#index stops initializing that record would still pass here.

Fix it with Roomote

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant