Author: erinnp
Date: Thu Jun 27 21:32:40 2013
New Revision: 1497570

URL: http://svn.apache.org/r1497570
Log:
adding api and state manager test specs

Removed:
    
rave/branches/require/rave-portal-resources/src/test/javascript/rave_api_spec.js
Modified:
    rave/branches/require/rave-portal-resources/pom.xml
    
rave/branches/require/rave-portal-resources/src/test/javascript/core/rave_api.spec
    
rave/branches/require/rave-portal-resources/src/test/javascript/core/rave_state_manager.spec
    rave/branches/require/rave-portal-resources/src/test/requireConfig.js
    
rave/branches/require/rave-portal-resources/src/test/testTemplate.htmltemplate

Modified: rave/branches/require/rave-portal-resources/pom.xml
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/pom.xml?rev=1497570&r1=1497569&r2=1497570&view=diff
==============================================================================
--- rave/branches/require/rave-portal-resources/pom.xml (original)
+++ rave/branches/require/rave-portal-resources/pom.xml Thu Jun 27 21:32:40 2013
@@ -121,6 +121,7 @@
                     <specDirectoryName>/src/test/javascript</specDirectoryName>
                     <sourceIncludes>
                         <include>core/rave_api.js</include>
+                        <include>core/rave_state_manager.js</include>
                         <include>core/rave_ajax.js</include>
                     </sourceIncludes>
                     <preloadSources>

Modified: 
rave/branches/require/rave-portal-resources/src/test/javascript/core/rave_api.spec
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/test/javascript/core/rave_api.spec?rev=1497570&r1=1497569&r2=1497570&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/test/javascript/core/rave_api.spec
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/test/javascript/core/rave_api.spec
 Thu Jun 27 21:32:40 2013
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * 'License'); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 var mock = {
     ajax: function(args){
         args.success({})
@@ -63,5 +82,539 @@ describe('rave_api', function(){
                 );
             });
         });
