diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-11 21:38:20 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-11 21:38:20 +0200 |
commit | eda8fec5874ebd2ba48b458497cb315eb871105c (patch) | |
tree | b801eee009361a7e965d205de9d792498eb8d1fa /js/tests/services/bl/folderblSpec.coffee | |
parent | b06fc20ddbadbc7522cd23a83a20975f43889890 (diff) |
autoselect folder when it was created and open folder if a feed gets added to it
Diffstat (limited to 'js/tests/services/bl/folderblSpec.coffee')
-rw-r--r-- | js/tests/services/bl/folderblSpec.coffee | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/js/tests/services/bl/folderblSpec.coffee b/js/tests/services/bl/folderblSpec.coffee index 6fd35f73e..3ca761f7d 100644 --- a/js/tests/services/bl/folderblSpec.coffee +++ b/js/tests/services/bl/folderblSpec.coffee @@ -168,13 +168,14 @@ describe 'FolderBl', -> onSuccess = jasmine.createSpy('Success') @persistence.createFolder = jasmine.createSpy('add folder') @persistence.createFolder.andCallFake (folderName, parentId, success) => - response = + @response = status: 'ok' - success(response) + data: 'jooo' + success(@response) @FolderBl.create(' johns ', onSuccess) - expect(onSuccess).toHaveBeenCalled() + expect(onSuccess).toHaveBeenCalledWith(@response.data) it 'should call the handle a response error when creating a folder', => @@ -203,3 +204,19 @@ describe 'FolderBl', -> expect(@FolderModel.size()).toBe(0) expect(@FolderModel.getByName('john')).toBe(undefined) + + it 'should return the corret folder for id', => + item = {id: 3, name: 'john'} + @FolderModel.add(item) + + expect(@FolderBl.getById(3)).toBe(item) + + + it 'should open a folder', => + @persistence.openFolder = jasmine.createSpy('open') + + @FolderModel.add({id: 3, opened: false, name: 'ho'}) + @FolderBl.open(3) + expect(@FolderModel.getById(3).opened).toBeTruthy() + expect(@persistence.openFolder).toHaveBeenCalledWith(3) + |