Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob committed Sep 27, 2024
1 parent bdf0762 commit 562a4ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spec/dummy/app/avo/resources/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,11 @@ def second_tabs_group
field :comments,
as: :has_many,
# show_on: :edit,
scope: -> { query.starts_with parent.first_name[0].downcase },
scope: -> {
TestBuddy.hi("parent_resource:#{parent_resource.present?},resource:#{resource.present?}")

query.starts_with parent.first_name[0].downcase
},
description: "The comments listed in the attach modal all start with the name of the parent user."
field :comment, as: :has_one, name: "Main comment"
end
Expand Down
1 change: 1 addition & 0 deletions spec/features/avo/has_many_field_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
let!(:a_comment) { create :comment, user: user, body: "A comment that starts with the letter A" }

subject do
expect(TestBuddy).to receive(:hi).with("parent_resource:true,resource:true").at_least :once
visit "/admin/resources/users/#{user.id}/comments?turbo_frame=has_many_field_show_comments"
page
end
Expand Down

0 comments on commit 562a4ef

Please sign in to comment.