describe('cdb.admin.Grantables', function () {
  beforeEach(function() {
    this.org = new cdb.admin.Organization({
      id: 'o1'
    });
    this.grantables = new cdb.admin.Grantables(undefined, {
      organization: this.org
    });
  });

  it('should have a working URL', function() {
    expect(this.grantables.url()).toMatch('/organization/o1/grantables');
  });

  describe('when is fetched', function() {
    beforeEach(function() {
      this.grantables.sync = function(a,b,opts) {
        opts.success && opts.success({
          "grantables":[{
            "id":"u1",
            "type":"user",
            "name":"an user",
            "avatar_url":"images/avatars/avatar_marker_red.png",
            "model": {
              "id":"u1",
              "username":"foo",
              // …
            },
          }, {
            "id":"g1",
            "type":"group",
            "name":"my group",
            "avatar_url":"avatar_marker_red.png",
            "model": {
              "id":"g1",
              "display_name":"my group",
              "name":"my_group",
              // …
            },
          }],
          "total_entries": 2
        });
      };
      this.grantables.fetch();
    });

    it('should parse response and set grantables model', function() {
      expect(this.grantables.length).toEqual(2);
      expect(this.grantables.first().id).toEqual('u1');
    });
  });
});

@@ -221,16 +221,43 @@
 this.org
+,%0A      currentUserId: 'u2'
 %0A    %7D);
@@ -848,24 +848,78 @@
        %7D, %7B%0A
+            %22id%22: %22u2%22 // current user%0A          %7D, %7B%0A
             
@@ -1235,17 +1235,17 @@
 tries%22: 
-2
+3
 %0A       
@@ -1317,27 +1317,8 @@
 uld 
-parse response and 
 set 
@@ -1333,16 +1333,273 @@
 es model
+', function() %7B%0A      expect(this.grantables.length).toBeGreaterThan(0);%0A    %7D);%0A%0A    it('should set organization on grantables collection', function() %7B%0A      expect(this.grantables.organization).toBe(this.org);%0A    %7D);%0A%0A    it('should not add current user
 ', funct
@@ -1688,18 +1688,75 @@
 les.
-first().id
+total_entries).toEqual(2);%0A      expect(this.grantables.pluck('id')
 ).to
@@ -1765,12 +1765,19 @@
 ual(
+%5B
 'u1'
+,'g1'%5D
 );%0A 

Test grantables parsing filtering out current user