Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added a spec for a grid with no results.

  • Loading branch information...
commit a1ca72d3182f9ad78684b50c2b0da71726dd82dd 1 parent 9ca2673
@barendt authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 spec/datagrid/helper_spec.rb
View
16 spec/datagrid/helper_spec.rb
@@ -26,6 +26,22 @@
) }
let(:grid) { SimpleReport.new }
+ context "when grid has no records" do
+ let(:grid) do
+ test_report do
+ scope { Entry.where("1 != 1") }
+ end
+ end
+
+ it "should show an empty table with dashes" do
+ datagrid_table = subject.datagrid_table(grid)
+
+ datagrid_table.should match_css_pattern(
+ "table.datagrid tr td.noresults" => 1
+ )
+ end
+ end
+
describe ".datagrid_table" do
it "should have grid class as html class on table" do
subject.datagrid_table(grid).should match_css_pattern(
Please sign in to comment.
Something went wrong with that request. Please try again.