push_type_core 0.8.0.beta.1 → 0.8.0.beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/app/fields/push_type/relation_field.rb +6 -1
  3. data/app/models/concerns/push_type/customizable.rb +10 -0
  4. data/lib/push_type/core/engine.rb +0 -3
  5. data/lib/push_type/primitives/object_type.rb +1 -7
  6. data/lib/push_type/version.rb +1 -1
  7. data/test/dummy/config/initializers/push_type.rb +1 -1
  8. data/test/dummy/config/secrets.yml +2 -2
  9. data/test/dummy/db/schema.rb +1 -1
  10. data/test/dummy/log/test.log +8609 -8227
  11. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/0ANSDcZJu9gPyqtYPIW729qm1kriQ29Vn9LU8T2SGQU.cache +0 -0
  12. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_d65qW7wxRtKVSYpmfSenECz5QUWVI9pppUgV7TA1Rk.cache +0 -0
  13. data/test/fields/push_type/relation_field_test.rb +10 -0
  14. data/test/lib/push_type/primitives_test.rb +1 -0
  15. data/test/models/concerns/push_type/customizable_test.rb +4 -0
  16. data/test/models/push_type/node_test.rb +7 -0
  17. metadata +18 -18
  18. /data/test/dummy/db/migrate/{20160206155134_create_push_type_users.push_type.rb → 20160215150602_create_push_type_users.push_type.rb} +0 -0
  19. /data/test/dummy/db/migrate/{20160206155135_create_push_type_nodes.push_type.rb → 20160215150603_create_push_type_nodes.push_type.rb} +0 -0
  20. /data/test/dummy/db/migrate/{20160206155136_create_push_type_node_hierarchies.push_type.rb → 20160215150604_create_push_type_node_hierarchies.push_type.rb} +0 -0
  21. /data/test/dummy/db/migrate/{20160206155137_create_push_type_assets.push_type.rb → 20160215150605_create_push_type_assets.push_type.rb} +0 -0
  22. /data/test/dummy/db/migrate/{20160206155138_add_field_store_default_values.push_type.rb → 20160215150606_add_field_store_default_values.push_type.rb} +0 -0
  23. /data/test/dummy/db/migrate/{20160206155139_drop_legacy_push_type_taxonomies.push_type.rb → 20160215150607_drop_legacy_push_type_taxonomies.push_type.rb} +0 -0
  24. /data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/{BXXMCMRu7JahLHdf-HLwTSs6u6Pfn4DhDNK5wg5hgy0.cache → BbdqmNmo_cMpT3dnntuUSQnMCU3FOU0qEbTy3ESfBHE.cache} +0 -0
  25. /data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/{TUwu9oRcnc80mNVFDhhX5AqieKa5hmp5Ro9HIoQjdA4.cache → HbQzCpEE_QUF4m04TN_zIYyaX1ZCcx171j2td0cH-Vk.cache} +0 -0
@@ -56,5 +56,15 @@ module PushType
56
56
  it { node.bar_ids.must_equal @bars.map(&:id) }
57
57
  it { node.bars.sort.must_equal @bars.sort }
58
58
 
59
+ describe 'with missing relations' do
60
+ before do
61
+ @pages.first.destroy
62
+ @bars.first.destroy
63
+ end
64
+
65
+ it { proc { node.page }.must_raise ActiveRecord::RecordNotFound }
66
+ it { node.bars.size.must_equal 1 }
67
+ end
68
+
59
69
  end
60
70
  end
@@ -43,6 +43,7 @@ module PushType
43
43
  let(:val) { { foo: 'bar', baz: ['a', 'b'] } }
44
44
 
45
45
  it { primitive.to_json(val).must_equal({ 'foo' => 'bar', 'baz' => ['a', 'b'] }) }
46
+ it { primitive.to_json({}).must_equal({}) }
46
47
  end
47
48
 
48
49
  describe 'StringType' do
@@ -25,5 +25,9 @@ module PushType
25
25
  it { TestPage.validators_on(:qux).map(&:class).must_include ActiveRecord::Validations::PresenceValidator }
26
26
  end
27
27
 
28
+ describe '#attribute_for_inspect' do
29
+ it { page.attribute_for_inspect(:field_store).must_equal "[:foo, :bar, :baz, :qux]" }
30
+ end
31
+
28
32
  end
29
33
  end
@@ -2,6 +2,13 @@ require 'test_helper'
2
2
 
3
3
  module PushType
4
4
  class NodeTest < ActiveSupport::TestCase
5
+
6
+ class TestPage < PushType::Node
7
+ field :foo
8
+ field :bar
9
+ field :baz
10
+ end
11
+
5
12
  let(:node) { Node.new }
6
13
 
7
14
  it { node.wont_be :valid? }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: push_type_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0.beta.1
4
+ version: 0.8.0.beta.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Russell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-06 00:00:00.000000000 Z
11
+ date: 2016-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -256,12 +256,12 @@ files:
256
256
  - test/dummy/config/locales/en.yml
257
257
  - test/dummy/config/routes.rb
258
258
  - test/dummy/config/secrets.yml
