Sha256: 55543aad6baf5952a5510a9d65abbcdb66ca7f71574bc104465fb7e8880b9a3a
Contents?: true
Size: 1.43 KB
Versions: 16
Compression:
Stored size: 1.43 KB
Contents
(function() { describe("ActiveAdmin.TableCheckboxToggler", function() { beforeEach(function() { loadFixtures('table_checkboxes.html'); this.collection = $("#collection"); this.toggle_all = this.collection.find(".toggle_all"); this.checkboxes = this.collection.find(":checkbox").not(this.toggle_all); return new ActiveAdmin.TableCheckboxToggler({}, this.collection); }); describe("'selected' class for table row", function() { it("should add the class 'selected' to rows when their checkbox is checked ", function() { var checkbox; checkbox = $("#item_1"); checkbox.attr("checked", "checked"); checkbox.trigger("change"); return expect(checkbox.parents("tr")).toHaveAttr("class", "selected"); }); return it("should remove the class 'selected' from rows when their checkbox is unchecked ", function() { var checkbox; checkbox = $("#item_1"); checkbox.trigger("change"); return expect(checkbox.parents("tr")).not.toHaveAttr("class", "selected"); }); }); return describe("clicking a cell", function() { return it("should toggle the checkbox when a cell is clicked", function() { var checkbox, row; checkbox = $("#item_1"); row = checkbox.parents("td"); $(row).trigger("click"); return expect(checkbox).toHaveAttr("checked", "checked"); }); }); }); }).call(this);
Version data entries
16 entries across 16 versions & 4 rubygems