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

Version Path
activeadmin-0.6.6 spec/javascripts/compiled/jquery.aa.table-checkbox-toggler-spec.js
activeadmin-0.6.5 spec/javascripts/compiled/jquery.aa.table-checkbox-toggler-spec.js
activeadmin-0.6.4 spec/javascripts/compiled/jquery.aa.table-checkbox-toggler-spec.js
yousty-activeadmin-1.0.4.pre spec/javascripts/compiled/jquery.aa.table-checkbox-toggler-spec.js
yousty-activeadmin-1.0.3.pre spec/javascripts/compiled/jquery.aa.table-checkbox-toggler-spec.js
active_administration-0.0.3 spec/javascripts/compiled/jquery.aa.table-checkbox-toggler-spec.js
activeadministration-0.0.2 spec/javascripts/compiled/jquery.aa.table-checkbox-toggler-spec.js
active_administration-0.0.2 spec/javascripts/compiled/jquery.aa.table-checkbox-toggler-spec.js
activeadministration-0.0.1 spec/javascripts/compiled/jquery.aa.table-checkbox-toggler-spec.js
active_administration-0.0.1 spec/javascripts/compiled/jquery.aa.table-checkbox-toggler-spec.js
yousty-activeadmin-1.0.2.pre spec/javascripts/compiled/jquery.aa.table-checkbox-toggler-spec.js
activeadmin-0.6.3 spec/javascripts/compiled/jquery.aa.table-checkbox-toggler-spec.js
yousty-activeadmin-1.0.1.pre spec/javascripts/compiled/jquery.aa.table-checkbox-toggler-spec.js
yousty-activeadmin-1.0.0.pre spec/javascripts/compiled/jquery.aa.table-checkbox-toggler-spec.js
activeadmin-0.6.2 spec/javascripts/compiled/jquery.aa.table-checkbox-toggler-spec.js
activeadmin-0.6.1 spec/javascripts/compiled/jquery.aa.table-checkbox-toggler-spec.js