refinerycms-core 3.0.1 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/refinery/_colours.scss +1 -1
  3. data/app/assets/stylesheets/refinery/_icons.scss +2 -0
  4. data/app/assets/stylesheets/refinery/_layout.scss +1 -0
  5. data/app/helpers/refinery/image_helper.rb +1 -1
  6. data/app/helpers/refinery/tag_helper.rb +2 -1
  7. data/app/helpers/refinery/translation_helper.rb +3 -0
  8. data/app/presenters/refinery/base_presenter.rb +3 -3
  9. data/app/presenters/refinery/translated_field_presenter.rb +15 -0
  10. data/app/views/layouts/refinery/admin.html.erb +1 -1
  11. data/app/views/refinery/_head.html.erb +2 -2
  12. data/config/locales/en.yml +2 -1
  13. data/config/locales/nl.yml +7 -0
  14. data/config/locales/zh-CN.yml +0 -0
  15. data/lib/generators/refinery/engine/USAGE +1 -1
  16. data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_singular_name.html.erb +18 -14
  17. data/lib/generators/refinery/engine/templates/db/seeds.rb.erb +1 -1
  18. data/lib/generators/refinery/engine/templates/refinerycms-extension_plural_name.gemspec +1 -0
  19. data/lib/generators/refinery/engine/templates/spec/spec_helper.rb +0 -1
  20. data/lib/refinery.rb +1 -0
  21. data/lib/refinery/application_controller.rb +1 -1
  22. data/lib/refinery/core/engine.rb +1 -1
  23. data/lib/refinery/crud.rb +7 -7
  24. data/lib/refinery/extension_generation.rb +5 -0
  25. data/lib/refinery/version.rb +1 -1
  26. data/license.md +1 -1
  27. data/refinerycms-core.gemspec +1 -0
  28. data/spec/helpers/refinery/translation_helper_spec.rb +30 -1
  29. data/spec/lib/generators/refinery/engine/engine_generator_with_author_spec.rb +90 -0
  30. data/spec/presenters/refinery/translated_field_presenter_spec.rb +35 -0
  31. metadata +27 -25
  32. data/config/initializers/assets.rb +0 -6
  33. data/vendor/assets/fonts/font-awesome/FontAwesome.otf +0 -0
  34. data/vendor/assets/fonts/font-awesome/fontawesome-webfont.eot +0 -0
  35. data/vendor/assets/fonts/font-awesome/fontawesome-webfont.svg +0 -565
  36. data/vendor/assets/fonts/font-awesome/fontawesome-webfont.ttf +0 -0
  37. data/vendor/assets/fonts/font-awesome/fontawesome-webfont.woff +0 -0
  38. data/vendor/assets/fonts/font-awesome/fontawesome-webfont.woff2 +0 -0
  39. data/vendor/assets/stylesheets/_font-awesome-compass.scss +0 -5
  40. data/vendor/assets/stylesheets/_font-awesome-sprockets.scss +0 -5
  41. data/vendor/assets/stylesheets/_font-awesome.scss +0 -17
  42. data/vendor/assets/stylesheets/font-awesome/_animated.scss +0 -34
  43. data/vendor/assets/stylesheets/font-awesome/_bordered-pulled.scss +0 -16
  44. data/vendor/assets/stylesheets/font-awesome/_core.scss +0 -12
  45. data/vendor/assets/stylesheets/font-awesome/_extras.scss +0 -44
  46. data/vendor/assets/stylesheets/font-awesome/_fixed-width.scss +0 -6
  47. data/vendor/assets/stylesheets/font-awesome/_icons.scss +0 -596
  48. data/vendor/assets/stylesheets/font-awesome/_larger.scss +0 -13
  49. data/vendor/assets/stylesheets/font-awesome/_list.scss +0 -19
  50. data/vendor/assets/stylesheets/font-awesome/_mixins.scss +0 -26
  51. data/vendor/assets/stylesheets/font-awesome/_path.scss +0 -14
  52. data/vendor/assets/stylesheets/font-awesome/_rotated-flipped.scss +0 -20
  53. data/vendor/assets/stylesheets/font-awesome/_stacked.scss +0 -20
  54. data/vendor/assets/stylesheets/font-awesome/_variables.scss +0 -606
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a20d663ffc6f652d81ddf1ce4dcc13ac4d0a5a9c
4
- data.tar.gz: 16de7b94f2a07e6f925d864cb1ab0fa7311731ba
3
+ metadata.gz: 5b4a8adbdc868b1a05d524a24e5cfc6b6742004c
4
+ data.tar.gz: ed062b6ec449a4c2e27e14c6fe52299740d04411
5
5
  SHA512:
