guts 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/app/models/guts/category.rb +4 -4
  4. data/app/models/guts/content.rb +3 -3
  5. data/app/models/guts/navigation.rb +4 -4
  6. data/app/models/guts/type.rb +2 -2
  7. data/db/migrate/20160309030237_create_guts_contents.rb +1 -1
  8. data/db/migrate/20160726010421_remove_unique_slug_constraint.rb +20 -0
  9. data/lib/guts/version.rb +1 -1
  10. data/test/dummy/db/schema.rb +5 -5
  11. data/test/dummy/db/test.sqlite3 +0 -0
  12. data/test/dummy/log/test.log +29880 -0
  13. data/test/dummy/public/system/guts/media/166/075/618/compact/spongebob.png +0 -0
  14. data/test/dummy/public/system/guts/media/166/075/618/grande/spongebob.png +0 -0
  15. data/test/dummy/public/system/guts/media/166/075/618/large/spongebob.png +0 -0
  16. data/test/dummy/public/system/guts/media/166/075/618/medium/spongebob.png +0 -0
  17. data/test/dummy/public/system/guts/media/166/075/618/small/spongebob.png +0 -0
  18. data/test/dummy/public/system/guts/media/166/075/618/supreme/spongebob.png +0 -0
  19. data/test/dummy/public/system/guts/media/166/075/618/thumb/spongebob.png +0 -0
  20. data/test/dummy/tmp/generators/extension/vendor/extensions/guts-homebrews/Gemfile +2 -0
  21. data/test/dummy/tmp/generators/extension/vendor/extensions/guts-homebrews/README.md +1 -0
  22. data/test/dummy/tmp/generators/extension/vendor/extensions/guts-homebrews/Rakefile +22 -0
  23. data/test/dummy/tmp/generators/extension/vendor/extensions/guts-homebrews/app/controllers/guts/homebrews/homebrews_controller.rb +8 -0
  24. data/test/dummy/tmp/generators/extension/vendor/extensions/guts-homebrews/config/routes.rb +3 -0
  25. data/test/dummy/tmp/generators/extension/vendor/extensions/guts-homebrews/guts-homebrews.gemspec +23 -0
  26. data/test/models/guts/content_test.rb +44 -20
  27. metadata +15 -2
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
@@ -0,0 +1,22 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ APP_RAKEFILE = File.expand_path('../test/dummy/Rakefile', __FILE__)
8
+ load 'rails/tasks/engine.rake'
9
+ load 'rails/tasks/statistics.rake'
10
+
11
+ Bundler::GemHelper.install_tasks
12
+
13
+ require 'rake/testtask'
14
+
15
+ Rake::TestTask.new(:test) do |t|
16
+ t.libs << 'lib'
17
+ t.libs << 'test'
18
+ t.pattern = 'test/**/*_test.rb'
19
+ t.verbose = false
20
+ end
21
+
22
+ task default: :test
@@ -0,0 +1,8 @@
1
+ module Guts
2
+ module Homebrews
3
+ class HomebrewsController < ::Guts::ApplicationController
4
+ def index
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ Guts::Engine.routes.draw do
2
+ resources :homebrews, only: [:index]
3
+ end
@@ -0,0 +1,23 @@
1
+ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
2
+
3
+ # Maintain your gem's version:
4
+ require 'guts/homebrews/version'
5
+
6
+ # Describe your gem and declare its dependencies:
7
+ Gem::Specification.new do |s|
8
+ s.name = 'guts-homebrew'
9
+ s.version = Guts::Homebrews::VERSION
10
+ s.description = 'Homebrews extension for Guts'
11
+ s.summary = 'Homebrews extension for Guts'
12
+ s.authors =
13
+ s.files = Dir[
14
+ '{app,config,db,lib}/**/*',
15
+ 'LICENSE',
16
+ 'Rakefile',
17
+ 'README.md'
18
+ ]
19
+ s.test_files = Dir['test/**/*']
20
+ s.license = 'MIT'
21
+
22
+ s.add_dependency 'guts', '~> 1.3.0'
23
+ end
@@ -5,48 +5,48 @@ module Guts
5
5
  setup do
