refinerycms 0.9.6.5 → 0.9.6.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. data/VERSION +1 -1
  2. data/app/controllers/application.rb +1 -1
  3. data/app/controllers/application_controller.rb +1 -1
  4. data/config/environment.rb +2 -2
  5. data/config/environments/development.rb +1 -1
  6. data/config/environments/production.rb +1 -1
  7. data/config/preinitializer.rb +1 -1
  8. data/db/migrate/20100114092849_add_themes_table.rb +12 -12
  9. data/db/migrate/20100202034802_remove_custom_title_image_id_and_image_id_from_pages.rb +6 -6
  10. data/db/schema.rb +1 -1
  11. data/db/seeds.rb +2 -2
  12. data/lib/refinery_initializer.rb +1 -1
  13. data/public/javascripts/refinery/admin.js +61 -61
  14. data/readme.md +3 -3
  15. data/test/files/The world!.gif +0 -0
  16. data/test/files/car-wallpapers19.jpg +0 -0
  17. data/test/fixtures/images.yml +14 -0
  18. data/test/test_helper.rb +1 -1
  19. data/test/unit/image_test.rb +19 -8
  20. data/test/unit/page_part_test.rb +11 -11
  21. data/test/unit/page_test.rb +125 -125
  22. data/vendor/plugins/authentication/app/controllers/users_controller.rb +20 -20
  23. data/vendor/plugins/authentication/app/models/user.rb +5 -5
  24. data/vendor/plugins/authentication/app/views/user_mailer/reset_notification.html.erb +2 -2
  25. data/vendor/plugins/authentication/app/views/users/forgot.html.erb +1 -1
  26. data/vendor/plugins/authentication/app/views/users/reset.html.erb +2 -2
  27. data/vendor/plugins/authentication/config/routes.rb +4 -4
  28. data/vendor/plugins/dashboard/app/helpers/admin/dashboard_helper.rb +1 -1
  29. data/vendor/plugins/dashboard/app/views/admin/dashboard/_recent_activity.html.erb +1 -1
  30. data/vendor/plugins/dashboard/rails/init.rb +1 -1
  31. data/vendor/plugins/images/app/models/image.rb +14 -14
  32. data/vendor/plugins/images/app/views/admin/images/_form.html.erb +1 -8
  33. data/vendor/plugins/images/app/views/admin/images/insert.html.erb +1 -1
  34. data/vendor/plugins/inquiries/app/views/admin/inquiries/_inquiry.html.erb +3 -3
  35. data/vendor/plugins/inquiries/app/views/inquiries/new.html.erb +1 -1
  36. data/vendor/plugins/inquiries/app/views/inquiries/thank_you.html.erb +1 -1
  37. data/vendor/plugins/news/app/controllers/admin/news_items_controller.rb +1 -1
  38. data/vendor/plugins/news/app/controllers/news_items_controller.rb +1 -1
  39. data/vendor/plugins/news/app/views/news_items/index.html.erb +1 -1
  40. data/vendor/plugins/news/app/views/news_items/show.html.erb +1 -1
  41. data/vendor/plugins/pages/app/controllers/admin/pages_controller.rb +1 -1
  42. data/vendor/plugins/pages/app/models/page.rb +42 -42
  43. data/vendor/plugins/pages/app/models/page_part.rb +1 -1
  44. data/vendor/plugins/pages/app/presenters/page_presenter.rb +1 -1
  45. data/vendor/plugins/pages/app/views/admin/page_dialogs/_page_link.html.erb +1 -1
  46. data/vendor/plugins/pages/app/views/admin/pages/_form.html.erb +1 -1
  47. data/vendor/plugins/pages/app/views/admin/pages/_list.html.erb +1 -1
  48. data/vendor/plugins/pages/app/views/admin/pages/_page_part_field.html.erb +1 -1
  49. data/vendor/plugins/pages/app/views/pages/home.html.erb +1 -1
  50. data/vendor/plugins/pages/app/views/pages/show.html.erb +1 -1
  51. data/vendor/plugins/pages/rails/init.rb +5 -5
  52. data/vendor/plugins/rails_indexes/lib/indexer.rb +49 -47
  53. data/vendor/plugins/rails_indexes/tasks/indexer.rake +5 -3
  54. data/vendor/plugins/rails_indexes/test/fixtures/app/controllers/users_controller.rb +3 -3
  55. data/vendor/plugins/rails_indexes/test/fixtures/app/models/address.rb +2 -2
  56. data/vendor/plugins/rails_indexes/test/fixtures/app/models/company.rb +4 -4
  57. data/vendor/plugins/rails_indexes/test/fixtures/app/models/country.rb +1 -1
  58. data/vendor/plugins/rails_indexes/test/fixtures/app/models/freelancer.rb +1 -1
  59. data/vendor/plugins/rails_indexes/test/fixtures/app/models/gift.rb +4 -4
  60. data/vendor/plugins/rails_indexes/test/fixtures/app/models/god.rb +1 -1
  61. data/vendor/plugins/rails_indexes/test/fixtures/app/models/user.rb +7 -6
  62. data/vendor/plugins/rails_indexes/test/fixtures/app/sweepers/user_sweeper.rb +1 -1
  63. data/vendor/plugins/rails_indexes/test/fixtures/schema.rb +9 -9
  64. data/vendor/plugins/rails_indexes/test/rails_indexes_test.rb +18 -18
  65. data/vendor/plugins/refinery/app/views/admin/_head.html.erb +1 -1
  66. data/vendor/plugins/refinery/app/views/layouts/application.html.erb +1 -1
  67. data/vendor/plugins/refinery/app/views/shared/_content_page.html.erb +1 -1
  68. data/vendor/plugins/refinery/app/views/shared/_head.html.erb +1 -1
  69. data/vendor/plugins/refinery/app/views/shared/_header.html.erb +1 -1
  70. data/vendor/plugins/refinery/app/views/shared/_menu.html.erb +1 -1
  71. data/vendor/plugins/refinery/app/views/shared/_menu_branch.html.erb +5 -5
  72. data/vendor/plugins/refinery/app/views/shared/_submenu.html.erb +1 -1
  73. data/vendor/plugins/refinery/app/views/shared/admin/_continue_editing.html.erb +1 -1
  74. data/vendor/plugins/refinery/app/views/shared/admin/_error_messages_for.html.erb +1 -1
  75. data/vendor/plugins/refinery/app/views/shared/admin/_form_actions.html.erb +1 -1
  76. data/vendor/plugins/refinery/app/views/shared/admin/_image_picker.html.erb +27 -13
  77. data/vendor/plugins/refinery/app/views/shared/admin/_resource_picker.html.erb +1 -1
  78. data/vendor/plugins/refinery/app/views/shared/admin/_search.html.erb +1 -1
  79. data/vendor/plugins/refinery/app/views/shared/admin/_sortable_list.html.erb +1 -1
  80. data/vendor/plugins/refinery/lib/generators/refinery/templates/model.rb +1 -1
  81. data/vendor/plugins/refinery/lib/generators/refinery/templates/public_controller.rb +1 -1
  82. data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/_sortable_list.html.erb +1 -1
  83. data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/index.html.erb +2 -2
  84. data/vendor/plugins/refinery/lib/generators/refinery/templates/views/index.html.erb +1 -1
  85. data/vendor/plugins/refinery/lib/generators/refinery/templates/views/show.html.erb +1 -1
  86. data/vendor/plugins/refinery/lib/refinery/activity.rb +1 -1
  87. data/vendor/plugins/refinery/lib/refinery/application_controller.rb +4 -4
  88. data/vendor/plugins/refinery/lib/refinery/application_helper.rb +1 -1
  89. data/vendor/plugins/refinery/lib/refinery/base_presenter.rb +1 -1
  90. data/vendor/plugins/refinery/lib/refinery/initializer.rb +1 -1
  91. data/vendor/plugins/refinery_dialogs/app/controllers/admin/dialogs_controller.rb +1 -1
  92. data/vendor/plugins/resources/app/models/resource.rb +8 -8
  93. data/vendor/plugins/resources/app/views/admin/resources/_form.html.erb +1 -1
  94. data/vendor/plugins/resources/app/views/admin/resources/index.html.erb +1 -1
  95. data/vendor/plugins/resources/app/views/admin/resources/insert.html.erb +1 -1
  96. data/vendor/plugins/resources/config/routes.rb +2 -2
  97. data/vendor/plugins/resources/rails/init.rb +1 -1
  98. data/vendor/plugins/themes/app/controllers/admin/themes_controller.rb +17 -17
  99. data/vendor/plugins/themes/app/models/theme.rb +40 -40
  100. data/vendor/plugins/themes/app/views/admin/themes/_form.html.erb +1 -1
  101. data/vendor/plugins/themes/config/routes.rb +2 -2
  102. data/vendor/plugins/themes/lib/theme_server.rb +26 -0
  103. data/vendor/plugins/themes/rails/init.rb +3 -1
  104. metadata +6 -3
  105. data/vendor/plugins/themes/app/controllers/themes_controller.rb +0 -45
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.6.5
1
+ 0.9.6.6
@@ -1,3 +1,3 @@
1
1
  # This file is here to support web servers who load Rails in the old fashion e.g. some builds of Phusion Passenger.