259
- - test/dummy/db/migrate/20160206155134_create_push_type_users.push_type.rb
260
- - test/dummy/db/migrate/20160206155135_create_push_type_nodes.push_type.rb
261
- - test/dummy/db/migrate/20160206155136_create_push_type_node_hierarchies.push_type.rb
262
- - test/dummy/db/migrate/20160206155137_create_push_type_assets.push_type.rb
263
- - test/dummy/db/migrate/20160206155138_add_field_store_default_values.push_type.rb
264
- - test/dummy/db/migrate/20160206155139_drop_legacy_push_type_taxonomies.push_type.rb
259
+ - test/dummy/db/migrate/20160215150602_create_push_type_users.push_type.rb
260
+ - test/dummy/db/migrate/20160215150603_create_push_type_nodes.push_type.rb
261
+ - test/dummy/db/migrate/20160215150604_create_push_type_node_hierarchies.push_type.rb
262
+ - test/dummy/db/migrate/20160215150605_create_push_type_assets.push_type.rb
263
+ - test/dummy/db/migrate/20160215150606_add_field_store_default_values.push_type.rb
264
+ - test/dummy/db/migrate/20160215150607_drop_legacy_push_type_taxonomies.push_type.rb
265
265
  - test/dummy/db/schema.rb
266
266
  - test/dummy/db/seeds.rb
267
267
  - test/dummy/log/test.log
@@ -273,10 +273,10 @@ files:
273
273
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/0ANSDcZJu9gPyqtYPIW729qm1kriQ29Vn9LU8T2SGQU.cache
274
274
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/3T6ioyhwSsEzte_a9viHBvfmuKgORQ019srIEoUYkVs.cache
275
275
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache
276
- - test/dummy/tmp/cache/assets/test/sprockets/v3.0/BXXMCMRu7JahLHdf-HLwTSs6u6Pfn4DhDNK5wg5hgy0.cache
276
+ - test/dummy/tmp/cache/assets/test/sprockets/v3.0/BbdqmNmo_cMpT3dnntuUSQnMCU3FOU0qEbTy3ESfBHE.cache
277
+ - test/dummy/tmp/cache/assets/test/sprockets/v3.0/HbQzCpEE_QUF4m04TN_zIYyaX1ZCcx171j2td0cH-Vk.cache
277
278
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/IYzwMwq7DWWSuojH6oXsrP__pcD7O8TQieMFSzQiwnc.cache
278
279
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache
279
- - test/dummy/tmp/cache/assets/test/sprockets/v3.0/TUwu9oRcnc80mNVFDhhX5AqieKa5hmp5Ro9HIoQjdA4.cache
280
280
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/_d65qW7wxRtKVSYpmfSenECz5QUWVI9pppUgV7TA1Rk.cache
281
281
  - test/dummy/tmp/generators/app/presenters/page_presenter.rb
282
282
  - test/fields/push_type/asset_field_test.rb
@@ -382,12 +382,12 @@ test_files:
382
382
  - test/dummy/config/routes.rb
383
383
  - test/dummy/config/secrets.yml
384
384
  - test/dummy/config.ru
385
- - test/dummy/db/migrate/20160206155134_create_push_type_users.push_type.rb
386
- - test/dummy/db/migrate/20160206155135_create_push_type_nodes.push_type.rb
387
- - test/dummy/db/migrate/20160206155136_create_push_type_node_hierarchies.push_type.rb
388
- - test/dummy/db/migrate/20160206155137_create_push_type_assets.push_type.rb
389
- - test/dummy/db/migrate/20160206155138_add_field_store_default_values.push_type.rb
390
- - test/dummy/db/migrate/20160206155139_drop_legacy_push_type_taxonomies.push_type.rb
385
+ - test/dummy/db/migrate/20160215150602_create_push_type_users.push_type.rb
386
+ - test/dummy/db/migrate/20160215150603_create_push_type_nodes.push_type.rb
387
+ - test/dummy/db/migrate/20160215150604_create_push_type_node_hierarchies.push_type.rb
388
+ - test/dummy/db/migrate/20160215150605_create_push_type_assets.push_type.rb
389
+ - test/dummy/db/migrate/20160215150606_add_field_store_default_values.push_type.rb
390
+ - test/dummy/db/migrate/20160215150607_drop_legacy_push_type_taxonomies.push_type.rb
391
391
  - test/dummy/db/schema.rb
392
392
  - test/dummy/db/seeds.rb
393
393
  - test/dummy/log/test.log
@@ -402,10 +402,10 @@ test_files:
402
402
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/3T6ioyhwSsEzte_a9viHBvfmuKgORQ019srIEoUYkVs.cache
403
403
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache
404
404
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/_d65qW7wxRtKVSYpmfSenECz5QUWVI9pppUgV7TA1Rk.cache
405
- - test/dummy/tmp/cache/assets/test/sprockets/v3.0/BXXMCMRu7JahLHdf-HLwTSs6u6Pfn4DhDNK5wg5hgy0.cache
405
+ - test/dummy/tmp/cache/assets/test/sprockets/v3.0/BbdqmNmo_cMpT3dnntuUSQnMCU3FOU0qEbTy3ESfBHE.cache
406
+ - test/dummy/tmp/cache/assets/test/sprockets/v3.0/HbQzCpEE_QUF4m04TN_zIYyaX1ZCcx171j2td0cH-Vk.cache
406
407
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/IYzwMwq7DWWSuojH6oXsrP__pcD7O8TQieMFSzQiwnc.cache
407
408
  - test/dummy/tmp/cache/assets/test/sprockets/v3.0/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache
408
- - test/dummy/tmp/cache/assets/test/sprockets/v3.0/TUwu9oRcnc80mNVFDhhX5AqieKa5hmp5Ro9HIoQjdA4.cache
409
409
  - test/dummy/tmp/generators/app/presenters/page_presenter.rb
410
410
  - test/fields/push_type/asset_field_test.rb
411
411
  - test/fields/push_type/boolean_field_test.rb