6
- metadata.gz: 5a57be898709a95a2456d8733ad3d3df6154d4be1789284acb28ce46a13985954ec5b884c0578b63d370c261d952a5318ee1a14ea7036d81b12a7ac718769e7b
7
- data.tar.gz: 76d7f8f346a17a94a3d192719b6e2fca477a3e86bba55f4a01449210dd9d4e0494146b632e3bf4a28a6c1b8de7ba402f0de66a7a4cb56d8afa4d31f7ec191527
6
+ metadata.gz: 094c812cf2973fb866be1a7bfad33a813da1d95cb3ff0882e56a4e8b40f1b4d6510f44e5a408f791dca9960f43f3f52fc28fe3c509eaa3afce71e948289c4c50
7
+ data.tar.gz: 23e55f338fe65c9469d0b617ef52344305ddc01a17371ab2b0f65cc91dca2d814f4bf861e5565aab2f5fd937bc668f1145411cfbb4e984a652ad111e572fd2ce
@@ -12,7 +12,7 @@ $icon_preview_colour: $icon_default_colour;
12
12
  $icon_locale_colour: #b7e3fc; // pale blue
13
13
  $icon_done_colour: #00a017; //
14
14
  $info_icon_blue: #316CC8;
15
-
15
+ $icon_warning_colour: #FF6600; // orange
16
16
 
17
17
  $action_background_colour: lighten($icon_locale_colour,10%);
18
18
  $action_border_colour: $icon_locale_colour;
@@ -61,6 +61,7 @@
61
61
  .switch_view_list_icon {@include icon('list')}
62
62
  .upload_icon {@include icon('upload');}
63
63
  .user_comment_icon {@include icon('comment-o');}
64
+ .warning_icon {@include icon('warning', $icon_warning_colour)}
64
65
 
65
66
  .hidden_icon {display:none}
66
67
  .unhidden_icon {display: inline-block}
@@ -83,3 +84,4 @@
83
84
  // don't want underlines on icons
84
85
  #content a[class$='icon'] {border-bottom: none}
85
86
  #content a[class$='icon']:hover {border-bottom: none}
