From 63716b49ff7a004a74a556a44cafc0c27701b62b Mon Sep 17 00:00:00 2001 From: Paul Bob Date: Fri, 19 Jul 2024 17:28:35 +0300 Subject: [PATCH] another approach --- spec/dummy/app/avo/resources/user.rb | 2 +- spec/system/avo/tabs_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/dummy/app/avo/resources/user.rb b/spec/dummy/app/avo/resources/user.rb index 292cc9b87a..df1e974c25 100644 --- a/spec/dummy/app/avo/resources/user.rb +++ b/spec/dummy/app/avo/resources/user.rb @@ -109,7 +109,7 @@ def main_panel_fields field :cv, as: :file, name: "CV" field :is_admin?, as: :boolean, name: "Is admin", only_on: :index field :roles, as: :boolean_group, options: {admin: "Administrator", manager: "Manager", writer: "Writer"} - field :permissions, as: :boolean_group, options: {create: "Create", read: "Read", update: "Update", delete: "Delete"}, hide_on: :index + field :permissions, as: :boolean_group, options: {create: "Create", read: "Read", update: "Update", delete: "Delete"} field :birthday, as: :date, first_day_of_week: 1, diff --git a/spec/system/avo/tabs_spec.rb b/spec/system/avo/tabs_spec.rb index dd112a41e4..5332c165d7 100644 --- a/spec/system/avo/tabs_spec.rb +++ b/spec/system/avo/tabs_spec.rb @@ -8,9 +8,9 @@ it "doesn't display the birthday from the tab content" do visit "/admin/resources/users" - expect(find("table thead").text).to eq "Select all\n\t\nID\n\t\nAVATAR\n\t\nFIRST NAME\n\t\nLAST NAME\n\t\nUSER EMAIL\n\t\nIS ACTIVE\n\t\nCV\n\t\nIS ADMIN\n\t\nROLES\n\t\nBIRTHDAY\n\t\nIS WRITER" + expect(find("table thead").text).to eq "Select all\n\t\nID\n\t\nAVATAR\n\t\nFIRST NAME\n\t\nLAST NAME\n\t\nUSER EMAIL\n\t\nIS ACTIVE\n\t\nCV\n\t\nIS ADMIN\n\t\nROLES\n\t\nPERMISSIONS\n\t\nBIRTHDAY\n\t\nIS WRITER" within find("tr[data-resource-id='#{user.to_param}']") do - expect(find_all("table tbody tr td")[10].text).to eq "Wednesday, 10 February 1988" + expect(find_all("table tbody tr td")[11].text).to eq "Wednesday, 10 February 1988" end end end