2
2
  # This will simply load the application controller using the new style if this file is ever loaded.
3
- require_dependency 'application_controller'
3
+ require_dependency 'application_controller'
@@ -4,4 +4,4 @@
4
4
  # You can extend refinery with your own functions here and they will likely not get overriden in an update.
5
5
 
6
6
  class ApplicationController < Refinery::ApplicationController
7
- end
7
+ end
@@ -64,7 +64,7 @@ eval("#{(defined? Refinery::Initializer) ? Refinery : Rails}::Initializer").run
64
64
 
65
65
  #===REFINERY REQUIRED GEMS===
66
66
  config.gem "rake", :version => ">= 0.8.3", :lib => "rake"
67
- config.gem "rubyzip", :version => ">= 0.9.1", :lib => "zip/zip"
67
+ config.gem "rubyzip", :version => ">= 0.9.1", :lib => "zip/zip"
68
68
  config.gem "friendly_id", :version => ">= 2.2.2", :lib => "friendly_id"
69
69
  config.gem "will_paginate", :version => ">= 2.3.11", :lib => "will_paginate", :source => "http://gemcutter.org"
70
70
  config.gem "rails", :version => ">= 2.3.5", :lib => "rails"
@@ -72,4 +72,4 @@ eval("#{(defined? Refinery::Initializer) ? Refinery : Rails}::Initializer").run
72
72
  config.gem "slim_scrooge", :version => ">= 1.0.3", :lib => "slim_scrooge", :source => "http://gemcutter.org" unless RUBY_PLATFORM =~ /mswin|mingw/ # kill gem when windows is running.
