Skip to content

Conversation

@tombruijn
Copy link
Member

@tombruijn tombruijn commented Aug 28, 2025

Fix middleware assertion in Railtie spec

It only asserted what happened the first time the app was initialized, because it remained stored on the MyApp constant. So we were testing a static value.

This update tests the actual middleware that get added to the stack.

Test if the AppSignal middleware isn't added

Test the change that doesn't add the middleware to the app if AppSignal is not active and the start_at is on_load (the default).

[skip changeset]

Based on #1444

It only asserted what happened the first time the app was initialized,
because it remained stored on the MyApp constant. So we were testing a
static value.

This update tests the actual middleware that get added to the stack.
Test the change that doesn't add the middleware to the app if AppSignal
is not active and the `start_at` is `on_load` (the default).

[skip changeset]
@tombruijn tombruijn self-assigned this Aug 28, 2025
@tombruijn tombruijn added the chore A small task that takes a day or two at the most. label Aug 28, 2025
@tombruijn tombruijn requested a review from unflxw August 28, 2025 15:14
@tombruijn tombruijn marked this pull request as ready for review August 28, 2025 15:14
Copy link
Contributor

@unflxw unflxw left a comment

Choose a reason for hiding this comment

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

It only asserted what happened the first time the app was initialized, because it remained stored on the MyApp constant. So we were testing a static value.

Ah, that's what was getting me confused earlier! Thank you so much for looking into this.

@unflxw unflxw merged commit 105511a into only-instrument-rails-if-appsignal-started Aug 28, 2025
187 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore A small task that takes a day or two at the most.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants