Permalink
Browse files

Remove auxiliary *.js files from git

  • Loading branch information...
alekseykulikov committed May 6, 2012
1 parent bd892e1 commit dc0d71a8957a4a2daa6a99cd868eea85bca34cb3
View
@@ -1 +1,2 @@
-.DS_Store
+.DS_Store
+temp/*
View
@@ -11,6 +11,6 @@ runner = (params) ->
task 'build', 'Build lib/ from src/', ->
runner ['-c', '-o', 'js', 'src']
-task 'watch', 'Watch src/ for changes', ->
- runner ['-w', '-c', '-o', 'js', 'src']
- runner ['-w', '-c', '-o', 'spec/javascripts', 'spec']
+task 'watch', 'Watch src/ and spec/ for changes', ->
+ runner ['-w', '-c', '-o', 'temp/src', 'src']
+ runner ['-w', '-c', '-o', 'temp/spec', 'spec']
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,98 +0,0 @@
-(function() {
-
- describe('Offline.Collection', function() {
- beforeEach(function() {
- localStorage.setItem('dreams', '');
- this.dreams = new Dreams();
- return this.collection = new Offline.Collection(this.dreams);
- });
- afterEach(function() {
- return localStorage.clear();
- });
- describe('dirty', function() {
- return it('should return items where "dirty" attribute is equal true', function() {
- this.dreams.add([
- {
- id: 1,
- dirty: false
- }, {
- id: 2,
- dirty: true
- }, {
- id: 3,
- dirty: false
- }
- ]);
- return expect(this.collection.dirty().length).toEqual(1);
- });
- });
- describe('get', function() {
- return it('should find item by "sid" attribute in collection', function() {
- this.dreams.add([
- {
- name: 'first',
- sid: '1'
- }, {
- name: 'second',
- sid: '2'
- }
- ]);
- return expect(this.collection.get('2').get('name')).toEqual('second');
- });
- });
- describe('destroyDiff', function() {
- beforeEach(function() {
- this.dreams.create({
- name: 'item 1',
- sid: '1'
- });
- this.dreams.create({
- name: 'item 2',
- sid: '2'
- });
- return this.dreams.create({
- name: 'item 3',
- sid: '3'
- });
- });
- it('should destroy items by "sid" which difference from response', function() {
- var response;
- response = [
- {
- name: 'item 1',
- id: '2'
- }
- ];
- this.collection.destroyDiff(response);
- return expect(this.collection.items.pluck('sid')).toEqual(['2']);
- });
- return it('should ignore items which have "sid" attribute equal "new"', function() {
- var response;
- response = [
- {
- name: 'item 1',
- id: '1'
- }
- ];
- this.dreams.create({
- name: 'item 4',
- sid: 'new'
- });
- this.collection.destroyDiff(response);
- return expect(this.collection.items.pluck('sid')).toEqual(['1', 'new']);
- });
- });
- return describe('fakeModel', function() {
- beforeEach(function() {
- return this.fakeModel = this.collection.fakeModel('4');
- });
- it('sets id', function() {
- return expect(this.fakeModel.id).toEqual('4');
- });
- return it('sets urlRoot', function() {
- return expect(this.fakeModel.urlRoot).toEqual('/api/dreams');
- });
- });
- });
-
-}).call(this);
@@ -1,46 +0,0 @@
-(function() {
-
- describe('Offline.Index', function() {
- beforeEach(function() {
- localStorage.setItem('dreams', '2,3');
- this.dreams = new Dreams();
- this.storage = this.dreams.storage;
- return this.records = new Offline.Index('dreams', this.storage);
- });
- describe('constructor', function() {
- it('sets @name', function() {
- return expect(this.records.name).toEqual('dreams');
- });
- return it('sets @values', function() {
- return expect(this.records.values).toEqual(['2', '3']);
- });
- });
- describe('add', function() {
- beforeEach(function() {
- return this.records.add('5');
- });
- it('should add value in to the end of array', function() {
- return expect(this.records.values).toEqual(['2', '3', '5']);
- });
- it("should rewrite localStorage's item", function() {
- return expect(localStorage.getItem('dreams')).toEqual('2,3,5');
- });
- return it('does not duplicate values', function() {
- this.records.add('5');
- return expect(this.records.values).toEqual(['2', '3', '5']);
- });
- });
- return describe('remove', function() {
- beforeEach(function() {
- return this.records.remove('2');
- });
- it('should remove value from array', function() {
- return expect(this.records.values).toEqual(['3']);
- });
- return it("should rewrite localStorage's item", function() {
- return expect(localStorage.getItem('dreams')).toEqual('3');
- });
- });
- });
-
-}).call(this);
@@ -1,108 +0,0 @@
-(function() {
-
- describe('Offline', function() {
- beforeEach(function() {
- localStorage.setItem('dreams', '');
- return this.dreams = new Dreams();
- });
- afterEach(function() {
- return window.localStorage.clear();
- });
- describe('onLine', function() {
- it('should returns true when onLine is undefined', function() {
- window.navigator = {};
- return expect(Offline.onLine()).toBeTruthy();
- });
- it('should returns true when onLine is true', function() {
- window.navigator = {
- onLine: true
- };
- return expect(Offline.onLine()).toBeTruthy();
- });
- return it('should returns false when onLine is false', function() {
- window.navigator = {
- onLine: false
- };
- return expect(Offline.onLine()).toBeFalsy();
- });
- });
- describe('localSync', function() {
- beforeEach(function() {
- this.storage = this.dreams.storage;
- this.dream = this.dreams.create();
- return registerFakeAjax({
- url: '/api/dreams',
- successData: {}
- });
- });
- it('should call "findAll" when reading collection', function() {
- spyOn(this.storage, 'findAll');
- this.dreams.fetch();
- return expect(this.storage.findAll).toHaveBeenCalledWith(jasmine.any(Object));
- });
- it('should call "find" when reading model', function() {
- spyOn(this.storage, 'find');
- this.dream.fetch();
- return expect(this.storage.find).toHaveBeenCalledWith(this.dream, jasmine.any(Object));
- });
- it('should call "create" when creating model', function() {
- spyOn(this.storage, 'create');
- this.dreams.create({
- name: 'New dream'
- });
- return expect(this.storage.create).toHaveBeenCalled();
- });
- it('should call "update" when update model', function() {
- spyOn(this.storage, 'update');
- this.dream.save({
- name: 'New dream'
- });
- return expect(this.storage.update).toHaveBeenCalledWith(this.dream, jasmine.any(Object));
- });
- it('should call "destroy" when delete model', function() {
- spyOn(this.storage, 'destroy');
- this.dream.destroy();
- return expect(this.storage.destroy).toHaveBeenCalledWith(this.dream, jasmine.any(Object));
- });
- it("should calls \"options.success\" when storage's method responses something", function() {
- var successCallback;
- successCallback = jasmine.createSpy('-Success Callback-');
- this.dream.save({
- name: 'New dream'
- }, {
- success: function(resp) {
- return successCallback(resp);
- }
- });
- return expect(successCallback).toHaveBeenCalledWith(this.dream);
- });
- return it('should call "options.error" when response is blank', function() {
- var errorCallback;
- errorCallback = jasmine.createSpy('-Error Callback-');
- spyOn(this.storage, 'update').andReturn(null);
- this.dream.save({
- name: ''
- }, {
- error: function(message) {
- return errorCallback(message);
- }
- });
- return expect(errorCallback).toHaveBeenCalled();
- });
- });
- return describe('sync', function() {
- it('should delegate actions to Offline.localSync when @storage exists', function() {
- spyOn(Offline, 'localSync');
- this.dreams.fetch();
- return expect(Offline.localSync).toHaveBeenCalled();
- });
- return it('should delegate actions to Backbone.ajaxSync when @storage empty', function() {
- this.dreams.storage = null;
- spyOn(Backbone, 'ajaxSync');
- this.dreams.fetch();
- return expect(Backbone.ajaxSync).toHaveBeenCalled();
- });
- });
- });
-
-}).call(this);
Oops, something went wrong.

0 comments on commit dc0d71a

Please sign in to comment.