87
+
@@ -804,6 +804,7 @@ body.dialog form {
804
804
  .visual_editor_dialog_table {
805
805
  height: 250px;
806
806
  }
807
+ .no_picked_image_selected {@include icon('warning', $icon_warning_colour)}
807
808
  .dialog {
808
809
  #dialog_main {
809
810
  float: left;
@@ -7,7 +7,7 @@ module Refinery
7
7
  content.gsub(%r{<img.+?src=['"](/system/images/.+?)/.+?/>}) do |img|
8
8
  begin
9
9
  sha = img.match(%r{/system/images/(.+?)/})[1]
10
- job = Dragonfly::Job.deserialize sha, Dragonfly[:refinery_images]
10
+ job = Dragonfly::Job.deserialize sha, Dragonfly.app(:refinery_images)
11
11
 
12
12
  image_fu Image.where(:image_uid => job.uid).first, thumbnail
13
13
  rescue Dragonfly::Serializer::BadString
@@ -5,7 +5,8 @@ module Refinery
5
5
 
6
6
  # Remember to wrap your block with <span class='label_with_help'></span> if you're using a label next to the help tag.
7
7
  def refinery_help_tag(title='Tip')
8
- action_icon(:info, '#', title.html_safe? ? title : h(title), {tooltip: title})
8
+ title = title.html_safe? ? title : h(title)
9
+ action_icon(:info, '#', title, {tooltip: title})
9
10
  end
10
11
 
11
12
  # This is just a quick wrapper to render an image tag that lives inside refinery/icons.
@@ -11,5 +11,8 @@ module Refinery
11
11
  val
12
12
  end
13
13
 
14
+ def translated_field(record, field)
15
+ Refinery::TranslatedFieldPresenter.new(record).call(field)
16
+ end
14
17
  end
15
18
  end
@@ -15,7 +15,7 @@ module Refinery
15
15
  end
16
16
 
17
17
  def method_missing(method, *args)
18
- if @model.respond_to? method
18
+ if @model.respond_to? method, include_all = true
19
19
  @model.send method
20
20
  elsif DEFAULT_FIELDS.has_key? method
21
21
  (value = DEFAULT_FIELDS[method]).is_a?(Proc) ? value.call(self) : value
@@ -24,8 +24,8 @@ module Refinery
24
24
  end
25
25
  end
26
26
 
27
- def respond_to?(method)
28
- super || @model.respond_to?(method) || DEFAULT_FIELDS.has_key?(method)
27
+ def respond_to?(method, include_all = false)
28
+ super || @model.respond_to?(method, include_all) || DEFAULT_FIELDS.has_key?(method)
29
29
  end
30
30
 
31
31
  end
@@ -0,0 +1,15 @@
1
+ module Refinery
2
+ class TranslatedFieldPresenter
3
+ def initialize(record)
4
+ @record = record
5
+ end
6
+
7
+ def call(field)
8
+ record.send(field).presence ||
9
+ record.translations.detect {|t| t.send(field).present?}.send(field)
10
+ end
11
+
12
+ private
13
+ attr_accessor :record
14
+ end
15
+ end
@@ -1,6 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <%= render '/refinery/html_tag' %>
3
- <% content_for :meta, "<meta refinerycms='#{Refinery.version}' />".html_safe %>
3
+ <% content_for :meta, tag(:meta, name: 'refinerycms', content: Refinery.version) %>
4
4
  <%= render 'refinery/admin/head' %>
5
5
  <body class="<%= action_name %> <%= I18n.locale %>">
6
6
  <%= render '/refinery/site_bar' %>
@@ -1,8 +1,8 @@
1
1
  <meta charset='<%= Rails.application.config.encoding %>' />
2
2
  <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><![endif]-->
3
3
  <title><%= browser_title(yield(:title)) %></title>
4
- <%= raw %(<meta name="description" content="#{@meta.meta_description}" />) if @meta.meta_description.present? -%>
5
- <%= raw %(<link rel="canonical" href="#{request.protocol}#{request.host_with_port}#{@canonical}" />) if @canonical.present? -%>
4
+ <%= tag(:meta, name: 'description', content: @meta.meta_description) if @meta.meta_description.present? -%>
5
+ <%= tag(:link, href: request.protocol+request.host_with_port+@canonical, rel: 'canonical') if @canonical.present? -%>
6
6
  <%= csrf_meta_tags if Refinery::Core.authenticity_token_on_frontend -%>
7
7
  <%= yield :meta %>
8
8
 
@@ -37,7 +37,7 @@ en:
37
37
  delete: Remove
38
38
  close: Close
39
39
  image_picker:
40
- none_selected: There is currently no image selected, please click here to add one.
40
+ none_selected: No image selected, please click here to add one.
41
41
  remove_current: Remove current image
42
42
  change: Click here to pick an image
43
43
  show: Show
@@ -55,6 +55,7 @@ en:
55
55
  results_for_html: "Search results for &#8216;<em>%{query}</em>&#8217;"
56
56
  no_results: 'Sorry, no results found'
57
57
  cancel_search: 'Cancel search'
58
+ search_input_notice: ''
58
59
  input:
59
60
  placeholder: "Search &#8230;"
60
61
  help: 'Enter a word or phrase you want to search for'
@@ -41,6 +41,8 @@ nl:
41
41
  remove_current: "Huidige afbeelding verwijderen"
42
42
  change: Klik hier om een afbeelding te kiezen
43
43
  show: Tonen
44
+ locale_picker:
45
+ language: Taal
44
46
  resource_picker:
45
47
  download_current: "Huidig bestand downloaden"
46
48
  opens_in_new_window: Opent in een nieuw venster
@@ -52,6 +54,11 @@ nl:
52
54
  button_text: Zoeken
53
55
  results_for_html: "Zoekresultaten voor &#8216;<em>%{query}</em>&#8217;"
54
56
  no_results: "Excuses, geen resultaten gevonden"
57
+ cancel_search: 'Stop met zoeken'
58
+ search_input_notice: ''
59
+ input:
60
+ placeholder: "Zoek &#8230;"
61
+ help: 'Vul een woord ofz in in waar je op wil zoeken'
55
62
  delete:
56
63
  message: Weet u zeker dat u '%{title}' wilt verwijderen?
57
64
  error_messages:
File without changes
@@ -20,5 +20,5 @@ Additional Supported Field Types
20
20
  resource - link to a resource picker dialogue
21
21
 
22
22
  Examples:
23
- rails generate refinery:engine product title:string description:text image:image brochure:resource
23
+ rails generate refinery:engine product title:string description:text image:image brochure:resource --authors 'John Jones'
24
24
  rails generate refinery:engine product title:string description:text image:image brochure:resource --i18n title description
@@ -1,25 +1,29 @@
1
1
  <% title_attribute = (title = attributes.detect { |a| a.type.to_s == "string" }).present? ? title.name : 'title' -%>
2
2
  <li class='clearfix record <%%= cycle("on", "on-hover") %>' id="<%%= dom_id(<%= singular_name %>) -%>">
3
3
  <span class='title'>
4
- <%%= <%= singular_name %>.<%= title_attribute %> %>
4
+ <% if localized? %><%%= translated_field(<%= singular_name %>, :<%= title_attribute %>) %><% else %><%%= <%= singular_name %>.<%= title_attribute %> %><% end %>
5
+ </span>
5
6
  <% if localized? %>
6
- <%% if Refinery::I18n.frontend_locales.many? %>
7
- <span class='preview'>
8
- <%% <%= singular_name %>.translations.each do |translation| %>
9
- <%% if translation.<%= title_attribute %>.present? %>
10
- <%%= link_to refinery_icon_tag("flags/#{translation.locale}.png", :size => '16x11'),
11
- refinery.edit_<%= namespacing.underscore %>_admin_<%= singular_name %>_path(<%= singular_name %>, :switch_locale => translation.locale),
12
- :class => 'locale' %>
7
+ <%% if Refinery::I18n.frontend_locales.many? %>
8
+ <span class='locales'>
9
+ <%% <%= singular_name %>.translations.sort_by{ |t| Refinery::I18n.frontend_locales.index(t.locale)}.each do |translation| %>
10
+ <%% if translation.<%= title_attribute %>.present? %>
11
+ <%%= link_to refinery.edit_<%= namespacing.underscore %>_admin_<%= singular_name %>_path(<%= singular_name %>, :switch_locale => translation.locale),
12
+ class: 'locale', title: translation.locale.upcase do %>
13
+
14
+ <div class="<%%=translation.locale %> locale_marker">
15
+ <%%= locale_text_icon(translation.locale.upcase) %>
16
+ </div>
13
17
  <%% end %>
14
18
  <%% end %>
15
- </span>
16
- <%% end %>
19
+ <%% end %>
20
+ </span>
21
+ <%% end %>
17
22
  <% end %>
18
- </span>
23
+ <span class='preview'></span>
24
+
19
25
  <span class='actions'>
20
- <% unless skip_frontend? %>
21
- <%%= action_icon(:preview, refinery.<%= namespacing.underscore %>_<%= singular_name %>_path(<%= singular_name %>), t('.view_live_html')) %>
22
- <%end %>
26
+ <% unless skip_frontend? %><%%= action_icon(:preview, refinery.<%= namespacing.underscore %>_<%= singular_name %>_path(<%= singular_name %>), t('.view_live_html')) %><%end %>
23
27
  <%%= action_icon(:edit, refinery.edit_<%= namespacing.underscore %>_admin_<%= singular_name %>_path(<%= singular_name %>), t('.edit') ) %>
24
28
  <%%= action_icon(:delete, refinery.<%= namespacing.underscore %>_admin_<%= singular_name %>_path(<%= singular_name %>), t('.delete'),
25
29
  { class: "cancel confirm-delete",
@@ -14,7 +14,7 @@ Refinery::I18n.frontend_locales.each do |lang|
14
14
  menu_match: "^#{url}(\/|\/.+?|)$"
15
15
  ) do |page|
16
16
  Refinery::Pages.default_parts.each_with_index do |part, index|
17
- page.parts.build title: part, body: nil, position: index
17
+ page.parts.build title: part[:title], slug: part[:slug], body: nil, position: index
18
18
  end
19
19
  end if defined?(Refinery::Page)
20
20
  <% end -%>
@@ -7,6 +7,7 @@ Gem::Specification.new do |s|
7
7
  s.description = 'Ruby on Rails <%= extension_plural_name.titleize %> extension for Refinery CMS'
8
8
  s.date = '<%= Time.now.strftime('%Y-%m-%d') %>'
9
9
  s.summary = '<%= extension_plural_name.titleize %> extension for Refinery CMS'
10
+ s.authors = <%= extension_authors %>
10
11
  s.require_paths = %w(lib)
11
12
  s.files = Dir["{app,config,db,lib}/**/*"] + ["readme.md"]
12
13
 
@@ -17,7 +17,6 @@ Rails.backtrace_cleaner.remove_silencers!
17
17
 
18
18
  RSpec.configure do |config|
19
19
  config.mock_with :rspec
20
- config.treat_symbols_as_metadata_keys_with_true_values = true
21
20
  config.filter_run :focus => true
22
21
  config.run_all_when_everything_filtered = true
23
22
  end
data/lib/refinery.rb CHANGED
@@ -2,6 +2,7 @@ require 'rails' # from railties
2
2
  require 'active_record'
3
3
  require 'action_controller'
4
4
  require 'rbconfig'
5
+ require 'font-awesome-sass'
5
6
 
6
7
  module Refinery
7
8
  require 'refinery/errors'
@@ -11,7 +11,7 @@ module Refinery
11
11
  :current_refinery_user,
12
12
  :authorisation_manager, :authorization_manager
13
13
 
14
- base.protect_from_forgery # See ActionController::RequestForgeryProtection
14
+ base.protect_from_forgery with: :exception # See ActionController::RequestForgeryProtection
15
15
 
16
16
  base.send :include, Refinery::Crud # basic create, read, update and delete methods
17
17
 
@@ -36,7 +36,7 @@ module Refinery
36
36
  # Wrap errors in spans
37
37
  config.to_prepare do
38
38
  ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
39
- "<span class=\"fieldWithErrors\">#{html_tag}</span>".html_safe
39
+ ActionController::Base.helpers.content_tag(:span, html_tag, class: "fieldWithErrors")
40
40
  end
41
41
  end
42
42
 
data/lib/refinery/crud.rb CHANGED
@@ -227,7 +227,7 @@ module Refinery
227
227
  :create_or_update_successful,
228
228
  :create_or_update_unsuccessful,
229
229
  :merge_position_into_params!
230
- )
230
+ ), __FILE__, __LINE__
231
231
 
232
232
  # Methods that are only included when this controller is searchable.
233
233
  if options[:searchable]
@@ -239,7 +239,7 @@ module Refinery
239
239
 
240
240
  render_partial_response?
241
241
  end
242
- )
242
+ ), __FILE__, __LINE__
243
243
  else
244
244
  module_eval %(
245
245
  def index
@@ -251,7 +251,7 @@ module Refinery
251
251
 
252
252
  render_partial_response?
253
253
  end
254
- )
254
+ ), __FILE__, __LINE__
255
255
  end
256
256
 
257
257
  else
@@ -262,14 +262,14 @@ module Refinery
262
262
 
263
263
  render_partial_response?
264
264
  end
265
- )
265
+ ), __FILE__, __LINE__
266
266
  else
