describe("QuickBlox SDK", function() {
  var quickBlox;

  beforeEach(function (){
    quickBlox = new QuickBlox();
  });

  it("can be instantiate", function(){
    expect(new QuickBlox()).not.toBe(null);
  });

  describe("Default settings", function(){
    it("should know api endpoints and paths", function(){
      expect(quickBlox.urls).toEqual(DEFAULTS.urls);
    });
  
    it("should have the default config", function(){
      expect(quickBlox.config).toEqual(DEFAULTS.config);
    });
  });

  describe("Configuration values", function(){
    beforeEach(function (){
      quickBlox.init(CONFIG.appId, CONFIG.authKey, CONFIG.authSecret, CONFIG.debug);
    });

    it("should load the config", function(){
      expect(quickBlox.config).toEqual(CONFIG);
    });
  });

  describe("Session functions", function(){

    beforeEach(function (){
      quickBlox.init(CONFIG.appId, CONFIG.authKey, CONFIG.authSecret, CONFIG.debug);
    });

    it("should be able to create a session", function(){
      var done = false, session, error;

      runs(function(){
        quickBlox.createSession(function (err, result){
          error = err;
          sesison = result;
          done = true;
        });
      });

      waitsFor(function(){
        return done;
      },"waiting failed", 5000);

      runs(function(){
        expect(error).toBe(null);
        expect(session).not.toBe(null);
      });
    });
  });

});

@@ -1407,23 +1407,590 @@
 %7D);%0A    %7D);%0A
+%0A    it(%22should be able to delete a session%22, function()%7B%0A      var done = false, session, error;%0A%0A      runs(function()%7B%0A        quickBlox.createSession(function (err, result)%7B%0A          expect(err).toBe(null);%0A          quickBlox.destroySession(function (err, result)%7B%0A            expect(err).toBe(null);%0A            done = true;%0A          %7D);%0A        %7D);%0A      %7D);%0A%0A      waitsFor(function()%7B%0A        return done;%0A      %7D,%22waiting failed%22, 5000);%0A%0A      runs(function()%7B%0A        expect(error).toBe(null);%0A        expect(session).not.toBe(null);%0A      %7D);%0A    %7D);%0A%0A
   %7D);%0A%0A%7D);%0A

add destorySession spec (expect failure due to CORS issue)