spec/helper_spec.rb in table_help-0.1.6 vs spec/helper_spec.rb in table_help-0.1.7
- old
+ new
@@ -24,14 +24,22 @@
it "builds an HTML table" do
is_expected.to have_css "td.col-title", text: "My Awesome Title"
end
end
- context "when passed an ActiveRecord::Relation" do
+ context "when passed an Enumerable" do
let(:articles) { Article.all.to_a }
it "builds an HTML table" do
is_expected.to have_css "td.col-title", text: "My Awesome Title"
+ end
+ end
+
+ context "when passed an empty Enumerable" do
+ let(:articles) { [] }
+
+ it "does not build an HTML table" do
+ is_expected.to be_nil
end
end
end
describe "#attributes_table_for" do