Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 2 files changed
  • 0 comments
  • 1 contributor
2  app/views/datagrid/_table.html.erb
@@ -10,7 +10,7 @@ Local variables:
10 10 </thead>
11 11 <tbody>
12 12 <% if grid.rows.empty? %>
13   - <tr><td class="noresults" colspan="100%"><%= I18n.t 'datagrid.no_results', :default => 'No results found.' %></td></tr>
  13 + <tr><td class="noresults" colspan="100%"><%= I18n.t 'datagrid.no_results', :default => '&mdash;&mdash;'.html_safe %></td></tr>
14 14 <% else %>
15 15 <%= datagrid_rows(grid, assets, options) %>
16 16 <% end %>
16 spec/datagrid/helper_spec.rb
@@ -26,6 +26,22 @@
26 26 ) }
27 27 let(:grid) { SimpleReport.new }
28 28
  29 + context "when grid has no records" do
  30 + let(:grid) do
  31 + test_report do
  32 + scope { Entry.where("1 != 1") }
  33 + end
  34 + end
  35 +
  36 + it "should show an empty table with dashes" do
  37 + datagrid_table = subject.datagrid_table(grid)
  38 +
  39 + datagrid_table.should match_css_pattern(
  40 + "table.datagrid tr td.noresults" => 1
  41 + )
  42 + end
  43 + end
  44 +
29 45 describe ".datagrid_table" do
30 46 it "should have grid class as html class on table" do
31 47 subject.datagrid_table(grid).should match_css_pattern(

No commit comments for this range

Something went wrong with that request. Please try again.