Skip to content

Commit

Permalink
fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob committed Jul 16, 2024
1 parent fd344fa commit bfdf3dd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/components/avo/index/resource_controls_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ def destroy_path
resource: @resource,
via_resource_class: params[:via_resource_class],
via_record_id: params[:via_record_id],
related_name: params[:related_name]
related_name: params[:related_name],
association_name: params[:association_name]
)
end

Expand Down
2 changes: 1 addition & 1 deletion app/components/avo/views/resource_show_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def initialize(resource: nil, reflection: nil, parent_resource: nil, parent_reco
end

def title
if @reflection.present? && !is_associated_record?
if @reflection.present?
return field.name if has_one_field?

reflection_resource.name
Expand Down
2 changes: 1 addition & 1 deletion spec/features/avo/use_resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
href: "/admin/resources/compact_users/#{comment.user.slug}?related_name=user&via_record_id=#{comment.id}&via_resource_class=Avo%3A%3AResources%3A%3AComment"

click_on comment.user.name
expect(page).to have_current_path "/admin/resources/compact_users/#{comment.user.slug}?via_record_id=#{comment.id}&via_relation=comments&via_resource_class=Avo%3A%3AResources%3A%3AComment"
expect(page).to have_current_path "/admin/resources/compact_users/#{comment.user.slug}?related_name=user&via_record_id=#{comment.id}&via_resource_class=Avo%3A%3AResources%3A%3AComment"

expect(page).to have_text "Personal information"
expect(page).to have_text "Contact"
Expand Down

0 comments on commit bfdf3dd

Please sign in to comment.