# Good practices for testing remote Turbo Frames

**URL:** <https://discuss.hotwired.dev/t/good-practices-for-testing-remote-turbo-frames/3861>\
**Category:** General\
**Created:** [February 21, 2022, 7:37pm UTC](https://discuss.hotwired.dev/t/good-practices-for-testing-remote-turbo-frames/3861 "2022-02-21T19:37:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghiculescu](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/ghiculescu/32/1328_2.png) [@ghiculescu](https://discuss.hotwired.dev/u/ghiculescu)\
**Post date:** [February 21, 2022, 7:37pm UTC](https://discuss.hotwired.dev/t/good-practices-for-testing-remote-turbo-frames/3861/1 "2022-02-21T19:37:29Z")

</div>

I’m curious what patterns people are using for testing responses from remote loaded Turbo Frames. We end up with a lot of tests that look like this:

```ruby
get foo_path
assert_response %(turbo-frame[src="#{bar_path}"]), count: 1

get bar_path
assert_response "div"

```

But it has a few downsides: it’s fairly verbose, and it isn’t easy to assert the _combined_ content between `foo_path` and `bar_path` (which is what you’d be seeing in the browser now).

Has anyone got any nice patterns they can share for writing these sorts of tests?

---

<div class="post-metadata">

**Author:** ![matt](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/matt/32/2593_2.png) [@matt](https://discuss.hotwired.dev/u/matt)\
**Post date:** [February 21, 2022, 11:01pm UTC](https://discuss.hotwired.dev/t/good-practices-for-testing-remote-turbo-frames/3861/2 "2022-02-21T23:01:46Z")

</div>

[System tests](https://guides.rubyonrails.org/testing.html#system-testing) run in the browser and execute javascript, allowing you to test the presence of content loaded asynchronously.