267
267
  module_eval %(
268
268
  def index
269
269
  find_all_#{plural_name}
270
270
  render_partial_response?
271
271
  end
272
- )
272
+ ), __FILE__, __LINE__
273
273
  end
274
274
 
275
275
  end
@@ -333,7 +333,7 @@ module Refinery
333
333
  end
334
334
 
335
335
  protected :after_update_positions
336
- )
336
+ ), __FILE__, __LINE__
337
337
  end
338
338
 
339
339
  module_eval %(
@@ -351,7 +351,7 @@ module Refinery
351
351
  #{options[:searchable]}
352
352
  end
353
353
  end
354
- )
354
+ ), __FILE__, __LINE__
355
355
 
356
356
  end
357
357
 
@@ -6,6 +6,7 @@ module Refinery
6
6
  argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
7
7
 
8
8
  class_option :namespace, :type => :string, :default => nil, :banner => 'NAMESPACE', :required => false
9
+ class_option :authors, :type => :array, :default => [], :banner => 'author author', :required => false, :desc => 'Indicates authors of this extension'
9
10
  class_option :extension, :type => :string, :default => nil, :banner => 'ENGINE', :required => false
10
11
  class_option :i18n, :type => :array, :default => [], :required => false, :banner => "field field", :desc => 'Indicates generated fields'
