ember-data-factory-guy 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 48d0f7da6694aabe215b16806d8924e7309faa32
4
+ data.tar.gz: ebbbd5dd37fd458feb67ab3d15428d729aa201ed
5
+ SHA512:
6
+ metadata.gz: f63cbaedb8e9e6b09f3d4b58ed393be3d3e865a05470cfe4bbf6f5c47780479526178f4d7b32e670886fa482af2e137c880c171d1a066ec1e29e5bd8d23bd758
7
+ data.tar.gz: 09185a49e347fcd4c4e96d19d5f5e0958a2dc55483977157fb7ddc0714f3b4db420a063009e50ba66f9824e901fb43fbc3b7b3cf07087bd83300d3f7ef75cde6
data/.gitignore CHANGED
@@ -4,3 +4,4 @@ factory_guy_presentation/
4
4
  factory_guy_presents/
5
5
  stats/
6
6
  *.gem
7
+ *.ruby*
data/bower.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-data-factory-guy",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "authors": [
5
5
  "Daniel Sudol <dansudol@yahoo.com>",
6
6
  "Opak Alex <opak.alexandr@gmail.com>"
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |s|
3
3
  s.name = "ember-data-factory-guy"
4
- s.version = "0.3.5"
4
+ s.version = "0.3.6"
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = ["Daniel Sudol", "Alex Opak"]
7
7
  s.email = ["dansudol@yahoo.com", "opak.alexandr@gmail.com"]
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-data-factory-guy",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "authors": [
5
5
  "Daniel Sudol <dansudol@yahoo.com>",
6
6
  "Opak Alex <opak.alexandr@gmail.com>"
@@ -44,28 +44,37 @@ module('DS.Store#makeFixture with ActiveModelAdapter', {
44
44
  });
45
45
 
46
46
 