73
73
  config.gem "hpricot", :version => ">= 0.8.1", :lib => "hpricot", :source => "http://gemcutter.org"
74
74
  #===REFINERY END OF REQUIRED GEMS===
75
- end
75
+ end
@@ -23,4 +23,4 @@ config.action_mailer.raise_delivery_errors = false
23
23
  # ::ActiveSupport::Dependencies.load_once_paths = ::ActiveSupport::Dependencies.load_once_paths.select do |path|
24
24
  # (path =~ /app/).nil?
25
25
  # end
26
- #end
26
+ #end
@@ -24,4 +24,4 @@ config.log_level = :warn
24
24
  # Set to true in order to use Amazon's Simple Storage Service on your production machine
25
25
  # instead of the default file system for resources and images
26
26
  # Make sure to your bucket info is correct in amazon_s3.yml
27
- USE_S3_BACKEND = false
27
+ USE_S3_BACKEND = false
@@ -25,4 +25,4 @@ REFINERY_ROOT = Rails.root.to_s unless defined? REFINERY_ROOT
25
25
 
26
26
  # Set to true in your environment specific file (e.g. production.rb) to use Amazon's Simple
27
27
  # Storage Service instead of the default file system for resources and images
28
- USE_S3_BACKEND = false unless defined?(USE_S3_BACKEND)
28
+ USE_S3_BACKEND = false unless defined?(USE_S3_BACKEND)
@@ -1,19 +1,19 @@
1
1
  class AddThemesTable < ActiveRecord::Migration