11
12
  class_option :install, :type => :boolean, :default => false, :required => false, :banner => nil, :desc => 'Bundles and runs the generated generator, rake db:migrate, rake db:seed for you'
@@ -33,6 +34,10 @@ module Refinery
33
34
  @extension_name ||= options[:extension].presence || singular_name
34
35
  end
35
36
 
37
+ def extension_authors
38
+ @extension_authors ||= options[:authors].presence
39
+ end
40
+
36
41
  def extension_class_name
37
42
  @extension_class_name ||= extension_name.camelize
38
43
  end
@@ -2,7 +2,7 @@ module Refinery
2
2
  class Version
3
3
  @major = 3
4
4
  @minor = 0
5
- @tiny = 1
5
+ @tiny = 2
6
6
  @build = nil
7
7
 
8
8
  class << self
data/license.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright (c) 2005 [Resolve Digital](http://resolve.digital)
3
+ Copyright (c) 2005 [Resolve Digital](https://resolve.digital)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -30,6 +30,7 @@ Gem::Specification.new do |s|
30
30
  s.add_dependency 'truncate_html', '~> 0.9'
31
31
  s.add_dependency 'will_paginate', '~> 3.0.2'
32
32
  s.add_dependency 'sass-rails', '>= 4.0', '< 5.1'
33
+ s.add_dependency 'font-awesome-sass', '>= 4.3.0', '< 5.0'
33
34
  s.add_dependency 'coffee-rails', ['~> 4.0', '>= 4.0.0']
34
35
  s.add_dependency 'jquery-rails', '>= 2.3.0'
35
36
  s.add_dependency 'jquery-ui-rails', '~> 5.0.0'
@@ -10,5 +10,34 @@ module Refinery
10
10
  end
11
11
  end
12
12
 
13
+ describe "#translated_field" do
14
+ let(:page) { FactoryGirl.build(:page) }
15
+
16
+ before do
17
+ Globalize.with_locale(:en) do
18
+ page.title = "draft"
19
+ page.save!
20
+ end
21
+
22
+ Globalize.with_locale(:lv) do
23
+ page.title = "melnraksts"
24
+ page.save!
25
+ end
26
+ end
27
+
28
+ context "when title is present" do
29
+ it "returns it" do
30
+ expect(helper.translated_field(page, :title)).to eq("draft")
31
+ end
32
+ end
33
+
34
+ context "when title for current locale isn't available" do
35
+ it "returns existing title from translations" do
36
+ Page.translation_class.where(locale: :en).first.destroy
37
+ expect(helper.translated_field(page, :title)).to eq("melnraksts")
38
+ end
39
+ end
40
+ end
41
+
13
42
  end
14
- end
43
+ end
@@ -0,0 +1,90 @@
1
+ require 'spec_helper'
2
+ require 'generator_spec/test_case'
3
+ require 'generators/refinery/engine/engine_generator'
4
+
5
+ module Refinery
6
+ describe EngineGenerator do
7
+ include GeneratorSpec::TestCase
8
+ destination File.expand_path("../../../../../../tmp", __FILE__)
9
+
10
+ before do
11
+ prepare_destination
12
+ run_generator %w{ rspec_product_test title:string description:text image:image brochure:resource --authors Author1 Author2 }
13
+ end
14
+
15
+ it "uses reference columns for image and resource attributes" do
16
+ File.open("#{destination_root}/vendor/extensions/rspec_product_tests/refinerycms-rspec_product_tests.gemspec") do |file|
17
+ content = file.read
18
+ expect(content.include?('["Author1", "Author2"]')).to be_truthy
19
+ end
20
+ end
21
+
22
+ specify do
23
+ expect(destination_root).to have_structure {
24
+ directory "vendor" do
25
+ directory "extensions" do
26
+ directory "rspec_product_tests" do
27
+ directory "app" do
28
+ directory "controllers" do
29
+ directory "refinery" do
30
+ directory "rspec_product_tests" do
31
+ directory "admin" do
32
+ file "rspec_product_tests_controller.rb"
33
+ end
34
+ file "rspec_product_tests_controller.rb"
35
+ end
36
+ end
37
+ end
38
+ directory "models" do
39
+ directory "refinery" do
40
+ directory "rspec_product_tests" do
41
+ file "rspec_product_test.rb"
42
+ end
43
+ end
44
+ end
45
+ directory "views" do
46
+ directory "refinery" do
47
+ directory "rspec_product_tests" do
48
+ directory "admin" do
49
+ directory "rspec_product_tests" do
50
+ file "_form.html.erb"
51
+ file "_sortable_list.html.erb"
52
+ file "edit.html.erb"
53
+ file "index.html.erb"
54
+ file "new.html.erb"
55
+ file "_rspec_product_test.html.erb"
56
+ end
57
+ end
58
+ directory "rspec_product_tests" do
59
+ file "index.html.erb"
60
+ file "show.html.erb"
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ directory "lib" do
67
+ file "refinerycms-rspec_product_tests.rb"
68
+ end
69
+ directory "spec" do
70
+ file "spec_helper.rb"
71
+ end
72
+ directory "tasks" do
73
+ file "testing.rake"
74
+ file "rspec.rake"
75
+ end
76
+ directory "config" do
77
+ directory "locales" do
78
+ file "en.yml"
79
+ end
80
+ file "routes.rb"
81
+ end
82
+ file "Gemfile"
83
+ file "Rakefile"
84
+ end
85
+ end
86
+ end
87
+ }
88
+ end
89
+ end
90
+ end