-    })
+
+        describe('saveWidgetPreference', function () {
+            it('makes the correct api call', function () {
+
+                api.rest.saveWidgetPreference({regionWidgetId: 1, userPref: 
{"prefName": "color", prefValue:"blue"},
+                    successCallback: testScope.callback});
+
+                expectAjax(
+                    'PUT',
+                    'api/rest/regionWidgets/1/preferences/color',
+                    JSON.stringify(
+                        {name: 'color', value: 'blue'}
+                    )
+                );
+            });
+        });
+
+        describe('saveWidgetCollapsedState', function () {
+            it('makes the correct api call', function () {
+
+                api.rest.saveWidgetCollapsedState({regionWidgetId: 1, 
collapsed: true,
+                    successCallback: testScope.callback});
+
+                expectAjax(
+                    'PUT',
+                    'api/rest/regionWidgets/1/collapsed',
+                    JSON.stringify(true)
+                );
+            });
+        });
+
+        describe('deletePage', function () {
+            it('makes the correct api call', function () {
+
+                api.rest.deletePage({pageId: 1,
+                    successCallback: testScope.callback});
+
+                expectAjax(
+                    'DELETE',
+                    'api/rest/page/1');
+            });
+        });
+
+        describe('deleteWidgetRating', function () {
+            it('makes the correct api call', function () {
+
+                api.rest.deleteWidgetRating({widgetId: 1, collapsed: true,
+                    successCallback: testScope.callback});
+
+                expectAjax(
+                    'DELETE',
+                    'api/rest/widgets/1/rating');
+            });
+        });
+
+
+        describe('updateWidgetRating', function () {
+            it('makes the correct api call', function () {
+
+                api.rest.updateWidgetRating({widgetId: 1, score: 2,
+                    successCallback: testScope.callback});
+
+                expectAjax(
+                    'POST',
+                    'api/rest/widgets/1/rating?score=2');
+            });
+        });
+
+        describe('createWidgetComment', function () {
+            it('makes the correct api call', function () {
+
+                var text = 'my comment'
+
+                api.rest.createWidgetComment({widgetId: 1, text: text,
+                    successCallback: testScope.callback});
+
+                expectAjax(
+                    'POST',
+                    'api/rest/widgets/1/comments?text=' + escape(text));
+            });
+        });
+
+        describe('deleteWidgetComment', function () {
+            it('makes the correct api call', function () {
+
+                api.rest.deleteWidgetComment({widgetId: 1, commentId: 2,
+                    successCallback: testScope.callback});
+
+                expectAjax(
+                    'DELETE',
+                    'api/rest/widgets/1/comments/2');
+            });
+        });
+
+        describe('updateWidgetComment', function () {
+            it('makes the correct api call', function () {
+
+                var text = 'my comment'
+
+                api.rest.updateWidgetComment({widgetId: 1, commentId: 2, text: 
text,
+                    successCallback: testScope.callback});
+
+                expectAjax(
+                    'POST',
+                    'api/rest/widgets/1/comments/2?text=' + escape(text));
+            });
+        });
+
+        describe('getUsersForWidget', function () {
+            it('makes the correct api call', function () {
+
+                api.rest.getUsersForWidget({widgetId: 1,
+                    successCallback: testScope.callback});
+
+                expectAjax(
+                    'GET',
+                    'api/rest/widgets/1/users');
+            });
+        });
+
+
+        describe('createWidgetTag', function () {
+            it('makes the correct api call', function () {
+
+                var text = 'my tag'
+
+                api.rest.createWidgetTag({widgetId: 1, text: text,
+                    successCallback: testScope.callback});
+
+                expectAjax(
+                    'POST',
+                    'api/rest/widgets/1/tags?tagText=' + escape(text));
+            });
+        });
+
+        describe('getTags', function () {
+            it('makes the correct api call', function () {
+
+                api.rest.getTags({widgetId: 1,
+                    successCallback: testScope.callback});
+
+                expectAjax(
+                    'GET',
+                    'api/rest/widgets/1/tags');
+            });
+        });
+        describe('getSecurityToken', function () {
+            it('makes the correct api call', function () {
+
+                api.rest.getSecurityToken({url: 'http://test.com', pageid: 1,
+                    successCallback: testScope.callback});
+
+                expectAjax(
+                    'GET',
+                    'api/rest/opensocial/gadget?url=http://test.com&pageid=1');
+            });
+        });
+
+    });
+
+    describe('rpc', function () {
+        describe('moveWidgetToRegion', function () {
+            it('makes the correct api call', function () {
+                api.rpc.moveWidgetToRegion({regionWidgetId: 1, toIndex: 2, 
toRegionId: 3, fromRegionId: 4,
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'POST',
+                    'api/rpc/page/regionWidget/1/move',
+                    {
+                        newPosition: 2,
+                        toRegion: 3,
+                        fromRegion: 4
+                    }
+                );
+            });
+        });
+
+        describe('addWidgetToPage', function () {
+            it('makes the correct api call', function () {
+                api.rpc.addWidgetToPage({pageId: 1, widgetId: 2,
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'POST',
+                    'api/rpc/page/1/widget/add',
+                    {
+                        widgetId: 2
+                    }
+                );
+            });
+        });
+
+        describe('deleteWidgetOnPage', function () {
+            it('makes the correct api call', function () {
+                api.rpc.removeWidget({regionWidgetId: 1,
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'POST',
+                    'api/rpc/page/regionWidget/1/delete'
+                );
+            });
+        });
+
+        describe('addPage', function () {
+            it('makes the correct api call', function () {
+                var pageName = "tom's page"
+
+                api.rpc.addPage({pageName: pageName, pageLayoutCode: 1,
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'POST',
+                    'api/rpc/page/add',
+                    {pageName: pageName,
+                        pageLayoutCode: 1}
+                );
+            });
+        });
+
+        describe('getPage', function () {
+            it('makes the correct api call', function () {
+                api.rpc.getPage({
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'GET',
+                    'api/rpc/page/get'
+                );
+            });
+        });
+
+        describe('movePage', function () {
+            it('makes the correct api call', function () {
+                api.rpc.movePage({moveAfterPageId: 1, pageId: 2,
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'POST',
+                    'api/rpc/page/2/move',
+                    {
+                        moveAfterPageId: 1
+                    }
+                );
+            });
+        });
+
+        describe('moveWidgetToPage', function () {
+            it('makes the correct api call', function () {
+                api.rpc.moveWidgetToPage({toPageId: 1, regionWidgetId: 2,
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'POST',
+                    'api/rpc/page/1/moveWidget',
+                    {
+                        toPageId: 1,
+                        regionWidgetId: 2
+                    }
+                );
+            });
+        });
+
+        describe('updatePagePrefs', function () {
+            it('makes the correct api call', function () {
+                api.rpc.updatePagePrefs({pageId: 1, title: 'test title', 
layout: 2,
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'POST',
+                    'api/rpc/page/1/update',
+                    {
+                        name: 'test title',
+                        layout: 2
+                    }
+                );
+            });
+        });
+
+        describe('getPagePrefs', function () {
+            it('makes the correct api call', function () {
+                api.rpc.getPagePrefs({pageId: 1,
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'GET',
+                    'api/rpc/page/get?pageId=1'
+                );
+            });
+        });
+
+        describe('getWidgetMetadata', function () {
+            it('makes the correct api call', function () {
+                var url = 'http://www.example.com/path?with=args#hash'
+
+                api.rpc.getWidgetMetadata({url: url, providerType: 
'opensocial',
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'POST',
+                    'api/rpc/widget/metadata/get',
+                    {
+                        url: url,
+                        type: 'opensocial'
+                    }
+                );
+            });
+        });
+
+        describe('getWidgetMetadataGroup', function () {
+            it('makes the correct api call', function () {
+                var url = 'http://www.example.com/path?with=args#hash'
+
+                api.rpc.getWidgetMetadataGroup({url: url, providerType: 
'opensocial',
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'POST',
+                    'api/rpc/widget/metadatagroup/get',
+                    {
+                        url: url,
+                        type: 'opensocial'
+                    }
+                );
+            });
+        });
+
+        describe('getAllWidgets', function () {
+            it('makes the correct api call', function () {
+                api.rpc.getAllWidgets({
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'GET',
+                    'api/rpc/widget/getall'
+                );
+            });
+        });
+
+        describe('getUsers', function () {
+            it('makes the correct api call', function () {
+                api.rpc.getUsers({offset: 1,
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'GET',
+                    'api/rpc/person/get',
+                    {offset: 1}
+                );
+            });
+        });
+
+        describe('searchUsers', function () {
+            it('makes the correct api call', function () {
+                api.rpc.searchUsers({ searchTerm: 'term', offset: 1,
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'GET',
+                    'api/rpc/person/search',
+                    {searchTerm: 'term',
+                        offset: 1}
+                );
+            });
+        });
+
+        describe('clonePageForUser', function () {
+            it('makes the correct api call', function () {
+                api.rpc.clonePageForUser({ pageId: 1, userId: 2, pageName: 
'page name',
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'POST',
+                    'api/rpc/page/1/clone',
+                    {
+                        userId: 2,
+                        pageName: 'page name'
+                    }
+                );
+            });
+        });
+
+        describe('addMemberToPage', function () {
+            it('makes the correct api call', function () {
+                api.rpc.addMemberToPage({ pageId: 1, userId: 2,
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'POST',
+                    'api/rpc/page/1/addmember',
+                    {
+                        userId: 2
+                    }
+                );
+            });
+        });
+
+        describe('removeMemberFromPage', function () {
+            it('makes the correct api call', function () {
+                api.rpc.removeMemberFromPage({ pageId: 1, userId: 2,
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'POST',
+                    'api/rpc/page/1/removemember',
+                    {
+                        userId: 2
+                    }
+                );
+            });
+        });
+
+        describe('updateSharedPageStatus', function () {
+            it('makes the correct api call', function () {
+                api.rpc.updateSharedPageStatus({ pageId: 1, shareStatus: 2,
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'POST',
+                    'api/rpc/page/1/sharestatus',
+                    {
+                        shareStatus: 2
+                    }
+                );
+            });
+        });
+
+        describe('updatePageEditingStatus', function () {
+            it('makes the correct api call', function () {
+                api.rpc.updatePageEditingStatus({ pageId: 1, userId: 2, 
isEditor: true,
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'POST',
+                    'api/rpc/page/1/editstatus',
+                    {
+                        userId: 2,
+                        isEditor: true
+                    }
+                );
+            });
+        });
+
+        describe('addFriend', function () {
+            it('makes the correct api call', function () {
+                api.rpc.addFriend({ friendUsername: 'ted',
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'POST',
+                    'api/rpc/person/ted/addfriend'
+                );
+            });
+        });
+
+        describe('removeFriend', function () {
+            it('makes the correct api call', function () {
+                api.rpc.removeFriend({ friendUsername: 'ted',
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'POST',
+                    'api/rpc/person/ted/removefriend'
+                );
+            });
+        });
+
+        describe('getFriends', function () {
+            it('makes the correct api call', function () {
+                api.rpc.getFriends({
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'POST',
+                    'api/rpc/person/getFriends'
+                );
+            });
+        });
+
+        describe('acceptFriendRequest', function () {
+            it('makes the correct api call', function () {
+                api.rpc.acceptFriendRequest({ friendUsername: 'ted',
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'POST',
+                    'api/rpc/person/ted/acceptfriendrequest'
+                );
+            });
+        });
+
+        describe('addWidgetFromMarketplace', function () {
+            it('makes the correct api call', function () {
+                var url = 'http://www.example.com/path?with=args#hash'
+
+                api.rpc.addWidgetFromMarketplace({ url: url, providerType: 
'opensocial',
+                    successCallback: testScope.callback
+                });
+
+                expectAjax(
+                    'POST',
+                    'api/rpc/marketplace/add',
+                    {
+                        url: url,
+                        providerType: 'opensocial'
+                    }
+                );
+            });
+        });
+    });
+
 })

Modified: 
rave/branches/require/rave-portal-resources/src/test/javascript/core/rave_state_manager.spec
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/test/javascript/core/rave_state_manager.spec?rev=1497570&r1=1497569&r2=1497570&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/test/javascript/core/rave_state_manager.spec
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/test/javascript/core/rave_state_manager.spec
 Thu Jun 27 21:32:40 2013
@@ -1,11 +1,232 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * 'License'); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+describe('state_manager', function(){
+    beforeEach(function () {
+        stateManager = testr('core/rave_state_manager');
+        //spyOn(mock, 'ajax').andCallThrough();
+        /*api = testr('core/rave_api', {
+            './rave_ajax': mock.ajax,
+            './rave_state_manager': stateManager,
+            './rave_event_manager': eventManager
+        })*/
+        //spyOn(testScope, 'callback');
+    });
+
+    describe('set page', function(){
+        it('sets the page correctly', function(){
+            spyOn(stateManager, 'setPage').andCallThrough();
+
+            stateManager.setPage('testPage');
+
+            expect(stateManager.getPage()).toBe('testPage');
+            expect(stateManager.setPage).toHaveBeenCalled()
+            
expect(stateManager.setPage.mostRecentCall.args[0]).toEqual('testPage')
+        })
+    })
+
+    describe('get page', function(){
+        it('gets the page correctly', function(){
+            spyOn(stateManager, 'getPage').andCallThrough();
+
+            stateManager.setPage('testPage');
+            var output = stateManager.getPage();
+
+            expect(output).toBe('testPage');
+            expect(stateManager.getPage).toHaveBeenCalled()
+            expect(stateManager.getPage.mostRecentCall.args.length).toEqual(0)
+        })
+    })
+
+    describe('set viewer', function(){
+        it('sets the viewer correctly', function(){
+            spyOn(stateManager, 'setViewer').andCallThrough();
+
+            stateManager.setViewer('testViewer');
+
+            expect(stateManager.getViewer()).toBe('testViewer');
+            expect(stateManager.setViewer).toHaveBeenCalled();
+            
expect(stateManager.setViewer.mostRecentCall.args[0]).toEqual('testViewer')
+        })
+    })
+
+    describe('get viewer', function(){
+        it('gets the viewer correctly', function(){
+            spyOn(stateManager, 'getViewer').andCallThrough();
+
+            stateManager.setViewer('testViewer');
+            var output = stateManager.getViewer();
+
+            expect(output).toBe('testViewer');
+            expect(stateManager.getViewer).toHaveBeenCalled()
+            
expect(stateManager.getViewer.mostRecentCall.args.length).toEqual(0)
+        })
+    })
 
-    stateManager = testr('core/rave_state_manager');
+    describe('set owner', function(){
+        it('sets the owner correctly', function(){
+            spyOn(stateManager, 'setOwner').andCallThrough();
+
+            stateManager.setOwner('testOwner');
+
+            expect(stateManager.getOwner()).toBe('testOwner');
+            expect(stateManager.setOwner).toHaveBeenCalled();
+            
expect(stateManager.setOwner.mostRecentCall.args[0]).toEqual('testOwner')
+        })
+    })
+
+    describe('get owner', function(){
+        it('gets the owner correctly', function(){
+            spyOn(stateManager, 'getOwner').andCallThrough();
+
+            stateManager.setOwner('testOwner');
+            var output = stateManager.getOwner();
+
+            expect(output).toBe('testOwner');
+            expect(stateManager.getOwner).toHaveBeenCalled()
+            expect(stateManager.getOwner.mostRecentCall.args.length).toEqual(0)
+        })
+    })
+
+    describe('set context', function(){
+        it('sets the context correctly', function(){
+            spyOn(stateManager, 'setContext').andCallThrough();
+
+            stateManager.setContext('testContext');
+
+            expect(stateManager.getContext()).toBe('testContext');
+            expect(stateManager.setContext).toHaveBeenCalled();
+            
expect(stateManager.setContext.mostRecentCall.args[0]).toEqual('testContext')
+        })
+    })
+
+    describe('get context', function(){
+        it('gets the context correctly', function(){
+            spyOn(stateManager, 'getContext').andCallThrough();
+
+            stateManager.setContext('testContext');
+            var output = stateManager.getContext();
+
+            expect(output).toBe('testContext');
+            expect(stateManager.getContext).toHaveBeenCalled()
+            
expect(stateManager.getContext.mostRecentCall.args.length).toEqual(0)
+        })
+    })
+
+    describe('set export enabled', function(){
+        it('sets the export enabled correctly', function(){
+            spyOn(stateManager, 'setExportEnabled').andCallThrough();
+
+            stateManager.setExportEnabled(true);
+
+            expect(stateManager.getExportEnabled()).toBe(true);
+            expect(stateManager.setExportEnabled).toHaveBeenCalled();
+            
expect(stateManager.setExportEnabled.mostRecentCall.args[0]).toEqual(true)
+        })
+    })
+
+    describe('get export enabled', function(){
+        it('gets the export enabled correctly', function(){
+            spyOn(stateManager, 'getExportEnabled').andCallThrough();
+
+            stateManager.setExportEnabled(true);
+            var output = stateManager.getExportEnabled();
+
+            expect(output).toBe(true);
+            expect(stateManager.getExportEnabled).toHaveBeenCalled()
+            
expect(stateManager.getExportEnabled.mostRecentCall.args.length).toEqual(0)
+        })
+    })
+
+    describe('set default height', function(){
+        it('sets the default height correctly', function(){
+            spyOn(stateManager, 'setDefaultHeight').andCallThrough();
+
+            stateManager.setDefaultHeight(900);
+
+            expect(stateManager.getDefaultHeight()).toBe(900);
+            expect(stateManager.setDefaultHeight).toHaveBeenCalled();
+            
expect(stateManager.setDefaultHeight.mostRecentCall.args[0]).toEqual(900)
+        })
+    })
+
+    describe('get default height', function(){
+        it('gets the default height correctly', function(){
+            spyOn(stateManager, 'getDefaultHeight').andCallThrough();
+
+            var output = stateManager.getDefaultHeight();
+
+            expect(output).toBe(200);
+            expect(stateManager.getDefaultHeight).toHaveBeenCalled()
+            
expect(stateManager.getDefaultHeight.mostRecentCall.args.length).toEqual(0)
+        })
+    })
+
+    describe('set default width', function(){
+        it('sets the default width correctly', function(){
+            spyOn(stateManager, 'setDefaultWidth').andCallThrough();
+
+            stateManager.setDefaultWidth(900);
+
+            expect(stateManager.getDefaultWidth()).toBe(900);
+            expect(stateManager.setDefaultWidth).toHaveBeenCalled();
+            
expect(stateManager.setDefaultWidth.mostRecentCall.args[0]).toEqual(900)
+        })
+    })
+
+    describe('get default width', function(){
+        it('gets the default width correctly', function(){
+            spyOn(stateManager, 'getDefaultWidth').andCallThrough();
+
+            var output = stateManager.getDefaultWidth();
+
+            expect(output).toBe(320);
+            expect(stateManager.getDefaultWidth).toHaveBeenCalled()
+            
expect(stateManager.getDefaultWidth.mostRecentCall.args.length).toEqual(0)
+        })
+    })
+
+    describe('set default view', function(){
+        it('sets the default view correctly', function(){
+            spyOn(stateManager, 'setDefaultView').andCallThrough();
+
+            stateManager.setDefaultView('testView');
+
+            expect(stateManager.getDefaultView()).toBe('testView');
+            expect(stateManager.setDefaultView).toHaveBeenCalled();
+            
expect(stateManager.setDefaultView.mostRecentCall.args[0]).toEqual('testView')
+        })
+    })
 
-    describe('state_manager', function(){
-        it('pass!', function(){
-            expect(stateManager).toBeTruthy();
+    describe('get default view', function(){
+        it('gets the default view correctly', function(){
+            spyOn(stateManager, 'getDefaultView').andCallThrough();
+
+            var output = stateManager.getDefaultView();
+
+            expect(output).toBe('default');
+            expect(stateManager.getDefaultView).toHaveBeenCalled()
+            
expect(stateManager.getDefaultView.mostRecentCall.args.length).toEqual(0)
         })
     })
+})
 
 
 

Modified: rave/branches/require/rave-portal-resources/src/test/requireConfig.js
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/test/requireConfig.js?rev=1497570&r1=1497569&r2=1497570&view=diff
==============================================================================
--- rave/branches/require/rave-portal-resources/src/test/requireConfig.js 
(original)
+++ rave/branches/require/rave-portal-resources/src/test/requireConfig.js Thu 
Jun 27 21:32:40 2013
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * 'License'); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 require.config({
     baseUrl:'src/',
     paths:{

Modified: 
rave/branches/require/rave-portal-resources/src/test/testTemplate.htmltemplate
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/test/testTemplate.htmltemplate?rev=1497570&r1=1497569&r2=1497570&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/test/testTemplate.htmltemplate 
(original)
+++ 
rave/branches/require/rave-portal-resources/src/test/testTemplate.htmltemplate 
Thu Jun 27 21:32:40 2013
@@ -1,3 +1,24 @@
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * 'License'); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+ -->
+
 <!DOCTYPE html>
 <html>
 <head>


Reply via email to