refinerycms-core 4.0.1 → 4.0.2
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/app/views/refinery/_site_bar.html.erb +1 -1
- data/app/views/refinery/admin/_continue_editing.html.erb +3 -2
- data/app/views/refinery/admin/_form_actions.html.erb +33 -27
- data/lib/generators/refinery/cms/cms_generator.rb +19 -6
- data/lib/generators/refinery/core/templates/config/initializers/refinery/core.rb.erb +1 -19
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_form.html.erb +5 -4
- data/lib/generators/refinery/engine/templates/spec/features/refinery/namespace/admin/plural_name_spec.rb.erb +5 -5
- data/lib/generators/refinery/engine/templates/spec/models/refinery/namespace/singular_name_spec.rb.erb +1 -1
- data/lib/generators/refinery/engine/templates/spec/support/factories/refinery/plural_name.rb.erb +1 -1
- data/lib/refinery/core/configuration.rb +4 -18
- data/lib/refinery/crud.rb +3 -2
- data/lib/refinery/version.rb +1 -1
- data/refinerycms-core.gemspec +1 -1
- data/spec/features/refinery/admin/xhr_paging_spec.rb +2 -2
- data/spec/features/refinery/application_layout_spec.rb +1 -1
- data/spec/features/refinery/site_bar_spec.rb +1 -1
- data/spec/helpers/refinery/translation_helper_spec.rb +2 -2
- data/spec/lib/generators/refinery/engine/engine_generator_multiple_resources_spec.rb +6 -2
- data/spec/lib/generators/refinery/engine/engine_generator_spec.rb +5 -0
- data/spec/lib/generators/refinery/engine/engine_generator_with_author_spec.rb +5 -0
- data/spec/lib/generators/refinery/engine/engine_generator_with_i18n_spec.rb +5 -0
- data/spec/lib/generators/refinery/engine/engine_generator_without_frontend_spec.rb +5 -0
- data/spec/lib/refinery/core/configuration_spec.rb +0 -16
- data/spec/presenters/refinery/translated_field_presenter_spec.rb +1 -1
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdb057b3b306e31b50c5d499356dca454f58aafe
|
4
|
+
data.tar.gz: 00c968f4d7fa7461a910b7bfd981585f7867748a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0823576bc59743ae7178231da4f0044120d39097b5cf8b0d384fa5169efab0914e82fdfa66d78c9b58dc8ca9f16f061fa4c8d395b47b6228d1cd80842a7387c0'
|
7
|
+
data.tar.gz: beafadf6564b1c71e2b89e38aef370e5fddba961c34df7ad17fe2907a01b9fe1789fbb4af7e7d7ae5b690456b691c2150ec5eefebf2aa398661d28f0a4ae7176
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<div id='site_bar'>
|
7
7
|
<div id='site_bar_content' class='clearfix'>
|
8
8
|
|
9
|
-
<%= link_to '
|
9
|
+
<%= link_to 'https://www.refinerycms.com', :id => 'site_bar_refinery_cms_logo', :target => '_blank' do %>
|
10
10
|
<%= image_tag 'refinery/refinery-cms-logo.svg', alt: 'Refinery CMS™' %>
|
11
11
|
<% end %>
|
12
12
|
|
@@ -1,8 +1,9 @@
|
|
1
1
|
<%
|
2
2
|
unless (hide_submit ||= false)
|
3
3
|
submit_button_text ||= t('.save')
|
4
|
-
submit_button_id ||=
|
4
|
+
submit_button_id ||= 'submit_button'
|
5
5
|
submit_button_title ||= nil
|
6
|
+
submit_button_data ||= { disable_with: false }
|
6
7
|
end
|
7
8
|
|
8
9
|
hide_cancel = from_dialog? unless defined?(hide_cancel).presence
|
@@ -12,8 +13,8 @@
|
|
12
13
|
unless defined?(cancel_title)
|
13
14
|
cancel_title = t('.cancel_lose_changes')
|
14
15
|
end
|
15
|
-
cancel_button_id ||=
|
16
|
-
cancel_url ||= (((back = url_for(:back)).include?('javascript') or action_name =~ /^(create|update)$/) ? refinery.send(Refinery.route_for_model(f.object.class, :
|
16
|
+
cancel_button_id ||= 'cancel_button'
|
17
|
+
cancel_url ||= (((back = url_for(:back)).include?('javascript') or action_name =~ /^(create|update)$/) ? refinery.send(Refinery.route_for_model(f.object.class, plural: true)) : back)
|
17
18
|
end
|
18
19
|
|
19
20
|
continue_editing = defined?(continue_editing) ? continue_editing : (f.object.present? and f.object.persisted?)
|
@@ -28,7 +29,7 @@
|
|
28
29
|
delete_button_text ||= t('.delete')
|
29
30
|
delete_title ||= nil
|
30
31
|
delete_confirmation ||= nil
|
31
|
-
delete_button_id ||=
|
32
|
+
delete_button_id ||= 'delete_button'
|
32
33
|
# we have to use eval rather than refinery.send because this url may not exist for HTTP GET
|
33
34
|
delete_url ||= eval("refinery.#{Refinery.route_for_model(f.object.class)}(#{f.object.id})")
|
34
35
|
end
|
@@ -38,37 +39,42 @@
|
|
38
39
|
<input type='hidden' name='dialog' value='true' />
|
39
40
|
<% end %>
|
40
41
|
|
41
|
-
|
42
|
-
|
42
|
+
<%= content_tag :div, class: "form-actions#{' form-actions-dialog' if from_dialog?}" do %>
|
43
|
+
<%= content_tag :div, class: 'form-actions-left' do %>
|
43
44
|
<%= submit_tag submit_button_text,
|
44
|
-
:
|
45
|
-
:
|
46
|
-
:
|
47
|
-
:
|
45
|
+
id: submit_button_id,
|
46
|
+
name: nil,
|
47
|
+
class: 'wymupdate button',
|
48
|
+
data: submit_button_data,
|
49
|
+
tooltip: submit_button_title unless hide_submit %>
|
48
50
|
|
49
|
-
<%= render '/refinery/admin/continue_editing', :
|
51
|
+
<%= render '/refinery/admin/continue_editing', f: f if continue_editing -%>
|
50
52
|
<%= hidden_field_tag :continue_editing, false if continue_editing %>
|
51
53
|
|
52
54
|
<%= local_assigns[:before_cancel_button] -%>
|
53
55
|
|
54
|
-
<%= link_to
|
55
|
-
:
|
56
|
-
:
|
57
|
-
:
|
56
|
+
<%= link_to cancel_button_text, cancel_url,
|
57
|
+
title: cancel_title,
|
58
|
+
id: cancel_button_id,
|
59
|
+
class: 'close_dialog button' unless hide_cancel %>
|
58
60
|
|
59
61
|
<%= local_assigns[:after_cancel_button] -%>
|
60
|
-
|
61
|
-
|
62
|
-
|
62
|
+
|
63
|
+
<%= content_tag :i, nil, id: 'spinner', class: 'loading_icon hidden_icon' %>
|
64
|
+
<% end %>
|
65
|
+
|
66
|
+
<%= content_tag :div, class: 'form-actions-right' do %>
|
63
67
|
<%= local_assigns[:before_delete_button] -%>
|
64
|
-
|
65
|
-
|
66
|
-
:
|
67
|
-
:
|
68
|
-
:
|
69
|
-
|
68
|
+
|
69
|
+
<%= link_to delete_button_text, delete_url,
|
70
|
+
title: delete_title,
|
71
|
+
id: delete_button_id,
|
72
|
+
method: :delete,
|
73
|
+
data: {
|
74
|
+
confirm: delete_confirmation
|
70
75
|
},
|
71
|
-
:
|
76
|
+
class: 'button confirm-delete' unless hide_delete %>
|
77
|
+
|
72
78
|
<%= local_assigns[:after_delete_button] -%>
|
73
|
-
|
74
|
-
|
79
|
+
<% end %>
|
80
|
+
<% end %>
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'pathname'
|
2
|
+
require 'mkmf'
|
2
3
|
|
3
4
|
module Refinery
|
4
5
|
class CmsGenerator < Rails::Generators::Base
|
@@ -76,15 +77,14 @@ end} end
|
|
76
77
|
|
77
78
|
def append_heroku_gems!
|
78
79
|
production_gems = [
|
79
|
-
"gem 'dragonfly-s3_data_store'"
|
80
|
-
"gem 'rails_12factor'",
|
81
|
-
"gem 'puma'"
|
80
|
+
"gem 'dragonfly-s3_data_store'"
|
82
81
|
]
|
82
|
+
production_gems << "gem 'puma'" unless destination_gemfile_has_puma?
|
83
83
|
production_gems << "gem 'pg'" unless destination_gemfile_has_postgres?
|
84
84
|
|
85
85
|
append_file "Gemfile", %Q{
|
86
86
|
# The Ruby version is specified here so that Heroku uses the right version.
|
87
|
-
ruby #{
|
87
|
+
ruby #{current_ruby_version.inspect}
|
88
88
|
|
89
89
|
# Gems that have been added for Heroku support
|
90
90
|
group :production do
|
@@ -93,6 +93,10 @@ end
|
|
93
93
|
}.sub("{{production_gems}}", production_gems.join("\n "))
|
94
94
|
end
|
95
95
|
|
96
|
+
def current_ruby_version
|
97
|
+
ENV['RUBY_VERSION'].presence || RUBY_VERSION
|
98
|
+
end
|
99
|
+
|
96
100
|
def bundle!
|
97
101
|
run 'bundle install'
|
98
102
|
end
|
@@ -225,8 +229,16 @@ end
|
|
225
229
|
end
|
226
230
|
|
227
231
|
def destination_gemfile_has_postgres?
|
232
|
+
destination_gemfile_has_gem?('pg')
|
233
|
+
end
|
234
|
+
|
235
|
+
def destination_gemfile_has_puma?
|
236
|
+
destination_gemfile_has_gem?('puma')
|
237
|
+
end
|
238
|
+
|
239
|
+
def destination_gemfile_has_gem?(gem_name)
|
228
240
|
destination_path.join('Gemfile').file? &&
|
229
|
-
destination_path.join('Gemfile').read =~ %r{gem ['"]
|
241
|
+
destination_path.join('Gemfile').read =~ %r{gem ['"]#{gem_name}['"]}
|
230
242
|
end
|
231
243
|
|
232
244
|
def heroku?
|
@@ -234,7 +246,7 @@ end
|
|
234
246
|
end
|
235
247
|
|
236
248
|
def heroku_toolbelt_missing?
|
237
|
-
|
249
|
+
find_executable("heroku").nil?
|
238
250
|
end
|
239
251
|
|
240
252
|
def manage_roadblocks!
|
@@ -284,6 +296,7 @@ end
|
|
284
296
|
generator_args << '--skip-migrations' if self.options[:skip_migrations]
|
285
297
|
Refinery::CoreGenerator.start generator_args
|
286
298
|
Refinery::Authentication::DeviseGenerator.start generator_args if defined?(Refinery::Authentication::DeviseGenerator)
|
299
|
+
Refinery::Dragonfly::DragonflyGenerator.start generator_args if defined?(Refinery::Dragonfly::DragonflyGenerator)
|
287
300
|
Refinery::ResourcesGenerator.start generator_args if defined?(Refinery::ResourcesGenerator)
|
288
301
|
Refinery::PagesGenerator.start generator_args if defined?(Refinery::PagesGenerator)
|
289
302
|
Refinery::ImagesGenerator.start generator_args if defined?(Refinery::ImagesGenerator)
|
@@ -6,21 +6,7 @@ Refinery::Core.configure do |config|
|
|
6
6
|
# When true this will force SSL redirection in all Refinery backend controllers.
|
7
7
|
# config.force_ssl = <%= Refinery::Core.force_ssl.inspect %>
|
8
8
|
|
9
|
-
#
|
10
|
-
# If you have to.
|
11
|
-
# config.s3_bucket_name = ENV['S3_BUCKET']
|
12
|
-
# config.s3_region = ENV['S3_REGION']
|
13
|
-
# config.s3_access_key_id = ENV['S3_KEY']
|
14
|
-
# config.s3_secret_access_key = ENV['S3_SECRET']
|
15
|
-
|
16
|
-
# When true will use Amazon's Simple Storage Service instead of
|
17
|
-
# the default file system for storing resources and images
|
18
|
-
config.s3_backend = config.s3_access_key_id.present? || config.s3_secret_access_key.present?
|
19
|
-
|
20
|
-
# Use a custom Dragonfly storage backend instead of the default
|
21
|
-
# file system for storing resources and images
|
22
|
-
# config.dragonfly_custom_backend_class = <%= Refinery::Core.dragonfly_custom_backend_class.inspect %>
|
23
|
-
# config.dragonfly_custom_backend_opts = <%= Refinery::Core.dragonfly_custom_backend_opts.inspect %>
|
9
|
+
# Dragonfly and S3 configurations have moved to initializers/refinery/dragonfly.rb
|
24
10
|
|
25
11
|
# Whenever Refinery caches anything and can set a cache key, it will add
|
26
12
|
# a prefix to the cache key containing the string you set here.
|
@@ -37,10 +23,6 @@ Refinery::Core.configure do |config|
|
|
37
23
|
# Enable/disable authenticity token on frontend
|
38
24
|
# config.authenticity_token_on_frontend = <%= Refinery::Core.authenticity_token_on_frontend.inspect %>
|
39
25
|
|
40
|
-
# Should set this if concerned about DOS attacks. See
|
41
|
-
# http://markevans.github.com/dragonfly/file.Configuration.html#Configuration
|
42
|
-
# config.dragonfly_secret = <%= Refinery::Core.dragonfly_secret.inspect %>
|
43
|
-
|
44
26
|
# Register extra javascript for backend
|
45
27
|
# config.register_javascript "prototype-rails"
|
46
28
|
|
@@ -48,10 +48,11 @@
|
|
48
48
|
|
49
49
|
<% end -%>
|
50
50
|
<% end -%>
|
51
|
-
<%%= render '/refinery/admin/form_actions', :
|
52
|
-
:
|
53
|
-
:
|
54
|
-
:
|
51
|
+
<%%= render '/refinery/admin/form_actions', f: f,
|
52
|
+
continue_editing: false,
|
53
|
+
delete_title: t('delete', scope: 'refinery.<%= plural_name %>.admin.<%= plural_name %>.<%= singular_name %>'),
|
54
|
+
delete_confirmation: t('message', scope: 'refinery.admin.delete'<% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? %>, title: @<%= singular_name %>.<%= title.name %><% end %>),
|
55
|
+
cancel_url: refinery.<%= namespacing.underscore %>_admin_<%= plural_name %>_path -%>
|
55
56
|
<%% end -%>
|
56
57
|
<% if text_areas.any? -%>
|
57
58
|
|
@@ -9,8 +9,8 @@ describe Refinery do
|
|
9
9
|
<% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? %>
|
10
10
|
describe "<%= plural_name %> list" do
|
11
11
|
before do
|
12
|
-
|
13
|
-
|
12
|
+
FactoryBot.create(:<%= singular_name %>, :<%= title.name %> => "UniqueTitleOne")
|
13
|
+
FactoryBot.create(:<%= singular_name %>, :<%= title.name %> => "UniqueTitleTwo")
|
14
14
|
end
|
15
15
|
|
16
16
|
it "shows two items" do
|
@@ -45,7 +45,7 @@ describe Refinery do
|
|
45
45
|
end
|
46
46
|
|
47
47
|
context "duplicate" do
|
48
|
-
before {
|
48
|
+
before { FactoryBot.create(:<%= singular_name %>, :<%= title.name %> => "UniqueTitle") }
|
49
49
|
|
50
50
|
it "should fail" do
|
51
51
|
visit refinery.<%= namespacing.underscore %>_admin_<%= plural_name %>_path
|
@@ -161,7 +161,7 @@ describe Refinery do
|
|
161
161
|
end
|
162
162
|
|
163
163
|
describe "edit" do
|
164
|
-
before {
|
164
|
+
before { FactoryBot.create(:<%= singular_name %>, :<%= title.name %> => "A <%= title.name %>") }
|
165
165
|
|
166
166
|
it "should succeed" do
|
167
167
|
visit refinery.<%= namespacing.underscore %>_admin_<%= plural_name %>_path
|
@@ -179,7 +179,7 @@ describe Refinery do
|
|
179
179
|
end
|
180
180
|
|
181
181
|
describe "destroy" do
|
182
|
-
before {
|
182
|
+
before { FactoryBot.create(:<%= singular_name %>, :<%= title.name %> => "UniqueTitleOne") }
|
183
183
|
|
184
184
|
it "should succeed" do
|
185
185
|
visit refinery.<%= namespacing.underscore %>_admin_<%= plural_name %>_path
|
@@ -5,7 +5,7 @@ module Refinery
|
|
5
5
|
describe <%= class_name %> do
|
6
6
|
describe "validations", type: :model do
|
7
7
|
subject do
|
8
|
-
|
8
|
+
FactoryBot.create(:<%= singular_name %><% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? -%>,
|
9
9
|
:<%= title.name %> => "Refinery CMS"<% end %>)
|
10
10
|
end
|
11
11
|
|
data/lib/generators/refinery/engine/templates/spec/support/factories/refinery/plural_name.rb.erb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? %>
|
2
|
-
|
2
|
+
FactoryBot.define do
|
3
3
|
factory :<%= singular_name %>, :class => Refinery::<%= namespacing %>::<%= class_name %> do
|
4
4
|
sequence(:<%= title.name %>) { |n| "refinery#{n}" }
|
5
5
|
end
|
@@ -2,33 +2,23 @@ module Refinery
|
|
2
2
|
module Core
|
3
3
|
include ActiveSupport::Configurable
|
4
4
|
|
5
|
-
config_accessor :rescue_not_found, :
|
5
|
+
config_accessor :rescue_not_found, :base_cache_key, :site_name,
|
6
6
|
:google_analytics_page_code, :authenticity_token_on_frontend,
|
7
|
-
:
|
8
|
-
:
|
9
|
-
:s3_secret_access_key, :force_ssl, :backend_route,
|
10
|
-
:dragonfly_custom_backend_class, :dragonfly_custom_backend_opts,
|
7
|
+
:javascripts, :stylesheets, :mounted_path,
|
8
|
+
:force_ssl, :backend_route,
|
11
9
|
:visual_editor_javascripts, :visual_editor_stylesheets,
|
12
10
|
:plugin_priority, :refinery_logout_path
|
13
11
|
|
14
12
|
self.rescue_not_found = false
|
15
|
-
self.s3_backend = false
|
16
13
|
self.base_cache_key = :refinery
|
17
14
|
self.site_name = "Company Name"
|
18
15
|
self.google_analytics_page_code = "UA-xxxxxx-x"
|
19
16
|
self.authenticity_token_on_frontend = false
|
20
|
-
self.dragonfly_secret = Array.new(24) { rand(256) }.pack('C*').unpack('H*').first
|
21
17
|
self.javascripts = []
|
22
18
|
self.stylesheets = []
|
23
|
-
self.s3_bucket_name = ENV['S3_BUCKET']
|
24
|
-
self.s3_region = ENV['S3_REGION']
|
25
|
-
self.s3_access_key_id = ENV['S3_KEY']
|
26
|
-
self.s3_secret_access_key = ENV['S3_SECRET']
|
27
19
|
self.force_ssl = false
|
28
20
|
self.backend_route = "refinery"
|
29
21
|
self.mounted_path = "/"
|
30
|
-
self.dragonfly_custom_backend_class = ''
|
31
|
-
self.dragonfly_custom_backend_opts = {}
|
32
22
|
self.visual_editor_javascripts = []
|
33
23
|
self.visual_editor_stylesheets = []
|
34
24
|
self.plugin_priority = []
|
@@ -68,12 +58,8 @@ module Refinery
|
|
68
58
|
self.stylesheets = []
|
69
59
|
end
|
70
60
|
|
71
|
-
def dragonfly_custom_backend?
|
72
|
-
config.dragonfly_custom_backend_class.present?
|
73
|
-
end
|
74
|
-
|
75
61
|
def dragonfly_custom_backend_class
|
76
|
-
config.
|
62
|
+
raise "Refinery::Dragonfly now handles all dragonfly configuration. Consult 'config/initializers/refinery/dragonfly.rb'."
|
77
63
|
end
|
78
64
|
|
79
65
|
def site_name
|
data/lib/refinery/crud.rb
CHANGED
@@ -26,7 +26,7 @@ module Refinery
|
|
26
26
|
{
|
27
27
|
:conditions => '',
|
28
28
|
:include => [],
|
29
|
-
:order => ('position ASC' if this_class.table_exists? && this_class.column_names.include?('position')),
|
29
|
+
:order => ('position ASC' if this_class.connected? && this_class.table_exists? && this_class.column_names.include?('position')),
|
30
30
|
:paging => true,
|
31
31
|
:per_page => false,
|
32
32
|
:redirect_to_url => "refinery.#{Refinery.route_for_model(class_name.constantize, :plural => true)}",
|
@@ -67,7 +67,8 @@ module Refinery
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def create
|
70
|
-
|
70
|
+
@#{singular_name} = #{class_name}.new(#{singular_name}_params)
|
71
|
+
if @#{singular_name}.save
|
71
72
|
flash.notice = t(
|
72
73
|
'refinery.crudify.created',
|
73
74
|
:what => "'\#{@#{singular_name}.#{options[:title_attribute]}}'"
|
data/lib/refinery/version.rb
CHANGED
data/refinerycms-core.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.summary = %q{Core extension for Refinery CMS}
|
12
12
|
s.description = %q{The core of Refinery CMS. This handles the common functionality and is required by most extensions}
|
13
13
|
s.email = %q{refinerycms@p.arndt.io}
|
14
|
-
s.homepage = %q{
|
14
|
+
s.homepage = %q{https://www.refinerycms.com}
|
15
15
|
s.rubyforge_project = %q{refinerycms}
|
16
16
|
s.authors = ['Philip Arndt', 'Uģis Ozols', 'Rob Yurkowski']
|
17
17
|
s.license = %q{MIT}
|
@@ -8,8 +8,8 @@ module Refinery
|
|
8
8
|
# Refinery::Admin::ImagesController specifies :order => 'created_at DESC' in crudify
|
9
9
|
let(:first_image) { Image.order('created_at DESC').first }
|
10
10
|
let(:last_image) { Image.order('created_at DESC').last }
|
11
|
-
let!(:image_1) {
|
12
|
-
let!(:image_2) {
|
11
|
+
let!(:image_1) { FactoryBot.create :image }
|
12
|
+
let!(:image_2) { FactoryBot.create :image }
|
13
13
|
|
14
14
|
before do
|
15
15
|
allow(Image).to receive(:per_page).and_return(1)
|
@@ -47,7 +47,7 @@ module Refinery
|
|
47
47
|
|
48
48
|
context "when in frontend" do
|
49
49
|
# make a page in order to avoid 404
|
50
|
-
let!(:root_page) {
|
50
|
+
let!(:root_page) { FactoryBot.create(:page, :link_url => "/") }
|
51
51
|
before { visit refinery.root_path }
|
52
52
|
|
53
53
|
it "has a 'switch to your website editor' button" do
|
@@ -11,7 +11,7 @@ module Refinery
|
|
11
11
|
end
|
12
12
|
|
13
13
|
describe "#translated_field" do
|
14
|
-
let(:page) {
|
14
|
+
let(:page) { FactoryBot.build(:page) }
|
15
15
|
|
16
16
|
before do
|
17
17
|
Globalize.with_locale(:en) do
|
@@ -40,4 +40,4 @@ module Refinery
|
|
40
40
|
end
|
41
41
|
|
42
42
|
end
|
43
|
-
end
|
43
|
+
end
|
@@ -1,18 +1,22 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'fileutils'
|
2
3
|
require 'generator_spec/test_case'
|
3
4
|
require 'generators/refinery/engine/engine_generator'
|
4
|
-
require 'tmpdir'
|
5
5
|
|
6
6
|
module Refinery
|
7
7
|
describe EngineGenerator do
|
8
8
|
include GeneratorSpec::TestCase
|
9
|
-
destination
|
9
|
+
destination File.expand_path("../../../../../../tmp", __FILE__)
|
10
10
|
|
11
11
|
before do
|
12
12
|
prepare_destination
|
13
13
|
run_generator %w{ rspec_product_test title:string description:text image:image brochure:resource }
|
14
14
|
end
|
15
15
|
|
16
|
+
after do
|
17
|
+
FileUtils.rm_r destination_root
|
18
|
+
end
|
19
|
+
|
16
20
|
context "when generating a resource without passing a namespace" do
|
17
21
|
before do
|
18
22
|
run_generator %w{ rspec_item_test title:string --extension rspec_product_tests --skip }
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'fileutils'
|
2
3
|
require 'generator_spec/test_case'
|
3
4
|
require 'generators/refinery/engine/engine_generator'
|
4
5
|
|
@@ -12,6 +13,10 @@ module Refinery
|
|
12
13
|
run_generator %w{ rspec_product_test title:string description:text image:image brochure:resource }
|
13
14
|
end
|
14
15
|
|
16
|
+
after do
|
17
|
+
FileUtils.rm_r destination_root
|
18
|
+
end
|
19
|
+
|
15
20
|
it "uses reference columns for image and resource attributes" do
|
16
21
|
File.open("#{destination_root}/vendor/extensions/rspec_product_tests/app/controllers/refinery/rspec_product_tests/admin/rspec_product_tests_controller.rb") do |file|
|
17
22
|
content = file.read
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'fileutils'
|
2
3
|
require 'generator_spec/test_case'
|
3
4
|
require 'generators/refinery/engine/engine_generator'
|
4
5
|
|
@@ -12,6 +13,10 @@ module Refinery
|
|
12
13
|
run_generator %w{ rspec_product_test title:string description:text image:image brochure:resource --authors Author1 Author2 }
|
13
14
|
end
|
14
15
|
|
16
|
+
after do
|
17
|
+
FileUtils.rm_r destination_root
|
18
|
+
end
|
19
|
+
|
15
20
|
it "uses reference columns for image and resource attributes" do
|
16
21
|
File.open("#{destination_root}/vendor/extensions/rspec_product_tests/refinerycms-rspec_product_tests.gemspec") do |file|
|
17
22
|
content = file.read
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'fileutils'
|
2
3
|
require 'generator_spec/test_case'
|
3
4
|
require 'generators/refinery/engine/engine_generator'
|
4
5
|
|
@@ -12,6 +13,10 @@ module Refinery
|
|
12
13
|
run_generator %w{ rspec_product_test title:string description:text image:image brochure:resource --i18n title description }
|
13
14
|
end
|
14
15
|
|
16
|
+
after do
|
17
|
+
FileUtils.rm_r destination_root
|
18
|
+
end
|
19
|
+
|
15
20
|
specify do
|
16
21
|
expect(destination_root).to have_structure {
|
17
22
|
directory "vendor" do
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'fileutils'
|
2
3
|
require 'generator_spec/test_case'
|
3
4
|
require 'generators/refinery/engine/engine_generator'
|
4
5
|
|
@@ -12,6 +13,10 @@ module Refinery
|
|
12
13
|
run_generator %w{ rspec_product_test title:string description:text image:image brochure:resource --skip-frontend }
|
13
14
|
end
|
14
15
|
|
16
|
+
after do
|
17
|
+
FileUtils.rm_r destination_root
|
18
|
+
end
|
19
|
+
|
15
20
|
specify do
|
16
21
|
expect(destination_root).to have_structure {
|
17
22
|
directory "vendor" do
|
@@ -33,22 +33,6 @@ module Refinery
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
describe 'custom storage backend' do
|
37
|
-
it 'class should be nil by default' do
|
38
|
-
expect(Refinery::Core.dragonfly_custom_backend_class).to eq(nil)
|
39
|
-
end
|
40
|
-
|
41
|
-
context 'is set in core' do
|
42
|
-
before { class DummyBackend; end }
|
43
|
-
after { Refinery::Core.dragonfly_custom_backend_class = nil }
|
44
|
-
let(:backend) { DummyBackend.new }
|
45
|
-
|
46
|
-
it 'and is set to a class that exists' do
|
47
|
-
Refinery::Core.dragonfly_custom_backend_class = 'Refinery::Core::DummyBackend'
|
48
|
-
expect(Refinery::Core.dragonfly_custom_backend_class).to eq(backend.class)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
36
|
end
|
53
37
|
end
|
54
38
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philip Arndt
|
@@ -32,7 +32,7 @@ cert_chain:
|
|
32
32
|
jOQmH9VbgbfUrXYM1YOKdlwW5sPR1f4PKLDlvEE+bppIUgKOgLOIv3i7KwrGvFOq
|
33
33
|
5r7Wz/HY31SM47mkK21saPJG4NvUFEycf0wlpzP657Pl9aVo47aKKbxX
|
34
34
|
-----END CERTIFICATE-----
|
35
|
-
date:
|
35
|
+
date: 2018-05-21 00:00:00.000000000 Z
|
36
36
|
dependencies:
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: refinerycms-i18n
|
@@ -670,7 +670,7 @@ files:
|
|
670
670
|
- vendor/assets/javascripts/jquery/jquery.textTruncate.js
|
671
671
|
- vendor/assets/javascripts/jquery/jquery.timers.js
|
672
672
|
- vendor/assets/javascripts/modernizr-min.js
|
673
|
-
homepage:
|
673
|
+
homepage: https://www.refinerycms.com
|
674
674
|
licenses:
|
675
675
|
- MIT
|
676
676
|
metadata: {}
|
metadata.gz.sig
CHANGED
Binary file
|