6
6
  @user = guts_users :admin_user
7
7
  end
8
-
8
+
9
9
  test 'should not create without title' do
10
10
  content = Content.new
11
-
11
+
12
12
  assert_not content.save
13
13
  end
14
-
14
+
15
15
  test 'should not create without type' do
16
16
  content = Content.new
17
17
  content.type = guts_types :page_type
18
-
18
+
19
19
  assert_not content.save
20
20
  end
21
-
21
+
22
22
  test 'should not create with title less than three characters' do
23
23
  content = Content.new
24
- content.title = '12'
25
-
24
+ content.title = '12'
25
+
26
26
  assert_not content.save
27
27
  end
28
-
28
+
29
29
  test 'should create slug for title' do
30
30
  content = Content.new
31
31
  content.title = 'How to win an XBOX'
32
32
  content.save
33
-
33
+
34
34
  assert_equal 'how-to-win-an-xbox', content.slug
35
35
  end
36
-
36
+
37
37
  test 'should create content with user' do
38
38
  content = Content.new
39
39
  content.title = 'I love users'
40
40
  content.user = @user
41
41
  content.save
42
-
42
+
43
43
  assert_not_nil content.user
44
44
  end
45
-
45
+
46
46
  test 'should return navigatable format' do
47
47
  assert_equal '[:type.title] :title', Content.navigatable_opts[:format]
48
48
  assert_equal [:'type.title', :title], Content.navigatable_opts[:variables]
49
-
49
+
50
50
  content = guts_contents :test_page
51
51
  assert_equal '[Page] Test Page', content.navigatable_format
52
52
  end
@@ -54,32 +54,56 @@ module Guts
54
54
  test 'should return category for content' do
55
55
  content = guts_contents :test_page
56
56
  category = guts_categories :test_category
57
-
57
+
58
58
  assert_includes content.categories, category
59
59
  end
60
-
60
+
61
61
  test 'should return metafields for content' do
62
62
  content = guts_contents :test_page
63
-
63
+
64
64
  assert_operator content.metafields.size, :>, 0
65
65
  end
66
-
66
+
67
67
  test 'should be trackable' do
68
68
  assert_equal true, Content.methods.include?(:trackable)
69
69
  end
70
-
70
+
71
71
  test 'should return user' do
72
72
  content = guts_contents :test_page
73
73
  assert_not_nil content.user
74
74
  end
75
-
75
+
76
76
  test 'should return no user' do
77
77
  content = guts_contents :test_page_2
78
78
  assert_nil content.user
79
79
  end
80
-
80
+
81
81
  test 'content should be multisite compatible' do
82
82
  assert Content.all.to_sql.include?('site_id')
83
83
  end
84
+
85
+ test 'content should create multisite scoped friendly_id' do
86
+ content = Content.new
87
+ content.title = 'Home'
88
+ content.site = guts_sites :default_site
89
+ content.type = guts_types :page_type
90
+ content.save!
91
+
92
+ content2 = Content.new
93
+ content2.title = 'Home'
94
+ content2.site = guts_sites :nondefault_site
95
+ content2.type = guts_types :page_type
96
+ content2.save!
97
+
98
+ content3 = Content.new
99
+ content3.title = 'Home'
100
+ content3.site = guts_sites :nondefault_site
101
+ content3.type = guts_types :page_type
102
+ content3.save!
103
+
104
+ assert_equal 'home', content.slug
105
+ assert_equal 'home', content2.slug
106
+ assert_not_equal 'home', content3.slug
107
+ end
84
108
  end
