refinerycms 0.9.6.14 → 0.9.6.15
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -1
- data/Rakefile +3 -51
- data/VERSION +1 -1
- data/bin/refinery +20 -20
- data/bin/refinery-override +9 -9
- data/bin/refinery-update-core +41 -34
- data/config/application.rb +28 -87
- data/config/environment.rb +1 -4
- data/config/environments/development.rb +2 -0
- data/config/environments/production.rb +1 -1
- data/config/preinitializer.rb +2 -6
- data/db/schema.rb +1 -1
- data/db/seeds.rb +1 -1
- data/lib/refinery/tasks/refinery.rake +83 -0
- data/lib/refinery/tasks/refinery.rb +16 -0
- data/public/images/refinery/dialogLoadingAnimation.gif +0 -0
- data/public/javascripts/refinery/admin.js +9 -4
- data/public/javascripts/refinery/boot_wym.js +19 -5
- data/public/javascripts/wymeditor/jquery.refinery.wymeditor.js +72 -70
- data/public/stylesheets/refinery/refinery.css +19 -7
- data/readme.md +2 -2
- data/test/fixtures/user_plugins.yml +36 -0
- data/test/fixtures/users.yml +1 -2
- data/test/functional/dashboard_controller_test.rb +23 -3
- data/test/functional/images_controller_test.rb +93 -0
- data/test/test_helper.rb +9 -3
- data/test/unit/image_test.rb +2 -2
- data/test/unit/inquiry_test.rb +6 -6
- data/test/unit/news_items_test.rb +8 -8
- data/test/unit/refinery_setting_test.rb +12 -12
- data/test/unit/resource_test.rb +3 -3
- data/themes/demolicious/views/layouts/application.html.erb +1 -1
- data/themes/demolicious/views/pages/home.html.erb +1 -1
- data/themes/demolicious/views/pages/show.html.erb +1 -1
- data/themes/hemingway/views/layouts/application.html.erb +1 -1
- data/vendor/plugins/dashboard/app/controllers/admin/dashboard_controller.rb +1 -1
- data/vendor/plugins/dashboard/rails/init.rb +1 -1
- data/vendor/plugins/images/app/controllers/admin/images_controller.rb +2 -2
- data/vendor/plugins/images/app/helpers/admin/images_helper.rb +6 -2
- data/vendor/plugins/images/app/models/image.rb +3 -3
- data/vendor/plugins/images/app/views/admin/images/_form.html.erb +4 -4
- data/vendor/plugins/images/app/views/admin/images/index.html.erb +2 -2
- data/vendor/plugins/images/app/views/admin/images/insert.html.erb +1 -1
- data/vendor/plugins/inquiries/app/models/inquiry.rb +3 -3
- data/vendor/plugins/inquiries/app/views/admin/inquiries/show.html.erb +1 -1
- data/vendor/plugins/inquiries/rails/init.rb +1 -1
- data/vendor/plugins/news/app/controllers/admin/news_items_controller.rb +1 -1
- data/vendor/plugins/news/app/controllers/news_items_controller.rb +1 -1
- data/vendor/plugins/news/app/models/news_item.rb +2 -2
- data/vendor/plugins/news/app/views/admin/news_items/_news_item.html.erb +1 -1
- data/vendor/plugins/news/app/views/admin/news_items/edit.html.erb +1 -1
- data/vendor/plugins/pages/app/controllers/admin/pages_controller.rb +13 -0
- data/vendor/plugins/pages/app/models/page_part.rb +3 -1
- data/vendor/plugins/pages/app/views/admin/page_dialogs/_page_link.html.erb +2 -2
- data/vendor/plugins/pages/app/views/admin/pages/_form.html.erb +2 -2
- data/vendor/plugins/pages/app/views/admin/pages/_page_part_field.html.erb +1 -1
- data/vendor/plugins/refinery/app/views/admin/_head.html.erb +3 -3
- data/vendor/plugins/refinery/app/views/admin/_menu.html.erb +3 -7
- data/vendor/plugins/refinery/app/views/shared/_menu.html.erb +1 -1
- data/vendor/plugins/refinery/app/views/shared/admin/_form_actions.html.erb +5 -3
- data/vendor/plugins/refinery/app/views/shared/admin/_image_picker.html.erb +1 -1
- data/vendor/plugins/refinery/app/views/shared/admin/_resource_picker.html.erb +0 -1
- data/vendor/plugins/refinery/lib/refinery.rb +9 -2
- data/vendor/plugins/refinery/lib/refinery/application_controller.rb +1 -1
- data/vendor/plugins/refinery/lib/refinery/deprecations.rb +46 -0
- data/vendor/plugins/refinery/lib/refinery/initializer.rb +20 -9
- data/vendor/plugins/refinery_dialogs/app/controllers/admin/dialogs_controller.rb +6 -5
- data/vendor/plugins/refinery_dialogs/app/views/admin/dialogs/show.html.erb +2 -2
- data/vendor/plugins/refinery_settings/app/models/refinery_setting.rb +41 -11
- data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/_form.html.erb +1 -1
- data/vendor/plugins/resources/app/controllers/admin/resources_controller.rb +1 -1
- data/vendor/plugins/resources/app/models/resource.rb +3 -3
- data/vendor/plugins/resources/app/views/admin/resources/_form.html.erb +2 -2
- data/vendor/plugins/resources/app/views/admin/resources/insert.html.erb +2 -2
- data/vendor/plugins/themes/app/helpers/themes_helper.rb +1 -1
- data/vendor/plugins/themes/lib/theme_server.rb +1 -1
- data/vendor/plugins/themes/rails/init.rb +26 -18
- metadata +10 -20
- data/Gemfile +0 -12
- data/public/javascripts/thickbox.js +0 -350
- data/public/stylesheets/refinery/thickbox.css +0 -165
- data/vendor/cache/aasm-2.1.3.gem +0 -0
- data/vendor/cache/actionmailer-2.3.5.gem +0 -0
- data/vendor/cache/actionpack-2.3.5.gem +0 -0
- data/vendor/cache/activerecord-2.3.5.gem +0 -0
- data/vendor/cache/activeresource-2.3.5.gem +0 -0
- data/vendor/cache/activesupport-2.3.5.gem +0 -0
- data/vendor/cache/friendly_id-2.3.1.gem +0 -0
- data/vendor/cache/hpricot-0.8.2.gem +0 -0
- data/vendor/cache/rack-1.0.1.gem +0 -0
- data/vendor/cache/rails-2.3.5.gem +0 -0
- data/vendor/cache/rake-0.8.7.gem +0 -0
- data/vendor/cache/rubyzip-0.9.1.gem +0 -0
- data/vendor/cache/slim_scrooge-1.0.3.gem +0 -0
- data/vendor/cache/will_paginate-2.3.11.gem +0 -0
@@ -865,6 +865,10 @@ body.dialog form {
|
|
865
865
|
background: 7px 7px no-repeat url('/images/refinery/icons/accept.png') #E0F5E0;
|
866
866
|
}
|
867
867
|
|
868
|
+
#dialog_main #pages_list .linked a em {
|
869
|
+
color: #00A017;
|
870
|
+
}
|
871
|
+
|
868
872
|
#dialog_main #web_address_area, #dialog_main #email_address_area {
|
869
873
|
padding: 12px;
|
870
874
|
}
|
@@ -1029,7 +1033,7 @@ ul#page_parts_controls img {
|
|
1029
1033
|
#TB_ajaxContent, #TB_ajaxContent.TB_modal {
|
1030
1034
|
padding: 0px;
|
1031
1035
|
}
|
1032
|
-
.wym_dialog .form-actions {
|
1036
|
+
.wym_dialog .form-actions, .ui-dialog .form-actions {
|
1033
1037
|
margin-top: 0px;
|
1034
1038
|
border: 0px none;
|
1035
1039
|
border-top: 1px solid #E8E8E8;
|
@@ -1063,10 +1067,10 @@ textarea.wymeditor {
|
|
1063
1067
|
margin-bottom: 0px;
|
1064
1068
|
padding: 0px;
|
1065
1069
|
}
|
1066
|
-
#TB_window div.field {
|
1070
|
+
#TB_window div.field, .ui-dialog div.field {
|
1067
1071
|
margin: 0px 10px;
|
1068
1072
|
}
|
1069
|
-
#TB_window .form-actions {
|
1073
|
+
#TB_window .form-actions, .ui-dialog .form-actions {
|
1070
1074
|
margin-top: 12px;
|
1071
1075
|
}
|
1072
1076
|
|
@@ -1077,13 +1081,13 @@ textarea.wymeditor {
|
|
1077
1081
|
position: absolute;
|
1078
1082
|
bottom: 0px;
|
1079
1083
|
left: 0px;
|
1080
|
-
|
1084
|
+
right: 0px;
|
1081
1085
|
border-right: 0px;
|
1082
1086
|
border-left: 0px;
|
1083
1087
|
border-bottom: 0px;
|
1084
1088
|
padding: 10px 0px;
|
1085
1089
|
}
|
1086
|
-
#dialog_container .form-actions #submit_button {
|
1090
|
+
#dialog_container .form-actions #submit_button, #dialog_container .form-actions .wym_submit {
|
1087
1091
|
margin-left: 10px;
|
1088
1092
|
}
|
1089
1093
|
#dialog_main .form-actions {
|
@@ -1093,6 +1097,15 @@ textarea.wymeditor {
|
|
1093
1097
|
padding: 10px;
|
1094
1098
|
}
|
1095
1099
|
|
1100
|
+
.ui-dialog #dialog_loading {
|
1101
|
+
position: fixed;
|
1102
|
+
top: 50%;
|
1103
|
+
left: 50%;
|
1104
|
+
width: 208px;
|
1105
|
+
height: 13px;
|
1106
|
+
margin: -6px 0 0 -104px;
|
1107
|
+
}
|
1108
|
+
|
1096
1109
|
ul#image_grid {
|
1097
1110
|
width: 580px;
|
1098
1111
|
padding: 0px;
|
@@ -1216,10 +1229,9 @@ ul#plugins li {
|
|
1216
1229
|
}
|
1217
1230
|
.ui-dialog iframe {
|
1218
1231
|
clear:both;
|
1219
|
-
border:none;
|
1232
|
+
border: 0px none;
|
1220
1233
|
margin-bottom:-1px;
|
1221
1234
|
margin-top:1px;
|
1222
|
-
_margin-bottom:1px;
|
1223
1235
|
width: 100% !important;
|
1224
1236
|
}
|
1225
1237
|
|
data/readme.md
CHANGED
@@ -27,7 +27,7 @@ Unlike other content managers, Refinery is truly aimed at the end user making it
|
|
27
27
|
|
28
28
|
## Requirements
|
29
29
|
|
30
|
-
Refinery runs using a number of gems which (as of Refinery version 0.9.
|
30
|
+
Refinery runs using a number of gems which (as of Refinery version 0.9.6.14) are outlined below:
|
31
31
|
|
32
32
|
* [rake >= 0.8.3](http://rubygems.org/gems/rake)
|
33
33
|
* [friendly_id >= 2.3.2](http://rubygems.org/gems/friendly_id)
|
@@ -91,7 +91,7 @@ You will be prompted to setup your first user.
|
|
91
91
|
|
92
92
|
If you're using [Heroku](http://heroku.com/) you will want to put
|
93
93
|
|
94
|
-
|
94
|
+
Refinery.s3_backend = true
|
95
95
|
|
96
96
|
in your ``config/production.rb`` file to make Refinery store files uploaded on Amazon S3.
|
97
97
|
|
@@ -0,0 +1,36 @@
|
|
1
|
+
quentin_images:
|
2
|
+
user: quentin
|
3
|
+
title: Images
|
4
|
+
|
5
|
+
quentin_inquiries:
|
6
|
+
user: quentin
|
7
|
+
title: Inquiries
|
8
|
+
|
9
|
+
quentin_users:
|
10
|
+
user: quentin
|
11
|
+
title: Users
|
12
|
+
|
13
|
+
quentin_news:
|
14
|
+
user: quentin
|
15
|
+
title: News
|
16
|
+
|
17
|
+
quentin_pages:
|
18
|
+
user: quentin
|
19
|
+
title: Pages
|
20
|
+
|
21
|
+
quentin_dialogs:
|
22
|
+
user: quentin
|
23
|
+
title: Dialogs
|
24
|
+
|
25
|
+
quentin_settings:
|
26
|
+
user: quentin
|
27
|
+
title: Settings
|
28
|
+
|
29
|
+
quentin_resources:
|
30
|
+
user: quentin
|
31
|
+
title: Resources
|
32
|
+
|
33
|
+
# TODO: I don't think we need this one
|
34
|
+
quentin_refinery:
|
35
|
+
user: quentin
|
36
|
+
title: Refinery
|
data/test/fixtures/users.yml
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
quentin:
|
2
|
-
id: 1
|
3
2
|
login: quentin
|
4
3
|
email: quentin@example.com
|
5
4
|
salt: 7e3041ebc2fc05a40c60028e2c4901a81035d3cd
|
6
5
|
crypted_password: 00742970dc9e6319f8019fd54864d3ea740f04b1 # test
|
7
6
|
created_at: <%%= 5.days.ago.to_s :db %>
|
8
7
|
state: active
|
8
|
+
|
9
9
|
aaron:
|
10
|
-
id: 2
|
11
10
|
login: aaron
|
12
11
|
email: aaron@example.com
|
13
12
|
salt: 7e3041ebc2fc05a40c60028e2c4901a81035d3cd
|
@@ -5,20 +5,40 @@ class Admin::DashboardController; def rescue_action(e) raise e end; end
|
|
5
5
|
|
6
6
|
class DashboardControllerTest < ActionController::TestCase
|
7
7
|
|
8
|
-
fixtures :users
|
8
|
+
fixtures :users, :pages
|
9
9
|
|
10
10
|
def setup
|
11
11
|
@controller = Admin::DashboardController.new
|
12
12
|
@request = ActionController::TestRequest.new
|
13
13
|
@response = ActionController::TestResponse.new
|
14
|
+
|
15
|
+
login_as(:quentin)
|
14
16
|
end
|
15
17
|
|
16
18
|
def test_should_get_index
|
17
|
-
login_as(:quentin)
|
18
|
-
|
19
19
|
get :index
|
20
20
|
assert_response :success
|
21
|
+
|
21
22
|
assert_not_nil assigns(:recent_activity)
|
23
|
+
|
22
24
|
end
|
23
25
|
|
26
|
+
def test_recent_activity_should_report_activity
|
27
|
+
sleep 1
|
28
|
+
pages(:home_page).update_attribute(:updated_at, Time.now)
|
29
|
+
|
30
|
+
get :index
|
31
|
+
|
32
|
+
# now the home page is updated is it at the top?
|
33
|
+
assert_equal pages(:home_page).id, assigns(:recent_activity).first.id
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_should_require_login_and_redirect
|
37
|
+
logout
|
38
|
+
|
39
|
+
get :index
|
40
|
+
assert_response :redirect
|
41
|
+
assert_nil assigns(:recent_activity)
|
42
|
+
end
|
43
|
+
|
24
44
|
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
+
require 'admin/images_controller'
|
3
|
+
|
4
|
+
class Admin::ImagesController; def rescue_action(e) raise e end; end
|
5
|
+
|
6
|
+
class ImagesControllerTest < ActionController::TestCase
|
7
|
+
|
8
|
+
fixtures :users, :images
|
9
|
+
|
10
|
+
def setup
|
11
|
+
@controller = Admin::ImagesController.new
|
12
|
+
@request = ActionController::TestRequest.new
|
13
|
+
@response = ActionController::TestResponse.new
|
14
|
+
|
15
|
+
login_as(:quentin)
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_should_get_index
|
19
|
+
get :index
|
20
|
+
assert_response :success
|
21
|
+
assert_not_nil assigns(:images)
|
22
|
+
assert assigns(:images).size, Image.count
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_new_image_form
|
26
|
+
get :new
|
27
|
+
assert_not_nil assigns(:image)
|
28
|
+
assert_not_nil assigns(:url_override)
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_search
|
32
|
+
get :index, :search => "Car"
|
33
|
+
|
34
|
+
assert 1, assigns(:images).size
|
35
|
+
assert images(:the_world), assigns(:images).first
|
36
|
+
assert_not_nil assigns(:images)
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_should_require_login_and_redirect
|
40
|
+
logout
|
41
|
+
|
42
|
+
get :index
|
43
|
+
assert_response :redirect
|
44
|
+
assert_nil assigns(:images)
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_edit
|
48
|
+
get :edit, :id => images(:the_world).id
|
49
|
+
|
50
|
+
assert_response :success
|
51
|
+
|
52
|
+
assert_not_nil assigns(:image)
|
53
|
+
assert_equal images(:the_world), assigns(:image)
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_insert
|
57
|
+
get :insert
|
58
|
+
|
59
|
+
assert_not_nil assigns(:image)
|
60
|
+
assert_not_nil assigns(:url_override)
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_update
|
64
|
+
put :update, :id => images(:the_world).id, :image => {}
|
65
|
+
assert_redirected_to admin_images_path
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_create_with_errors
|
69
|
+
post :create # didn't provide an image to upload
|
70
|
+
assert_not_nil assigns(:image)
|
71
|
+
assert_response :success
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_successful_create
|
75
|
+
# This needs to be sorted out yet. I'm not sure how to upload
|
76
|
+
# a file through tests
|
77
|
+
|
78
|
+
# assert_difference('Image.count', +1) do
|
79
|
+
# post :create, :post => {} # didn't provide an image to upload
|
80
|
+
# assert_not_nil assigns(:image)
|
81
|
+
# assert_redirected_to admin_images_path
|
82
|
+
# end
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_destroy
|
86
|
+
assert_difference('Image.count', -1) do
|
87
|
+
delete :destroy, :id => images(:the_world).id
|
88
|
+
end
|
89
|
+
|
90
|
+
assert_redirected_to admin_images_path
|
91
|
+
end
|
92
|
+
|
93
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
ENV["RAILS_ENV"] = "test"
|
2
|
-
|
2
|
+
# this allows us to run rake test:refinery from an application using the Refinery gem.
|
3
|
+
require (ENV["RAILS_ROOT"] ||= (File.expand_path(File.dirname(__FILE__)) + "/..")) + "/config/environment"
|
3
4
|
require 'test_help'
|
4
5
|
|
5
6
|
class ActiveSupport::TestCase
|
@@ -32,12 +33,17 @@ class ActiveSupport::TestCase
|
|
32
33
|
#
|
33
34
|
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
34
35
|
# -- they do not yet inherit this setting
|
36
|
+
self.fixture_path = Refinery.root.join("test", "fixtures").to_s
|
35
37
|
fixtures :all
|
36
38
|
|
37
39
|
# Add more helper methods to be used by all tests here...
|
38
|
-
|
40
|
+
|
39
41
|
def login_as(user)
|
40
42
|
@request.session[:user_id] = user ? users(user).id : nil
|
41
43
|
end
|
42
|
-
|
44
|
+
|
45
|
+
def logout
|
46
|
+
@request.session[:user_id] = nil
|
47
|
+
end
|
48
|
+
|
43
49
|
end
|
data/test/unit/image_test.rb
CHANGED
@@ -19,9 +19,9 @@ class ImageTest < ActiveSupport::TestCase
|
|
19
19
|
|
20
20
|
def test_attachment_fu_options
|
21
21
|
assert_equal 20.megabytes, Image.attachment_options[:max_size]
|
22
|
-
|
22
|
+
|
23
23
|
# want to change this to ImageScience at some point. Rmagick sucks.
|
24
24
|
assert_equal 'Rmagick', Image.attachment_options[:processor]
|
25
25
|
end
|
26
26
|
|
27
|
-
end
|
27
|
+
end
|
data/test/unit/inquiry_test.rb
CHANGED
@@ -13,13 +13,13 @@ class InquiryTest < ActiveSupport::TestCase
|
|
13
13
|
|
14
14
|
def test_should_force_name_and_email_to_be_valid
|
15
15
|
assert !@new_inquiry.save
|
16
|
-
|
16
|
+
|
17
17
|
assert_equal "can't be blank", @new_inquiry.errors.on('name')
|
18
18
|
assert_equal "must be valid", @new_inquiry.errors.on('email')
|
19
19
|
|
20
20
|
assert_nil @new_inquiry.errors.on('phone')
|
21
21
|
assert_nil @new_inquiry.errors.on('message')
|
22
|
-
|
22
|
+
|
23
23
|
assert !@bad_email_inquiry.save
|
24
24
|
assert_equal "must be valid", @bad_email_inquiry.errors.on('email')
|
25
25
|
assert_nil @bad_email_inquiry.errors.on('phone')
|
@@ -29,13 +29,13 @@ class InquiryTest < ActiveSupport::TestCase
|
|
29
29
|
assert @valid_inquiry.save
|
30
30
|
assert @full_valid_inquiry.save
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
def test_named_scopes
|
34
34
|
assert_equal 2, Inquiry.open.size
|
35
35
|
assert_equal 1, Inquiry.closed.size
|
36
|
-
|
36
|
+
|
37
37
|
# check the order. Phil is the newest person to inquire
|
38
38
|
assert_equal inquiries(:phil), Inquiry.open.first
|
39
39
|
end
|
40
|
-
|
41
|
-
end
|
40
|
+
|
41
|
+
end
|
@@ -8,26 +8,26 @@ class NewsItemsTest < ActiveSupport::TestCase
|
|
8
8
|
@new_news_item = NewsItem.new
|
9
9
|
@new_valid_news_item = NewsItem.new(:title => "valid post", :body => "yep looks valid", :publish_date => Date.today)
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
def test_should_not_save_without_title_and_body
|
13
13
|
assert !@new_news_item.save
|
14
|
-
|
14
|
+
|
15
15
|
assert_equal "can't be blank", @new_news_item.errors.on('title')
|
16
16
|
assert_equal "can't be blank", @new_news_item.errors.on('body')
|
17
17
|
assert_equal "can't be blank", @new_news_item.errors.on('publish_date')
|
18
|
-
|
18
|
+
|
19
19
|
assert @new_valid_news_item.save
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
def test_per_page
|
23
23
|
assert_equal 20, NewsItem.per_page
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
def test_named_scopes
|
27
27
|
assert_equal 2, NewsItem.published.size
|
28
28
|
assert NewsItem.latest.size < 10
|
29
|
-
|
29
|
+
|
30
30
|
assert_equal news_items(:new_team_member), NewsItem.latest.first
|
31
31
|
end
|
32
|
-
|
33
|
-
end
|
32
|
+
|
33
|
+
end
|
@@ -7,51 +7,51 @@ class RefinerySettingTest < ActiveSupport::TestCase
|
|
7
7
|
def test_title
|
8
8
|
assert_equal "Site Name", refinery_settings(:site_name).title
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
def test_getter_method
|
12
12
|
assert_equal "My Site", RefinerySetting[:site_name]
|
13
13
|
assert_equal "My Site", RefinerySetting['site_name']
|
14
14
|
assert_equal "My Site", RefinerySetting.site_name
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
def test_find_or_set
|
18
18
|
# creating a new setting on the fly
|
19
19
|
assert_equal "test", RefinerySetting.find_or_set(:my_setting, "test")
|
20
20
|
assert_equal "test", RefinerySetting[:my_setting]
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
def test_setter_methods
|
24
24
|
assert_equal "My Site", RefinerySetting[:site_name]
|
25
|
-
|
25
|
+
|
26
26
|
# change the site name setting
|
27
27
|
RefinerySetting[:site_name] = "My New Site Name"
|
28
28
|
assert_equal "My New Site Name", RefinerySetting[:site_name]
|
29
|
-
|
29
|
+
|
30
30
|
# change the site name setting again this time with quotes not symbols
|
31
31
|
RefinerySetting['site_name'] = "My Site 2"
|
32
32
|
assert_equal "My Site 2", RefinerySetting[:site_name]
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
35
|
def test_per_page
|
36
36
|
assert_equal 10, RefinerySetting.per_page
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
def test_boolean_settings
|
40
40
|
RefinerySetting[:show_dashboard] = true
|
41
41
|
assert RefinerySetting[:show_dashboard]
|
42
|
-
|
42
|
+
|
43
43
|
RefinerySetting[:show_dashboard] = false
|
44
44
|
assert !RefinerySetting[:show_dashboard]
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
47
|
def test_hash_settings
|
48
48
|
RefinerySetting[:site_owner_information] = {:name => "david", :email => "dave@test.com"}
|
49
49
|
assert_equal "david", RefinerySetting[:site_owner_information][:name]
|
50
50
|
end
|
51
|
-
|
51
|
+
|
52
52
|
def test_integer_settings
|
53
53
|
RefinerySetting[:recent_activity_size] = 19
|
54
54
|
assert_equal 19, RefinerySetting[:recent_activity_size]
|
55
55
|
end
|
56
|
-
|
57
|
-
end
|
56
|
+
|
57
|
+
end
|