push_type_core 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/push_type/install/templates/push_type.rb +20 -3
- data/lib/generators/push_type/node/templates/node.rb +9 -6
- data/lib/generators/push_type/taxonomy/templates/taxonomy.rb +2 -1
- data/lib/push_type/core.rb +2 -0
- data/lib/push_type/core/engine.rb +4 -4
- data/lib/push_type/testing/setup.rb +3 -4
- data/lib/push_type/testing/support/expectations.rb +5 -0
- data/lib/push_type/version.rb +1 -1
- data/test/controllers/nodes_front_end_controller_test.rb +2 -2
- data/test/controllers/taxonomies_front_end_controller_test.rb +2 -2
- data/test/dummy/app/models/category.rb +2 -1
- data/test/dummy/app/models/page.rb +5 -4
- data/test/dummy/config/initializers/push_type.rb +21 -4
- data/test/dummy/config/secrets.yml +2 -2
- data/test/dummy/db/migrate/{20150816155440_create_push_type_users.push_type.rb → 20150824095144_create_push_type_users.push_type.rb} +0 -0
- data/test/dummy/db/migrate/{20150816155441_create_push_type_nodes.push_type.rb → 20150824095145_create_push_type_nodes.push_type.rb} +0 -0
- data/test/dummy/db/migrate/{20150816155442_create_push_type_node_hierarchies.push_type.rb → 20150824095146_create_push_type_node_hierarchies.push_type.rb} +0 -0
- data/test/dummy/db/migrate/{20150816155443_create_push_type_assets.push_type.rb → 20150824095147_create_push_type_assets.push_type.rb} +0 -0
- data/test/dummy/db/migrate/{20150816155444_create_push_type_taxonomies.push_type.rb → 20150824095148_create_push_type_taxonomies.push_type.rb} +0 -0
- data/test/dummy/db/migrate/{20150816155445_create_push_type_taxonomy_hierarchies.push_type.rb → 20150824095149_create_push_type_taxonomy_hierarchies.push_type.rb} +0 -0
- data/test/dummy/db/migrate/{20150816155446_add_field_store_default_values.push_type.rb → 20150824095150_add_field_store_default_values.push_type.rb} +0 -0
- data/test/dummy/db/schema.rb +1 -1
- data/test/dummy/log/test.log +6929 -7664
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/{XZ5YMTEXVVS0qOmL43QbUr0VO27mRh-7fqzgzfV5Ulc.cache → 8S3sfGL04Qzd-CkJWBN2O8-yN9aBez7PaqeA4JuW9o4.cache} +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/{W8pDH0KBIZeASFfhb6FcCvgBnw5mwDr_n-_mL7uyJCg.cache → fpxsy_yXkhFWrdcFn1-yw_WQGpaE1o6EwLLBz1huQYQ.cache} +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/g97nJc5YmnbscVR5pZZoxgfj652ml7dLjUIu0FHDwLA.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/vlJujjzOikOTUvCvT3C4o3vK0ySfxbQQ3RBE37vXH0U.cache +0 -0
- data/test/dummy/tmp/generators/app/models/home_page.rb +5 -5
- data/test/fields/push_type/asset_field_test.rb +3 -3
- data/test/fields/push_type/date_field_test.rb +3 -3
- data/test/fields/push_type/markdown_field_test.rb +3 -3
- data/test/fields/push_type/matrix_field_test.rb +3 -3
- data/test/fields/push_type/node_field_test.rb +3 -3
- data/test/fields/push_type/number_field_test.rb +3 -3
- data/test/fields/push_type/repeater_field_test.rb +2 -3
- data/test/fields/push_type/select_field_test.rb +2 -3
- data/test/fields/push_type/tag_list_field_test.rb +3 -3
- data/test/fields/push_type/taxonomy_field_test.rb +3 -3
- data/test/fields/push_type/text_field_test.rb +3 -3
- data/test/fields/push_type/time_field_test.rb +3 -3
- data/test/lib/generators/push_type/field_generator_test.rb +2 -2
- data/test/lib/generators/push_type/install_generator_test.rb +2 -2
- data/test/lib/generators/push_type/node_generator_test.rb +2 -2
- data/test/lib/generators/push_type/presenter_generator_test.rb +2 -2
- data/test/lib/generators/push_type/taxonomy_generator_test.rb +2 -2
- data/test/lib/push_type/core_test.rb +2 -2
- data/test/lib/push_type/field_type_test.rb +2 -2
- data/test/lib/push_type/menu_builder/menu_dsl_test.rb +2 -2
- data/test/lib/push_type/menu_builder/menu_item_dsl_test.rb +2 -2
- data/test/lib/push_type/menu_builder/menu_item_test.rb +2 -2
- data/test/lib/push_type/menu_builder/menu_renderer_test.rb +1 -1
- data/test/lib/push_type/menu_builder/menu_test.rb +2 -2
- data/test/lib/push_type/menu_builder_test.rb +2 -2
- data/test/lib/push_type/presenter_test.rb +2 -2
- data/test/models/concerns/push_type/customizable_test.rb +2 -2
- data/test/models/concerns/push_type/nestable_test.rb +2 -2
- data/test/models/concerns/push_type/presentable_test.rb +2 -2
- data/test/models/concerns/push_type/publishable_test.rb +6 -6
- data/test/models/concerns/push_type/templatable_test.rb +2 -2
- data/test/models/concerns/push_type/trashable_test.rb +2 -2
- data/test/models/concerns/push_type/unexposable_test.rb +1 -1
- data/test/models/push_type/asset_test.rb +2 -2
- data/test/models/push_type/node_test.rb +2 -2
- data/test/models/push_type/taxonomy_test.rb +2 -2
- data/test/models/push_type/user_test.rb +2 -2
- data/test/test_helper.rb +4 -25
- metadata +33 -33
File without changes
|
File without changes
|
Binary file
|
Binary file
|
@@ -1,12 +1,12 @@
|
|
1
1
|
class HomePage < PushType::Node
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
3
|
+
# By default a node can have children of any other node type.
|
4
|
+
# Optionally pass a list of acceptable node types or prevent
|
5
|
+
# any descendents by passing false.
|
6
|
+
has_child_nodes :all
|
5
7
|
|
6
|
-
#
|
7
|
-
# field :body, :text, validates: { presence: true }
|
8
|
+
# Model the content by adding custom fields to the node.
|
8
9
|
field :foo, :string
|
9
10
|
field :bar, :text
|
10
|
-
|
11
11
|
|
12
12
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'test_helper'
|
2
2
|
|
3
3
|
module PushType
|
4
|
+
class AssetFieldTest < ActiveSupport::TestCase
|
4
5
|
|
5
|
-
describe AssetField do
|
6
6
|
let(:field) { PushType::AssetField.new :foo }
|
7
7
|
|
8
8
|
it { field.json_key.must_equal :foo_id }
|
@@ -32,6 +32,6 @@ module PushType
|
|
32
32
|
it { node.foo.must_equal asset }
|
33
33
|
end
|
34
34
|
end
|
35
|
-
end
|
36
35
|
|
36
|
+
end
|
37
37
|
end
|
@@ -1,14 +1,14 @@
|
|
1
|
-
require
|
1
|
+
require 'test_helper'
|
2
2
|
|
3
3
|
module PushType
|
4
|
+
class DateFieldTest < ActiveSupport::TestCase
|
4
5
|
|
5
|
-
describe DateField do
|
6
6
|
let(:field) { PushType::DateField.new :foo }
|
7
7
|
let(:val) { Date.today.to_s }
|
8
8
|
|
9
9
|
it { field.template.must_equal 'date' }
|
10
10
|
it { field.form_helper.must_equal :date_field }
|
11
11
|
it { field.from_json(val).must_be_instance_of Date }
|
12
|
-
end
|
13
12
|
|
13
|
+
end
|
14
14
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'test_helper'
|
2
2
|
|
3
3
|
module PushType
|
4
|
+
class MarkdownFieldTest < ActiveSupport::TestCase
|
4
5
|
|
5
|
-
describe MarkdownField do
|
6
6
|
let(:field) { PushType::MarkdownField.new :foo }
|
7
7
|
|
8
8
|
it { field.form_helper.must_equal :text_area }
|
@@ -30,6 +30,6 @@ module PushType
|
|
30
30
|
it { node.present!.foo.strip.must_equal '<p><strong>foo</strong> <em>bar</em></p>' }
|
31
31
|
end
|
32
32
|
end
|
33
|
-
end
|
34
33
|
|
34
|
+
end
|
35
35
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'test_helper'
|
2
2
|
|
3
3
|
module PushType
|
4
|
+
class MatrixFieldTest < ActiveSupport::TestCase
|
4
5
|
|
5
|
-
describe MatrixField do
|
6
6
|
let(:field) { PushType::MatrixField.new :foo, opts }
|
7
7
|
let(:val) { [{ key: 1, value: 2 }, { key: 3, value: 4 }] }
|
8
8
|
|
@@ -30,6 +30,6 @@ module PushType
|
|
30
30
|
it { field.from_json(val)[0].that.must_equal 'b' }
|
31
31
|
it { field.from_json(val)[0].other.must_equal '99' }
|
32
32
|
end
|
33
|
-
end
|
34
33
|
|
34
|
+
end
|
35
35
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'test_helper'
|
2
2
|
|
3
3
|
module PushType
|
4
|
+
class NodeFieldTest < ActiveSupport::TestCase
|
4
5
|
|
5
|
-
describe NodeField do
|
6
6
|
let(:field) { PushType::NodeField.new :foo, opts }
|
7
7
|
|
8
8
|
before do
|
@@ -66,6 +66,6 @@ module PushType
|
|
66
66
|
it { node.foo.must_equal rel }
|
67
67
|
end
|
68
68
|
end
|
69
|
-
end
|
70
69
|
|
70
|
+
end
|
71
71
|
end
|
@@ -1,13 +1,13 @@
|
|
1
|
-
require
|
1
|
+
require 'test_helper'
|
2
2
|
|
3
3
|
module PushType
|
4
|
+
class NumberFieldTest < ActiveSupport::TestCase
|
4
5
|
|
5
|
-
describe NumberField do
|
6
6
|
let(:field) { PushType::NumberField.new :foo }
|
7
7
|
|
8
8
|
it { field.form_helper.must_equal :number_field }
|
9
9
|
it { field.to_json(1).must_equal 1 }
|
10
10
|
it { field.to_json('1').must_equal 1 }
|
11
|
-
end
|
12
11
|
|
12
|
+
end
|
13
13
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'test_helper'
|
2
2
|
|
3
3
|
module PushType
|
4
|
+
class RepeaterFieldTest < ActiveSupport::TestCase
|
4
5
|
|
5
|
-
describe RepeaterField do
|
6
6
|
let(:field) { PushType::RepeaterField.new :foo }
|
7
7
|
let(:val) { ['a', 'b', 'c'] }
|
8
8
|
|
@@ -17,5 +17,4 @@ module PushType
|
|
17
17
|
end
|
18
18
|
|
19
19
|
end
|
20
|
-
|
21
20
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'test_helper'
|
2
2
|
|
3
3
|
module PushType
|
4
|
+
class SelectFieldTest < ActiveSupport::TestCase
|
4
5
|
|
5
|
-
describe SelectField do
|
6
6
|
let(:field) { PushType::SelectField.new :foo, opts }
|
7
7
|
let(:val) { 'a' }
|
8
8
|
|
@@ -36,5 +36,4 @@ module PushType
|
|
36
36
|
end
|
37
37
|
|
38
38
|
end
|
39
|
-
|
40
39
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'test_helper'
|
2
2
|
|
3
3
|
module PushType
|
4
|
+
class TagListFieldTest < ActiveSupport::TestCase
|
4
5
|
|
5
|
-
describe TagListField do
|
6
6
|
let(:field) { PushType::TagListField.new :tags, opts }
|
7
7
|
let(:val) { ['foo', 'bar'] }
|
8
8
|
|
@@ -53,6 +53,6 @@ module PushType
|
|
53
53
|
it { TestPage.all_tags { TestPage.published }.must_equal ['qux'] }
|
54
54
|
end
|
55
55
|
end
|
56
|
-
end
|
57
56
|
|
57
|
+
end
|
58
58
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'test_helper'
|
2
2
|
|
3
3
|
module PushType
|
4
|
+
class TaxonomyFieldTest < ActiveSupport::TestCase
|
4
5
|
|
5
|
-
describe TaxonomyField do
|
6
6
|
let(:field) { PushType::TaxonomyField.new :foo, opts }
|
7
7
|
|
8
8
|
before do
|
@@ -52,6 +52,6 @@ module PushType
|
|
52
52
|
it { node.foo.must_equal taxonomy }
|
53
53
|
end
|
54
54
|
end
|
55
|
-
end
|
56
55
|
|
56
|
+
end
|
57
57
|
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
require
|
1
|
+
require 'test_helper'
|
2
2
|
|
3
3
|
module PushType
|
4
|
+
class TextFieldTest < ActiveSupport::TestCase
|
4
5
|
|
5
|
-
describe TextField do
|
6
6
|
let(:field) { PushType::TextField.new :foo }
|
7
7
|
let(:val) { '15:00' }
|
8
8
|
|
9
9
|
it { field.form_helper.must_equal :text_area }
|
10
|
-
end
|
11
10
|
|
11
|
+
end
|
12
12
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'test_helper'
|
2
2
|
|
3
3
|
module PushType
|
4
|
+
class TimeFieldTest < ActiveSupport::TestCase
|
4
5
|
|
5
|
-
describe TimeField do
|
6
6
|
let(:field) { PushType::TimeField.new :foo }
|
7
7
|
let(:val) { '15:00' }
|
8
8
|
|
@@ -10,6 +10,6 @@ module PushType
|
|
10
10
|
it { field.form_helper.must_equal :time_field }
|
11
11
|
it { field.from_json(val).must_be_instance_of Time }
|
12
12
|
it { field.from_json(val).hour.must_equal 15 }
|
13
|
-
end
|
14
13
|
|
14
|
+
end
|
15
15
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'test_helper'
|
2
2
|
require "generators/push_type/field/field_generator"
|
3
3
|
|
4
4
|
module PushType
|
5
|
-
|
5
|
+
class FieldGeneratorTest < Rails::Generators::TestCase
|
6
6
|
tests FieldGenerator
|
7
7
|
destination Rails.root.join('tmp/generators')
|
8
8
|
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'test_helper'
|
2
2
|
require "generators/push_type/install/install_generator"
|
3
3
|
|
4
4
|
module PushType
|
5
|
-
|
5
|
+
class InstallGeneratorTest < Rails::Generators::TestCase
|
6
6
|
tests InstallGenerator
|
7
7
|
destination Rails.root.join('tmp/generators')
|
8
8
|
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'test_helper'
|
2
2
|
require "generators/push_type/node/node_generator"
|
3
3
|
|
4
4
|
module PushType
|
5
|
-
|
5
|
+
class NodeGeneratorTest < Rails::Generators::TestCase
|
6
6
|
tests NodeGenerator
|
7
7
|
destination Rails.root.join('tmp/generators')
|
8
8
|
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'test_helper'
|
2
2
|
require "generators/push_type/presenter/presenter_generator"
|
3
3
|
|
4
4
|
module PushType
|
5
|
-
|
5
|
+
class PresenterGeneratorTest < Rails::Generators::TestCase
|
6
6
|
tests PresenterGenerator
|
7
7
|
destination Rails.root.join('tmp/generators')
|
8
8
|
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'test_helper'
|
2
2
|
require "generators/push_type/taxonomy/taxonomy_generator"
|
3
3
|
|
4
4
|
module PushType
|
5
|
-
|
5
|
+
class TaxonomyGeneratorTest < Rails::Generators::TestCase
|
6
6
|
tests TaxonomyGenerator
|
7
7
|
destination Rails.root.join('tmp/generators')
|
8
8
|
|