{:uriI"file:///Users/prehnra/src/revelry_data/spec/dummy/spec/javascripts/relationships_spec.js?type=application/javascript&pipeline=self&id=0ceba84e871c07d5e49f9a16a754049bc10d1f084dc9bbc557c7f901f7ab5795:ET:load_pathI"@/Users/prehnra/src/revelry_data/spec/dummy/spec/javascripts;F: filenameI"V/Users/prehnra/src/revelry_data/spec/dummy/spec/javascripts/relationships_spec.js;T: nameI"relationships_spec;T:logical_pathI"relationships_spec.self.js;T:content_typeI"application/javascript;T: sourceI"App.Models = (App.Models || {}); App.Models.RelationshipTest = BaseModel.extend(); App.Models.RelationshipTest.Collection = BaseCollection.extend(); describe('Rev.Store', function() { var store; var projectDefaults = { links: { 'relationship-tests': { linkage: {} } } }; beforeEach(function() { store = new Rev.Store(); store.new('project', BaseModel, projectDefaults); }); it('can set a linkage', function() { store.setLink( 'project', 'relationship-tests', [{id: '1', type: 'relationship-tests'}] ); expect( store.linksAndRelationships('project')['relationship-tests'].data ).toEqual([{id: '1', type: 'relationship-tests'}]); }); it('can set a relation', function() { store.setRelation('project', 'relationship-tests', [ {id: '2', type: 'relationship-tests', name: 'foo'}, {id: '4', type: 'relationship-tests', name: 'bar'} ]); expect( store.project.get('links')['relationship-tests'].linkage.length ).toEqual(2); expect( store['relationship-tests'].get('2').attributes ).toEqual( {id: '2', type: 'relationship-tests', name: 'foo'} ); expect( store['relationship-tests'].get('4').attributes ).toEqual( {id: '4', type: 'relationship-tests', name: 'bar'} ); }); it('can get a relation which has been set', function() { var relatedObjects; store.setRelation('project', 'relationship-tests', [ {id: '2', type: 'relationship-tests', name: 'foo'}, {id: '4', type: 'relationship-tests', name: 'bar'} ]); relatedObjects = store.getLink('project', 'relationship-tests'); expect(relatedObjects[0].get('name')).toEqual('foo'); expect(relatedObjects[1].get('name')).toEqual('bar'); }); }); ;T: metadata{ :dependencieso:Set: @hash{ I"environment-version;TTI"environment-paths;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"dfile-digest:///Users/prehnra/src/revelry_data/spec/dummy/spec/javascripts/relationships_spec.js;TT: requiredo;;{: stubbedo;;{: linkso;;{: charsetI" utf-8;F: digest"%lҭo{)BE Ȅݰ: lengthi:integrityI"Xni:///sha-256;bNKt_O-Cb5yc43spxckWi0JF6B-2DaKM6__dyITdsOM?ct=application/javascript;T:dependencies_digest"%d\oz.5wl ":idI"E0ceba84e871c07d5e49f9a16a754049bc10d1f084dc9bbc557c7f901f7ab5795;F: mtimel+BU