Skip to content

Commit

Permalink
another approach
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob committed Jul 19, 2024
1 parent e505566 commit 63716b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spec/dummy/app/avo/resources/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions spec/system/avo/tabs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 63716b4

Please sign in to comment.