2
-
2
+
3
3
  def self.up
4
- create_table "themes", :force => true do |t|
5
- t.integer "size"
6
- t.string "content_type"
7
- t.string "filename"
8
- t.string "title"
9
- t.text "description"
10
- t.text "license"
11
- t.timestamps
12
- end
4
+ create_table "themes", :force => true do |t|
5
+ t.integer "size"
6
+ t.string "content_type"
7
+ t.string "filename"
8
+ t.string "title"
9
+ t.text "description"
10
+ t.text "license"
11
+ t.timestamps
12
+ end
13
13
  end
14
14
 
15
15
  def self.down
16
- drop_table :themes
16
+ drop_table :themes
17
17
  end
18
18
 
19
- end
19
+ end
@@ -1,13 +1,13 @@
1
1
  class RemoveCustomTitleImageIdAndImageIdFromPages < ActiveRecord::Migration
2
-
2
+
3
3
  def self.up
4
- remove_column :pages, :custom_title_image_id
5
- remove_column :pages, :image_id
4
+ remove_column :pages, :custom_title_image_id
5
+ remove_column :pages, :image_id
6
6
  end
7
7
 
8
8
  def self.down
9
- add_column :pages, :custom_title_image_id, :integer
10
- add_column :pages, :image_id, :integer
9
+ add_column :pages, :custom_title_image_id, :integer
10
+ add_column :pages, :image_id, :integer
11
11
  end
12
12
 
13
- end
13
+ end
@@ -1,4 +1,4 @@
1
- # This file is auto-generated from the current state of the database. Instead of editing this file,
1
+ # This file is auto-generated from the current state of the database. Instead of editing this file,
2
2
  # please use the migrations feature of Active Record to incrementally modify your database, and
3
3
  # then regenerate this schema definition.
4
4
  #
@@ -3,7 +3,7 @@
3
3
  {:name => "activity_show_limit", :value => 18},
4
4
  {:name => "preferred_image_view", :value => :grid},
5
5
  {:name => "analytics_page_code", :value => "UA-xxxxxx-x"},