85
109
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guts
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler King
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-17 00:00:00.000000000 Z
11
+ date: 2016-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -394,6 +394,7 @@ files:
394
394
  - db/migrate/20160410200029_create_guts_sites.rb
395
395
  - db/migrate/20160410200459_add_site_to_guts.rb
396
396
  - db/migrate/20160410203608_add_default_to_guts_sites.rb
397
+ - db/migrate/20160726010421_remove_unique_slug_constraint.rb
397
398
  - lib/generators/guts/initializer/USAGE
398
399
  - lib/generators/guts/initializer/initializer_generator.rb
399
400
  - lib/generators/guts/install/USAGE
@@ -1851,6 +1852,12 @@ files:
1851
1852
  - test/dummy/tmp/cache/assets/sprockets/v3.0/zrfRNU7I2Pi32LDUXfHTb3yuehf7XT43qJ5Eo5B5_5o.cache
1852
1853
  - test/dummy/tmp/cache/assets/sprockets/v3.0/zt/zths0J70fBzWjWw89eSA3IteAkqwJhcbZzTcyOhKz8I.cache
1853
1854
  - test/dummy/tmp/cache/assets/sprockets/v3.0/zx1Cck96tmlQNk2OBPqgX4IJWzcZv0_O-67Yl8mdyp8.cache
1855
+ - test/dummy/tmp/generators/extension/vendor/extensions/guts-homebrews/Gemfile
1856
+ - test/dummy/tmp/generators/extension/vendor/extensions/guts-homebrews/README.md
1857
+ - test/dummy/tmp/generators/extension/vendor/extensions/guts-homebrews/Rakefile
1858
+ - test/dummy/tmp/generators/extension/vendor/extensions/guts-homebrews/app/controllers/guts/homebrews/homebrews_controller.rb
1859
+ - test/dummy/tmp/generators/extension/vendor/extensions/guts-homebrews/config/routes.rb
1860
+ - test/dummy/tmp/generators/extension/vendor/extensions/guts-homebrews/guts-homebrews.gemspec
1854
1861
  - test/dummy/tmp/generators/initializer/config/initializers/guts.rb
1855
1862
  - test/dummy/tmp/generators/routes/config/routes.rb
1856
1863
  - test/dummy/tmp/generators/tinymce/config/tinymce.yml
@@ -3360,6 +3367,12 @@ test_files:
3360
3367
  - test/dummy/tmp/cache/assets/sprockets/v3.0/zx1Cck96tmlQNk2OBPqgX4IJWzcZv0_O-67Yl8mdyp8.cache
3361
3368
  - test/dummy/tmp/cache/assets/sprockets/v3.0/Zy-IBZ6xYF0Zs9bb654KoCYVuX9LJvnD4x-Scb6F3_o.cache
3362
3369
  - test/dummy/tmp/cache/assets/sprockets/v3.0/ZZ/ZZCbScp-iBpUdYaZsnJxcSTJnK8hXb7OgSlVZpo2AMg.cache
3370
+ - test/dummy/tmp/generators/extension/vendor/extensions/guts-homebrews/app/controllers/guts/homebrews/homebrews_controller.rb
3371
+ - test/dummy/tmp/generators/extension/vendor/extensions/guts-homebrews/config/routes.rb
3372
+ - test/dummy/tmp/generators/extension/vendor/extensions/guts-homebrews/Gemfile
3373
+ - test/dummy/tmp/generators/extension/vendor/extensions/guts-homebrews/guts-homebrews.gemspec
3374
+ - test/dummy/tmp/generators/extension/vendor/extensions/guts-homebrews/Rakefile
3375
+ - test/dummy/tmp/generators/extension/vendor/extensions/guts-homebrews/README.md
3363
3376
  - test/dummy/tmp/generators/initializer/config/initializers/guts.rb
3364
3377
  - test/dummy/tmp/generators/routes/config/routes.rb
3365
3378
  - test/dummy/tmp/generators/tinymce/config/tinymce.yml