diff --git a/app/views/administrate/application/_collection.html.erb b/app/views/administrate/application/_collection.html.erb index 6eae9f07fffeaff64802ef506dd13e97d2444dcc..207191950be24ad9f76fb7b3a32f5d1ebd64de85 100644 --- a/app/views/administrate/application/_collection.html.erb +++ b/app/views/administrate/application/_collection.html.erb @@ -24,7 +24,8 @@ to display a collection of resources in an HTML table. <% collection_presenter.attribute_types.each do |attr_name, attr_type| %> <th class="cell-label cell-label--<%= attr_type.html_class %> - cell-label--<%= collection_presenter.ordered_html_class(attr_name) %>" + cell-label--<%= collection_presenter.ordered_html_class(attr_name) %> + cell-label--<%= "#{resource_name}_#{attr_name}" %>" scope="col" role="columnheader" aria-sort="<%= sort_order(collection_presenter.ordered_html_class(attr_name)) %>"> diff --git a/spec/features/index_page_spec.rb b/spec/features/index_page_spec.rb index 6c48b6cd0fe3d38fcf0ba9da47ea883e649eb313..276c386f77ccd9db90ce65b270b5c3a775b83f41 100644 --- a/spec/features/index_page_spec.rb +++ b/spec/features/index_page_spec.rb @@ -13,6 +13,12 @@ describe "customer index page" do expect(page).to have_content(customer.email) end + it "adds resource/attribute name to table headers" do + visit admin_customers_path + + expect(page).to have_css("th.cell-label--customer_email") + end + it "links to the customer show page", :js do customer = create(:customer)