6
- {:name => "theme", :value => "demolicious"},
6
+ {:name => "theme", :value => "demolicious"},
7
7
  {:name => "image_thumbnails", :value => {
8
8
  :dialog_thumb => 'c106x106',
9
9
  :grid => 'c135x135',
@@ -126,4 +126,4 @@ Dir[File.join(%W(#{REFINERY_ROOT} themes *.zip))].each do |theme|
126
126
  "filename" => theme.split('/').last,
127
127
  'tempfile' => File.open(theme)
128
128
  }).read_theme
129
- end
129
+ end
@@ -6,4 +6,4 @@ unless REFINERY_ROOT == RAILS_ROOT # e.g. only if we're in a gem.
6
6
 
7
7
  require 'refinery'
8
8
  require 'refinery/initializer'
9
- end
9
+ end
@@ -225,13 +225,9 @@ var link_dialog = {
225
225
  $('.link_list li').click(function(e){
226
226
  e.preventDefault();
227
227
 
228
- remove_linked_class();
228
+ $('.link_list li.linked').removeClass('linked');
229
229
  $(this).addClass('linked');
230
230
 
231
- function remove_linked_class(){
232
- $('.link_list li.linked').removeClass('linked');
233
- }
234
-
235
231
  var link = $(this).children('a.page_link').get(0);
236
232
  var port = (window.location.port.length > 0 ? (":" + window.location.port) : "");
237
233
  var url = link.href.replace(window.location.protocol + "//" + window.location.hostname + port, "");
@@ -441,14 +437,17 @@ var page_options = {
441
437
  }
442
438
 
443
439
  var image_dialog = {
444
- init: function(){
440
+ callback: null
441
+
442
+ , init: function(callback){
443
+ this.callback = callback;
445
444
  this.init_tabs();
446
445
  this.init_select();
447
- this.init_submit();
448
- this.init_close();
449
- },
446
+ this.init_actions();
447
+ return this;
448
+ }
450
449
 
451
- init_tabs: function(){
450
+ , init_tabs: function(){
452
451
  var radios = $('#dialog_menu_left input:radio');
453
452
  var selected = radios.parent().filter(".selected_radio").find('input:radio').first() || radios.first();
454
453
 
@@ -458,16 +457,16 @@ var image_dialog = {
458
457
 
459
458
  selected.attr('checked', 'true');
460
459
  link_dialog.switch_area(selected);
461
- },
460
+ }
462
461
 
463
- switch_area: function(radio){
462
+ , switch_area: function(radio){
464
463
  $('#dialog_menu_left .selected_radio').removeClass('selected_radio');
465
464
  $(radio).parent().addClass('selected_radio');
466
465
  $('#dialog_main .dialog_area').hide();
467
466
  $('#' + radio.value + '_area').show();
468
- },
467
+ }
469
468
 
470
- init_select: function(){
469
+ , init_select: function(){
471
470
  $('#existing_image_area_content ul li img').click(function(){
472
471
  image_dialog.set_image(this);
473
472
  });
@@ -475,9 +474,9 @@ var image_dialog = {
475
474
  if ((selected_image = $('#existing_image_area_content ul li.selected img')).length > 0) {
476
475
  image_dialog.set_image(selected_image.first());
477
476
  }
478
- },
477
+ }
479
478
 
480
- set_image: function(img){
479
+ , set_image: function(img){
481
480
  if ($(img).length > 0) {
482
481
  $('#existing_image_area_content ul li.selected').removeClass('selected');
483
482
 
@@ -499,39 +498,38 @@ var image_dialog = {
499
498
  }
500
499
  catch(e){}
501
500
  }
502
- },
503
-
504
- init_submit: function(){
505
- $('#dialog-form-actions #submit_button').click(function(e){
506
- e.preventDefault();
507
- if(img_selected = $('#existing_image_area_content ul li.selected img').get(0)) {
508
- parent.image_picker.changed(img_selected);
509
- }
501
+ }
510
502
 
511
- if(parent && typeof(parent.tb_remove) == "function"){
512
- parent.tb_remove();
513
- }
514
- });
503
+ , submit_image_choice: function(e) {
504
+ e.preventDefault();
505
+ if((img_selected = $('#existing_image_area_content ul li.selected img').get(0)) && typeof(this.callback) == "function") {
506
+ this.callback(img_selected);
507
+ }
515
508
 
516
- $('#dialog-form-actions #cancel_button').click(function(e){
517
- e.preventDefault();
509
+ if(parent && typeof(parent.tb_remove) == "function"){
518
510
  parent.tb_remove();
519
- });
520
- },
511
+ }
521
512
 
522
- init_close: function(){
523
- $('#TB_title .close_dialog, #dialog_container .close_dialog').click(function(e) {
524
- e.preventDefault();
513
+ }
525
514
 
526
- // if we're in a frame
527
- if(parent && typeof(parent.tb_remove) == "function"){
528
- parent.tb_remove();
515
+ , cancel_image_dialog: function(e) {
516
+ e.preventDefault();
517
+ // if we're in a frame
518
+ if(parent && typeof(parent.tb_remove) == "function"){
519
+ parent.tb_remove();
529
520
 
530
- } // if we're not in a frame
531
- else if(typeof(tb_remove) == 'function'){
532
- tb_remove();
533
- }
534
- });
521
+ } // if we're not in a frame
522
+ else if(typeof(tb_remove) == 'function'){
523
+ tb_remove();
524
+ }
525
+ }
526
+
527
+ , init_actions: function(){
528
+ var _this = this;
529
+ $('#dialog-form-actions #submit_button').click($.proxy(_this.submit_image_choice, _this));
530
+ $('#dialog-form-actions #cancel_button, #TB_title .close_dialog, #dialog_container .close_dialog').click(
531
+ $.proxy(_this.cancel_image_dialog, _this)
532
+ );
535
533
  }
536
534
  }
537
535
 
@@ -600,43 +598,45 @@ var list_reorder = {
600
598
  var image_picker = {
601
599
  options: {
602
600
  selected: '',
603
- thumbnail: '',
604
- toggle_image_display: false
601
+ thumbnail: 'dialog_thumb',
602
+ field: '#image',
603
+ image_display: '#current_picked_image',
604
+ no_image_message: '#no_picked_image_selected',
605
+ image_container: '#current_image_container',
606
+ remove_image_button: '#remove_picked_image',
607
+ image_toggler: null
605
608
  }
606
609
 
607
610
  , init: function(new_options){
608
611
  this.options = $.extend(this.options, new_options);
609
- $('#remove_picked_image').click(function(e){
612
+ $(this.options.remove_image_button).click(function(e){
610
613
  e.preventDefault();
611
- $('#current_picked_image').removeClass('brown_border')
614
+ $(this.options.image_display).removeClass('brown_border')
612
615
  .attr({'src': '', 'width': '', 'height': ''})
613
616
  .css({'width': 'auto', 'height': 'auto'})
614
617
  .hide();
615
- $('#custom_title_field').val('');
616
- $('#no_picked_image_selected').show();
618
+ $(this.options.field).val('');
619
+ $(this.options.no_image_message).show();
617
620
  $(this).hide();
618
621
  });
619
622
 
620
- if(this.options.toggle_image_display){
621
- $('#current_image_toggler').click(function(e){
623
+ if(this.options.image_toggler != null){
624
+ $(this.options.image_toggler).click(function(e){
622
625
  $(this).html(($(this).html() == 'Show' ? 'Hide' : 'Show'));
623
- $("#current_image_container").toggle();
626
+ $(this.options.image_container).toggle();
624
627
  e.preventDefault();
625
628
  });
626
629
  }
627
630
 
628
631
  }
629
632
 
630
- , changed: function(image){
631
- var current_img = $('#current_picked_image');
632
- $('#custom_title_field').val(image.id.replace("image_", ""));
633
+ , changed: function(image) {
634
+ $(this.options.field).val(image.id.replace("image_", ""));
633
635
 
634
- if(this.options.thumbnail != ''){
635
- image.src = image.src.replace('_dialog_thumb', '_' + this.options.thumbnail);
636
- }
637
- current_img.attr('src', image.src).addClass('brown_border').show();
638
- $('#remove_picked_image').show();
639
- $('#no_picked_image_selected').hide();
636
+ image.src = image.src.replace('_dialog_thumb', '_' + this.options.thumbnail);
637
+ $(this.options.image_display).attr('src', image.src).addClass('brown_border').show();
638
+ $(this.options.remove_image_button).show();
639
+ $(this.options.no_image_message).hide();
640
640
  }
641
641
  }
642
642
 
data/readme.md CHANGED
@@ -92,7 +92,7 @@ You will be prompted to setup your first user.
92
92
  If you're using [Heroku](http://heroku.com/) you will want to put
93
93
 
94
94
  USE_S3_BACKEND = true
95
-
95
+
96
96
  in your ``config/production.rb`` file to make Refinery store files uploaded on Amazon S3.
97
97
 
98
98
  ## Updating to the latest Refinery
@@ -161,12 +161,12 @@ This will pull in all of the updated files in the project and may result in some
161
161
  Extend Refinery easily by running the Refinery generator
162
162
 
163
163
  ruby script/generate refinery
164
-
164
+
165
165
  to get help on how to use that. Or read the full documentation on [writing plugins for Refinery](http://github.com/resolve/refinerycms/blob/master/vendor/plugins/refinery/plugins.md)
166
166
 
167
167
  ### What about a portfolio?
168
168
 
169
- Check out the [portfolio plugin gem](http://github.com/resolve/portfolio)
169
+ Check out the [portfolio plugin gem](http://github.com/resolve/refinery-portfolio)
170
170
 
171
171
  ## License
172
172
 
Binary file
@@ -0,0 +1,14 @@
1
+ the_world:
2
+ content_type: image/gif
3
+ filename: The%20world!.gif
4
+ width: 614
5
+ height: 340
6
+ size: 17535
7
+ # TODO: image_type? What's that used for?
8
+
9
+ our_car:
10
+ content_type: image/jpg
11
+ filename: car-wallpapers19.jpg
12
+ width: 640
13
+ height: 300
14
+ size: 87647
@@ -16,7 +16,7 @@ class ActiveSupport::TestCase
16
16
  # don't care one way or the other, switching from MyISAM to InnoDB tables
17
17
  # is recommended.
18
18
  #
19
- # The only drawback to using transactional fixtures is when you actually
19
+ # The only drawback to using transactional fixtures is when you actually
20
20
  # need to test transactions. Since your test is bracketed by a transaction,
21
21
  # any transactions started in your code will be automatically rolled back.
22
22
  self.use_transactional_fixtures = true
@@ -2,13 +2,24 @@ require 'test_helper'
2
2
 
3
3
  class ImageTest < ActiveSupport::TestCase
4
4
 
5
- fixtures :images
5
+ fixtures :images
6
6
 
7
- def test_titles
8
- end
9
-
10
- def test_per_page
11
-
12
- end
7
+ def test_titles
8
+ assert_equal "The%20world!.gif", images(:the_world).filename
9
+ assert_equal "The World!", images(:the_world).title
13
10
 
14
- end
11
+ assert_equal "car-wallpapers19.jpg", images(:our_car).filename
12
+ assert_equal "Car Wallpapers19", images(:our_car).title
13
+ end
14
+
15
+ def test_per_page
16
+ assert_equal 18, Image.per_page(dialog = true)
17
+ assert_equal 20, Image.per_page # dialog = false
18
+ end
19
+
20
+ def test_attachment_fu_options
21
+ assert_equal 50.megabytes, Image.attachment_options[:max_size]
22
+ assert_equal 'Rmagick', Image.attachment_options[:processor]
23
+ end
24
+
25
+ end
@@ -1,19 +1,19 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class PagePartTest < ActiveSupport::TestCase
4
-
5
- fixtures :page_parts
6
-
7
- def setup
8
- @new_page_part = PagePart.new
9
- end
10
-
4
+
5
+ fixtures :page_parts
6
+
7
+ def setup
8
+ @new_page_part = PagePart.new
9
+ end
10
+
11
11
  def test_should_not_save_page_part_without_title
12
- assert !@new_page_part.save, "Saved the page part without a title"
12
+ assert !@new_page_part.save, "Saved the page part without a title"
13
13
  end
14
14
 
15
15
  def test_alias_content_body_works
16
- assert_equal page_parts(:home_page_body).body, page_parts(:home_page_body).content
17
- end
16
+ assert_equal page_parts(:home_page_body).body, page_parts(:home_page_body).content
17
+ end
18
18
 
19
- end
19
+ end