47
- test("creates DS.Model instance", function() {
47
+ test("creates DS.Model instances", function() {
48
48
  var user = store.makeFixture('user');
49
49
  equal(user instanceof DS.Model, true);
50
50
  });
51
51
 
52
52
 
53
- asyncTest("creates record in the store", function() {
53
+ asyncTest("creates records in the store", function() {
54
54
  var user = store.makeFixture('user');
55
55
 
56
56
  store.find('user', user.id).then ( function(store_user) {
57
57
  deepEqual(store_user.toJSON(), user.toJSON());
58
- start();
58
+ start()
59
59
  });
60
60
  });
61
61
 
62
+ test("when hasMany associations assigned, belongTo parent is assigned", function() {
63
+ var project = store.makeFixture('project');
64
+ var user = store.makeFixture('user', {projects: [project]})
62
65
 
63
- test("supports hasMany associations", function() {
64
- var p1 = store.makeFixture('project');
65
- var p2 = store.makeFixture('project');
66
- var user = store.makeFixture('user', {projects: [p1, p2]})
66
+ deepEqual(project.get('user').toJSON(), user.toJSON());
67
+ });
67
68
 
68
- equal(user.get('projects.length'), 2);
69
+
70
+ asyncTest("when asnyc hasMany associations assigned, belongTo parent is assigned", function() {
71
+ var user = store.makeFixture('user');
72
+ var company = store.makeFixture('company', {users: [user]});
73
+
74
+ user.get('company').then(function(c){
75
+ deepEqual(c.toJSON(), company.toJSON())
76
+ start();
77
+ })
69
78
  });
70
79
 
71
80
 
@@ -83,6 +92,17 @@ test("when polymorphic hasMany associations are assigned, belongTo parent is ass
83
92
  });
84
93
 
85
94
 
95
+ test("when belongTo parent is assigned, parent adds to hasMany records", function() {
96
+ var user = store.makeFixture('user');
97
+ var project1 = store.makeFixture('project', {user: user});
98
+ var project2 = store.makeFixture('project', {user: user});
99
+
100
+ equal(user.get('projects.length'), 2);
101
+ deepEqual(user.get('projects.firstObject').toJSON(), project1.toJSON());
102
+ deepEqual(user.get('projects.lastObject').toJSON(), project2.toJSON());
103
+ });
104
+
105
+
86
106
  test("when belongTo parent is assigned, parent adds to polymorphic hasMany records", function() {
87
107
  var user = store.makeFixture('user');
88
108
  store.makeFixture('big_hat', {user: user});
@@ -94,44 +114,14 @@ test("when belongTo parent is assigned, parent adds to polymorphic hasMany recor
94
114
  });
95
115
 
96
116
 
97
- test("when hasMany associations assigned, belongTo parent is assigned", function() {
98
- var project = store.makeFixture('project');
99
- var user = store.makeFixture('user', {projects: [project]})
100
-
101
- deepEqual(project.get('user'), user);
102
- });
103
-
104
-
105
- asyncTest("when asnyc hasMany associations assigned, belongTo parent is assigned", function() {
106
- var user = store.makeFixture('user');
107
- var company = store.makeFixture('company', {users: [user]});
108
-
109
- user.get('company').then(function(c){
110
- equal(c, company);
111
- start();
112
- })
113
- });
114
-
115
-
116
- test("when belongTo parent is assigned, parent adds to hasMany records", function() {
117
- var user = store.makeFixture('user');
118
- var project1 = store.makeFixture('project', {user: user});
119
- var project2 = store.makeFixture('project', {user: user});
120
-
121
- equal(user.get('projects.length'), 2);
122
- equal(user.get('projects.firstObject'), project1);
123
- equal(user.get('projects.lastObject'), project2);
124
- });
125
-
126
-
127
117
  asyncTest("when async belongsTo parent is assigned, parent adds to hasMany records", function() {
128
118
  var company = store.makeFixture('company');
129
119
  var user1 = store.makeFixture('user', {company: company});
130
120
  var user2 = store.makeFixture('user', {company: company});
131
121
 
132
122
  equal(company.get('users.length'), 2);
133
- equal(company.get('users.firstObject'), user1);
134
- equal(company.get('users.lastObject'), user2);
123
+ deepEqual(company.get('users.firstObject').toJSON(), user1.toJSON());
124
+ deepEqual(company.get('users.lastObject').toJSON(), user2.toJSON());
135
125
  start();
136
126
  });
137
127
 
@@ -146,7 +136,7 @@ test("belongsTo associations defined as attributes in fixture", function() {
146
136
 
147
137
  var project = store.makeFixture('project_with_admin');
148
138
  deepEqual(project.get('user').toJSON(),{name: 'Admin', company: null})
149
- })
139
+ });
150
140
 
151
141
 
152
142
  module('DS.Store#makeList with ActiveModelAdapter', {
@@ -49,6 +49,7 @@ test("creates DS.Model instances", function() {
49
49
  equal(user instanceof DS.Model, true);
50
50
  });
51
51
 
52
+
52
53
  asyncTest("creates records in the store", function() {
53
54
  var user = store.makeFixture('user');
54
55
 
@@ -58,12 +59,22 @@ asyncTest("creates records in the store", function() {
58
59
  });
59
60
  });
60
61
 
61
- test("supports hasMany associations", function() {
62
- var p1 = store.makeFixture('project');
63
- var p2 = store.makeFixture('project');
64
- var user = store.makeFixture('user', {projects: [p1, p2]})
62
+ test("when hasMany associations assigned, belongTo parent is assigned", function() {
63
+ var project = store.makeFixture('project');
64
+ var user = store.makeFixture('user', {projects: [project]})
65
65
 
66
- equal(user.get('projects.length'), 2);
66
+ deepEqual(project.get('user').toJSON(), user.toJSON());
67
+ });
68
+
69
+
70
+ asyncTest("when asnyc hasMany associations assigned, belongTo parent is assigned", function() {
71
+ var user = store.makeFixture('user');
72
+ var company = store.makeFixture('company', {users: [user]});
73
+
74
+ user.get('company').then(function(c){
75
+ deepEqual(c.toJSON(), company.toJSON())
76
+ start();
77
+ })
67
78
  });
68
79
 
69
80
 
@@ -81,14 +92,14 @@ test("when polymorphic hasMany associations are assigned, belongTo parent is ass
81
92
  });
82
93
 
83
94
 
84
- test("when belongTo parent is assigned, parent adds to polymorphic hasMany records", function() {
95
+ test("when belongTo parent is assigned, parent adds to hasMany records", function() {
85
96
  var user = store.makeFixture('user');
86
- store.makeFixture('big_hat', {user: user});
87
- store.makeFixture('small_hat', {user: user});
97
+ var project1 = store.makeFixture('project', {user: user});
98
+ var project2 = store.makeFixture('project', {user: user});
88
99
 
89
- equal(user.get('hats.length'), 2);
90
- ok(user.get('hats.firstObject') instanceof BigHat)
91
- ok(user.get('hats.lastObject') instanceof SmallHat)
100
+ equal(user.get('projects.length'), 2);
101
+ deepEqual(user.get('projects.firstObject').toJSON(), project1.toJSON());
102
+ deepEqual(user.get('projects.lastObject').toJSON(), project2.toJSON());
92
103
  });
93
104
 
94
105
 
@@ -103,45 +114,15 @@ test("when belongTo parent is assigned, parent adds to polymorphic hasMany recor
103
114
  });
104
115
 
105
116
 
106
- test("when hasMany associations assigned, belongTo parent is assigned", function() {
107
- var project = store.makeFixture('project');
108
- var user = store.makeFixture('user', {projects: [project]})
109
-
110
- deepEqual(project.get('user'), user);
111
- });
112
-
113
-
114
- asyncTest("when asnyc hasMany associations assigned, belongTo parent is assigned", function() {
115
- var user = store.makeFixture('user');
116
- var company = store.makeFixture('company', {users: [user]});
117
-
118
- user.get('company').then(function(c){
119
- equal(c, company)
120
- start()
121
- })
122
- });
123
-
124
-
125
- test("when belongTo parent is assigned, parent adds to hasMany records", function() {
126
- var user = store.makeFixture('user');
127
- var project1 = store.makeFixture('project', {user: user});
128
- var project2 = store.makeFixture('project', {user: user});
129
-
130
- equal(user.get('projects.length'), 2);
131
- equal(user.get('projects.firstObject'), project1)
132
- equal(user.get('projects.lastObject'), project2)
133
- });
134
-
135
-
136
117
  asyncTest("when async belongsTo parent is assigned, parent adds to hasMany records", function() {
137
118
  var company = store.makeFixture('company');
138
119
  var user1 = store.makeFixture('user', {company: company});
139
120
  var user2 = store.makeFixture('user', {company: company});
140
121
 
141
122
  equal(company.get('users.length'), 2);
142
- equal(company.get('users.firstObject'), user1)
143
- equal(company.get('users.lastObject'), user2)
144
- start()
123
+ deepEqual(company.get('users.firstObject').toJSON(), user1.toJSON());
124
+ deepEqual(company.get('users.lastObject').toJSON(), user2.toJSON());
125
+ start();
145
126
  });
146
127
 
147
128
 
@@ -155,7 +136,8 @@ test("belongsTo associations defined as attributes in fixture", function() {
155
136
 
156
137
  var project = store.makeFixture('project_with_admin');
157
138
  deepEqual(project.get('user').toJSON(),{name: 'Admin', company: null})
158
- })
139
+ });
140
+
159
141
 
160
142
  module('DS.Store#makeList with DS.RESTAdapter', {
161
143
  setup: function() {
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ember-data-factory-guy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
5
- prerelease:
4
+ version: 0.3.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - Daniel Sudol
@@ -10,8 +9,7 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2014-05-29 00:00:00.000000000 -04:00
14
- default_executable:
12
+ date: 2014-05-30 00:00:00.000000000 Z
15
13
  dependencies: []
16
14
  description: Easily create Fixtures for Ember Data
17
15
  email:
@@ -57,30 +55,28 @@ files:
57
55
  - tests/test_setup.js
58
56
  - vendor/assets/javascripts/ember_data_factory_guy.js
59
57
  - vendor/assets/javascripts/factory_guy_has_many.js
60
- has_rdoc: true
61
58
  homepage: https://github.com/danielspaniel/ember-data-factory-guy
62
59
  licenses:
63
60
  - MIT
61
+ metadata: {}
64
62
  post_install_message:
65
63
  rdoc_options: []
66
64
  require_paths:
67
65
  - lib
68
66
  required_ruby_version: !ruby/object:Gem::Requirement
69
- none: false
70
67
  requirements:
71
- - - ! '>='
68
+ - - '>='
72
69
  - !ruby/object:Gem::Version
73
70
  version: '0'
74
71
  required_rubygems_version: !ruby/object:Gem::Requirement
75
- none: false
76
72
  requirements:
77
- - - ! '>='
73
+ - - '>='
78
74
  - !ruby/object:Gem::Version
79
75
  version: 1.3.6
80
76
  requirements: []
81
77
  rubyforge_project: ember-data-factory-guy
82
- rubygems_version: 1.6.2
78
+ rubygems_version: 2.0.3
83
79
  signing_key:
84
- specification_version: 3
80
+ specification_version: 4
85
81
  summary: Easily create Fixtures for Ember Data
86
82
  test_files: []