radiant 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of radiant might be problematic. Click here for more details.
- data/CHANGELOG +37 -0
- data/CONTRIBUTORS +9 -0
- data/app/controllers/admin/page_controller.rb +3 -2
- data/app/controllers/admin/user_controller.rb +2 -2
- data/app/controllers/admin/welcome_controller.rb +3 -3
- data/app/controllers/application.rb +9 -1
- data/app/helpers/admin/abstract_model_helper.rb +2 -0
- data/app/helpers/admin/page_helper.rb +4 -0
- data/app/helpers/application_helper.rb +4 -6
- data/app/models/page.rb +4 -1
- data/app/models/response_cache.rb +10 -7
- data/app/models/standard_tags.rb +7 -5
- data/app/views/admin/layout/index.rhtml +1 -1
- data/app/views/admin/layout/remove.rhtml +1 -1
- data/app/views/admin/page/_node.rhtml +4 -4
- data/app/views/admin/snippet/index.rhtml +1 -1
- data/app/views/admin/user/index.rhtml +1 -1
- data/app/views/layouts/application.rhtml +4 -4
- data/config/environment.rb +77 -70
- data/config/environments/test.rb +9 -2
- data/db/migrate/016_add_sessions.rb +16 -0
- data/db/schema.rb +10 -1
- data/lib/generators/extension/templates/tasks.rake +13 -2
- data/lib/generators/extension/templates/test_helper.rb +3 -2
- data/lib/login_system.rb +19 -4
- data/lib/plugins/extension_patches/init.rb +1 -1
- data/lib/plugins/extension_patches/lib/fixture_loading_extension.rb +32 -33
- data/lib/radiant.rb +1 -1
- data/lib/radiant/extension.rb +14 -0
- data/lib/radiant/extension_loader.rb +135 -106
- data/lib/radiant/initializer.rb +2 -0
- data/lib/tasks/extensions.rake +16 -1
- data/public/javascripts/prototype.js +305 -175
- data/public/javascripts/sitemap.js +1 -1
- data/public/stylesheets/admin/main.css +5 -2
- data/test/fixtures/extensions/01_basic/vendor/plugins/multiple/init.rb +1 -0
- data/test/fixtures/extensions/01_basic/vendor/plugins/multiple/lib/multiple.rb +2 -0
- data/test/fixtures/extensions/01_basic/vendor/plugins/plugin_normal/init.rb +1 -0
- data/test/fixtures/extensions/01_basic/vendor/plugins/plugin_normal/lib/normal_plugin.rb +2 -0
- data/test/fixtures/extensions/02_overriding/overriding_extension.rb +1 -1
- data/test/fixtures/extensions/02_overriding/vendor/plugins/multiple/init.rb +1 -0
- data/test/fixtures/extensions/02_overriding/vendor/plugins/multiple/lib/multiple.rb +2 -0
- data/test/fixtures/extensions/load_order_blue/load_order_blue_extension.rb +11 -0
- data/test/fixtures/extensions/load_order_green/load_order_green_extension.rb +11 -0
- data/test/fixtures/extensions/load_order_red/load_order_red_extension.rb +11 -0
- data/test/fixtures/pages.yml +16 -1
- data/test/functional/admin/abstract_model_controller_test.rb +2 -2
- data/test/functional/admin/export_controller_test.rb +2 -1
- data/test/functional/admin/extension_controller_test.rb +2 -1
- data/test/functional/admin/layout_controller_test.rb +6 -4
- data/test/functional/admin/page_controller_test.rb +48 -22
- data/test/functional/admin/user_controller_test.rb +12 -9
- data/test/functional/admin/welcome_controller_test.rb +4 -4
- data/test/functional/application_controller_test.rb +3 -2
- data/test/functional/extension_initialization_test.rb +31 -5
- data/test/functional/extension_load_order_test.rb +49 -0
- data/test/functional/login_system_test.rb +21 -11
- data/test/helpers/difference_test_helper.rb +13 -0
- data/test/helpers/extension_tag_test_helper.rb +3 -3
- data/test/helpers/login_test_helper.rb +12 -0
- data/test/helpers/page_test_helper.rb +4 -1
- data/test/unit/page_test.rb +5 -0
- data/test/unit/response_cache_test.rb +27 -6
- data/test/unit/standard_tags_test.rb +6 -3
- metadata +1789 -1767
@@ -131,7 +131,7 @@ Object.extend(SiteMap.prototype, {
|
|
131
131
|
var id = this.extractPageId(row).toString();
|
132
132
|
new Ajax.Updater(
|
133
133
|
row,
|
134
|
-
'
|
134
|
+
'../admin/ui/pages/children/' + id + '/' + level,
|
135
135
|
{
|
136
136
|
asynchronous: true,
|
137
137
|
insertion: Insertion.After,
|
@@ -4,7 +4,10 @@ body {
|
|
4
4
|
margin: 0;
|
5
5
|
padding: 0;
|
6
6
|
}
|
7
|
-
img {
|
7
|
+
img, input[type='image'] {
|
8
|
+
border: 0;
|
9
|
+
vertical-align: middle;
|
10
|
+
}
|
8
11
|
h3 {
|
9
12
|
font-size: 130%;
|
10
13
|
margin-top: 1.25em;
|
@@ -607,4 +610,4 @@ table#filter-reference-table blockquote {
|
|
607
610
|
margin: 0;
|
608
611
|
margin-top: 1em;
|
609
612
|
margin-bottom: 1em;
|
610
|
-
}
|
613
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'multiple'
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'normal_plugin'
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'multiple'
|
data/test/fixtures/pages.yml
CHANGED
@@ -358,4 +358,19 @@ gallery_draft:
|
|
358
358
|
slug: gallery_draft
|
359
359
|
status_id: 1
|
360
360
|
parent_id: 50
|
361
|
-
published_at: 2006-02-05 08:44:07
|
361
|
+
published_at: 2006-02-05 08:44:07
|
362
|
+
custom_404_root:
|
363
|
+
id: 58
|
364
|
+
title: Custom 404 Root
|
365
|
+
slug: custom_404
|
366
|
+
status_id: 100
|
367
|
+
parent_id: 1
|
368
|
+
published_at: 2006-02-05 08:44:07
|
369
|
+
custom_404:
|
370
|
+
id: 59
|
371
|
+
title: Custom File Not Found
|
372
|
+
slug: missing
|
373
|
+
class_name: CustomFileNotFoundPage
|
374
|
+
status_id: 100
|
375
|
+
parent_id: 58
|
376
|
+
published_at: 2006-02-05 08:44:07
|
@@ -17,13 +17,13 @@ class Admin::AbstractModelControllerTest < Test::Unit::TestCase
|
|
17
17
|
end
|
18
18
|
|
19
19
|
fixtures :users, :layouts
|
20
|
-
test_helper :layouts, :caching, :routing
|
20
|
+
test_helper :layouts, :caching, :routing, :login
|
21
21
|
|
22
22
|
def setup
|
23
23
|
@controller = TestModelController.new
|
24
24
|
@request = ActionController::TestRequest.new
|
25
25
|
@response = ActionController::TestResponse.new
|
26
|
-
|
26
|
+
login_as(:existing)
|
27
27
|
@cache = @controller.cache = FakeResponseCache.new
|
28
28
|
|
29
29
|
@layout_name = "Test Layout"
|
@@ -6,12 +6,13 @@ class Admin::ExportController; def rescue_action(e) raise e end; end
|
|
6
6
|
|
7
7
|
class Admin::ExportControllerTest < Test::Unit::TestCase
|
8
8
|
fixtures :users, :pages
|
9
|
+
test_helper :login
|
9
10
|
|
10
11
|
def setup
|
11
12
|
@controller = Admin::ExportController.new
|
12
13
|
@request = ActionController::TestRequest.new
|
13
14
|
@response = ActionController::TestResponse.new
|
14
|
-
|
15
|
+
login_as(:developer)
|
15
16
|
end
|
16
17
|
|
17
18
|
def test_yaml
|
@@ -7,12 +7,13 @@ class Admin::ExtensionController; def rescue_action(e) raise e end; end
|
|
7
7
|
class Admin::ExtensionControllerTest < Test::Unit::TestCase
|
8
8
|
|
9
9
|
fixtures :users
|
10
|
+
test_helper :login
|
10
11
|
|
11
12
|
def setup
|
12
13
|
@controller = Admin::ExtensionController.new
|
13
14
|
@request = ActionController::TestRequest.new
|
14
15
|
@response = ActionController::TestResponse.new
|
15
|
-
|
16
|
+
login_as(:admin)
|
16
17
|
end
|
17
18
|
|
18
19
|
def test_index
|
@@ -6,13 +6,13 @@ class Admin::LayoutController; def rescue_action(e) raise e end; end
|
|
6
6
|
|
7
7
|
class Admin::LayoutControllerTest < Test::Unit::TestCase
|
8
8
|
fixtures :users, :layouts
|
9
|
-
test_helper :users, :layouts
|
9
|
+
test_helper :users, :layouts, :login
|
10
10
|
|
11
11
|
def setup
|
12
12
|
@controller = Admin::LayoutController.new
|
13
13
|
@request = ActionController::TestRequest.new
|
14
14
|
@response = ActionController::TestResponse.new
|
15
|
-
|
15
|
+
login_as(:developer)
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_ancestors
|
@@ -21,7 +21,8 @@ class Admin::LayoutControllerTest < Test::Unit::TestCase
|
|
21
21
|
|
22
22
|
[:index, :new, :edit, :remove].each do |action|
|
23
23
|
define_method "test_#{action}_action_allowed_if_admin" do
|
24
|
-
|
24
|
+
login_as(:admin)
|
25
|
+
get action, { :id => 1 }
|
25
26
|
assert_response :success, "action: #{action}"
|
26
27
|
end
|
27
28
|
|
@@ -31,7 +32,8 @@ class Admin::LayoutControllerTest < Test::Unit::TestCase
|
|
31
32
|
end
|
32
33
|
|
33
34
|
define_method "test_#{action}_action__not_allowed_if_other" do
|
34
|
-
|
35
|
+
login_as(:existing)
|
36
|
+
get action, { :id => 1 }
|
35
37
|
assert_redirected_to page_index_url, "action: #{action}"
|
36
38
|
assert_match /privileges/, flash[:error], "action: #{action}"
|
37
39
|
end
|
@@ -6,13 +6,13 @@ class Admin::PageController; def rescue_action(e) raise e end; end
|
|
6
6
|
|
7
7
|
class Admin::PageControllerTest < Test::Unit::TestCase
|
8
8
|
fixtures :users, :pages
|
9
|
-
test_helper :pages, :page_parts, :caching
|
9
|
+
test_helper :pages, :page_parts, :caching, :login
|
10
10
|
|
11
11
|
def setup
|
12
12
|
@controller = Admin::PageController.new
|
13
13
|
@request = ActionController::TestRequest.new
|
14
14
|
@response = ActionController::TestResponse.new
|
15
|
-
|
15
|
+
login_as(:existing)
|
16
16
|
|
17
17
|
@page_title = 'Just a Test'
|
18
18
|
|
@@ -160,10 +160,28 @@ class Admin::PageControllerTest < Test::Unit::TestCase
|
|
160
160
|
assert_equal 'Ruby Home Page', @page.title
|
161
161
|
end
|
162
162
|
def test_edit__post
|
163
|
+
@cache = @controller.cache = FakeResponseCache.new
|
163
164
|
@page = create_test_page
|
164
165
|
post :edit, :id => @page.id, :page => page_params(:status_id => '1')
|
165
166
|
assert_response :redirect
|
166
167
|
assert_equal 1, get_test_page.status.id
|
168
|
+
|
169
|
+
@page = get_test_page
|
170
|
+
assert_kind_of Page, @page
|
171
|
+
assert_equal '/page/', @cache.expired_path
|
172
|
+
|
173
|
+
# To-Do: Test what happens when an invalid page is submitted
|
174
|
+
end
|
175
|
+
def test_edit__post_with_slug_change
|
176
|
+
@cache = @controller.cache = FakeResponseCache.new
|
177
|
+
@page = create_test_page
|
178
|
+
post :edit, :id => @page.id, :page => page_params(:slug => 'monkey', :status_id => '1')
|
179
|
+
assert_response :redirect
|
180
|
+
assert_equal 1, get_test_page.status.id
|
181
|
+
|
182
|
+
@page = get_test_page
|
183
|
+
assert_kind_of Page, @page
|
184
|
+
assert_equal '/page/', @cache.expired_path
|
167
185
|
|
168
186
|
# To-Do: Test what happens when an invalid page is submitted
|
169
187
|
end
|
@@ -180,26 +198,26 @@ class Admin::PageControllerTest < Test::Unit::TestCase
|
|
180
198
|
@page = get_test_page
|
181
199
|
assert_equal 1, @page.parts.size
|
182
200
|
assert_equal 'changed', @page.parts.first.content
|
183
|
-
end
|
184
|
-
|
185
|
-
def test_edit__post_with_optimistic_locking
|
186
|
-
@page = create_test_page
|
187
|
-
post :edit, :id => @page.id, :page => page_params(:status_id => '1', :lock_version => '12')
|
188
|
-
assert_response :success # not redirected
|
189
|
-
assert_match /has been modified/, flash[:error]
|
190
|
-
end
|
191
|
-
|
192
|
-
def test_edit__post_with_parts_and_optimistic_locking
|
193
|
-
@page = create_test_page
|
194
|
-
@page.parts.create(part_params(:name => 'test-part-1', :content => 'original-1'))
|
195
|
-
post :edit, :id => @page.id, :page => page_params(:status_id => '1', :lock_version => '12'), :part => {'1' => part_params(:name => 'test-part-1', :content => 'changed-1')}
|
196
|
-
assert_response :success # not redirected
|
197
|
-
assert_match /has been modified/, flash[:error]
|
198
|
-
#changed value must not be saved
|
199
|
-
assert_equal 'original-1', @page.parts.find_by_name('test-part-1').content
|
200
|
-
#but must be rendered to page
|
201
|
-
assert_tag :tag => 'textarea', :content => 'changed-1'
|
202
|
-
end
|
201
|
+
end
|
202
|
+
|
203
|
+
def test_edit__post_with_optimistic_locking
|
204
|
+
@page = create_test_page
|
205
|
+
post :edit, :id => @page.id, :page => page_params(:status_id => '1', :lock_version => '12')
|
206
|
+
assert_response :success # not redirected
|
207
|
+
assert_match /has been modified/, flash[:error]
|
208
|
+
end
|
209
|
+
|
210
|
+
def test_edit__post_with_parts_and_optimistic_locking
|
211
|
+
@page = create_test_page
|
212
|
+
@page.parts.create(part_params(:name => 'test-part-1', :content => 'original-1'))
|
213
|
+
post :edit, :id => @page.id, :page => page_params(:status_id => '1', :lock_version => '12'), :part => {'1' => part_params(:name => 'test-part-1', :content => 'changed-1')}
|
214
|
+
assert_response :success # not redirected
|
215
|
+
assert_match /has been modified/, flash[:error]
|
216
|
+
#changed value must not be saved
|
217
|
+
assert_equal 'original-1', @page.parts.find_by_name('test-part-1').content
|
218
|
+
#but must be rendered to page
|
219
|
+
assert_tag :tag => 'textarea', :content => 'changed-1'
|
220
|
+
end
|
203
221
|
|
204
222
|
def test_remove
|
205
223
|
@page = create_test_page
|
@@ -208,6 +226,14 @@ class Admin::PageControllerTest < Test::Unit::TestCase
|
|
208
226
|
assert_equal @page, assigns(:page)
|
209
227
|
assert_not_nil get_test_page
|
210
228
|
end
|
229
|
+
def test_remove_should_show_all_children_regardless_of_sitemap_expansion
|
230
|
+
@page = pages(:homepage)
|
231
|
+
get :remove, :id => @page.id
|
232
|
+
assert_response :success
|
233
|
+
Page.find(:all).each do |page|
|
234
|
+
assert_tag "tr", :attributes => {:id => "page-#{page.id}"}
|
235
|
+
end
|
236
|
+
end
|
211
237
|
def test_remove__post
|
212
238
|
@page = create_test_page
|
213
239
|
post :remove, :id => @page.id
|
@@ -7,13 +7,14 @@ class Admin::UserController; def rescue_action(e) raise e end; end
|
|
7
7
|
class Admin::UserControllerTest < Test::Unit::TestCase
|
8
8
|
|
9
9
|
fixtures :users
|
10
|
-
test_helper :user, :logging
|
10
|
+
test_helper :user, :logging, :login
|
11
11
|
|
12
12
|
def setup
|
13
13
|
@controller = Admin::UserController.new
|
14
14
|
@request = ActionController::TestRequest.new
|
15
15
|
@response = ActionController::TestResponse.new
|
16
|
-
@user =
|
16
|
+
@user = create_test_user
|
17
|
+
login_as(@user)
|
17
18
|
end
|
18
19
|
|
19
20
|
def teardown
|
@@ -26,12 +27,14 @@ class Admin::UserControllerTest < Test::Unit::TestCase
|
|
26
27
|
|
27
28
|
[:index, :new, :edit, :remove].each do |action|
|
28
29
|
define_method "test_#{action}_action_allowed_if_admin" do
|
29
|
-
|
30
|
+
login_as(:admin)
|
31
|
+
get action, { :id => 1 }
|
30
32
|
assert_response :success, "action: #{action}"
|
31
33
|
end
|
32
34
|
|
33
35
|
define_method "test_#{action}_action_not_allowed_if_other" do
|
34
|
-
|
36
|
+
login_as(:non_admin)
|
37
|
+
get action, { :id => 1 }
|
35
38
|
assert_redirected_to page_index_url, "action: #{action}"
|
36
39
|
assert_match /privileges/, flash[:error], "action: #{action}"
|
37
40
|
end
|
@@ -39,7 +42,8 @@ class Admin::UserControllerTest < Test::Unit::TestCase
|
|
39
42
|
|
40
43
|
def test_remove__cannot_remove_self
|
41
44
|
@user = users(:admin)
|
42
|
-
|
45
|
+
login_as(@user)
|
46
|
+
get :remove, { :id => @user.id }
|
43
47
|
assert_redirected_to user_index_url
|
44
48
|
assert_match /cannot.*self/i, flash[:error]
|
45
49
|
assert_not_nil User.find(@user.id)
|
@@ -56,8 +60,7 @@ class Admin::UserControllerTest < Test::Unit::TestCase
|
|
56
60
|
def test_preferences__post
|
57
61
|
post(
|
58
62
|
:preferences,
|
59
|
-
{ :user => { :password => '', :password_confirmation => '', :email => 'updated@gmail.com' } }
|
60
|
-
{ 'user' => @user }
|
63
|
+
{ :user => { :password => '', :password_confirmation => '', :email => 'updated@gmail.com' } }
|
61
64
|
)
|
62
65
|
@user = User.find(@user.id)
|
63
66
|
assert_redirected_to page_index_url
|
@@ -72,10 +75,10 @@ class Admin::UserControllerTest < Test::Unit::TestCase
|
|
72
75
|
|
73
76
|
def test_change_password
|
74
77
|
@user = User.create!(:name => 'Test', :login => 'pref_test', :password => 'whoa!', :password_confirmation => 'whoa!')
|
78
|
+
login_as(@user)
|
75
79
|
post(
|
76
80
|
:preferences,
|
77
|
-
{ :user => { :password => 'funtimes', :password_confirmation => 'funtimes' } }
|
78
|
-
{ 'user' => @user }
|
81
|
+
{ :user => { :password => 'funtimes', :password_confirmation => 'funtimes' } }
|
79
82
|
)
|
80
83
|
@user = User.find(@user.id)
|
81
84
|
assert_equal User.sha1('funtimes'), @user.password
|
@@ -6,7 +6,7 @@ class Admin::WelcomeController; def rescue_action(e) raise e end; end
|
|
6
6
|
|
7
7
|
class Admin::WelcomeControllerTest < Test::Unit::TestCase
|
8
8
|
|
9
|
-
test_helper :logging
|
9
|
+
test_helper :logging, :login
|
10
10
|
fixtures :users
|
11
11
|
|
12
12
|
def setup
|
@@ -28,7 +28,7 @@ class Admin::WelcomeControllerTest < Test::Unit::TestCase
|
|
28
28
|
post :login, 'user' => { :login => 'existing', :password => 'password' }
|
29
29
|
assert_redirected_to welcome_url
|
30
30
|
|
31
|
-
user =
|
31
|
+
user = @controller.send :current_user
|
32
32
|
assert_kind_of User, user
|
33
33
|
assert_equal 'existing', user.login
|
34
34
|
|
@@ -38,13 +38,13 @@ class Admin::WelcomeControllerTest < Test::Unit::TestCase
|
|
38
38
|
post :login, 'user' => { :login => 'invalid', :password => 'password' }
|
39
39
|
assert_response :success
|
40
40
|
assert_match /invalid/i, flash[:error]
|
41
|
-
assert_nil
|
41
|
+
assert_nil assigns[:current_user]
|
42
42
|
end
|
43
43
|
|
44
44
|
def test_logout
|
45
45
|
get :logout, nil, { 'user' => users(:existing) }
|
46
46
|
assert_redirected_to login_url
|
47
|
-
assert_nil
|
47
|
+
assert_nil assigns[:current_user]
|
48
48
|
assert_match /logged out/i, flash[:notice]
|
49
49
|
end
|
50
50
|
|
@@ -7,7 +7,7 @@ class ApplicationController; def rescue_action(e) raise e end; end
|
|
7
7
|
class ApplicationControllerTest < Test::Unit::TestCase
|
8
8
|
fixtures :users
|
9
9
|
|
10
|
-
test_helper :routing
|
10
|
+
test_helper :routing, :login
|
11
11
|
|
12
12
|
class TestController < ApplicationController
|
13
13
|
def test
|
@@ -37,7 +37,8 @@ class ApplicationControllerTest < Test::Unit::TestCase
|
|
37
37
|
|
38
38
|
def test_before_filter
|
39
39
|
UserActionObserver.current_user = nil
|
40
|
-
|
40
|
+
login_as(@user)
|
41
|
+
get :test
|
41
42
|
assert_response :success
|
42
43
|
assert_equal @user, UserActionObserver.current_user
|
43
44
|
end
|
@@ -32,16 +32,22 @@ class ExtensionInitializationTest < Test::Unit::TestCase
|
|
32
32
|
end
|
33
33
|
assert_view_paths :index => /should get changed/
|
34
34
|
|
35
|
+
#only want to clear the test extensions
|
36
|
+
old_list = Dependencies.explicitly_unloadable_constants
|
37
|
+
Dependencies.explicitly_unloadable_constants = Radiant::Extension.descendants.select {|ex| ex.root.index(TEST_ROOT) == 0}.map {|x| x.name }
|
35
38
|
Dependencies.clear
|
39
|
+
Dependencies.explicitly_unloadable_constants = old_list
|
40
|
+
|
36
41
|
assert_basic_extension_annotations
|
37
42
|
assert_view_paths
|
38
43
|
assert_admin_tabs "Basic Extension Tab"
|
44
|
+
|
39
45
|
end
|
40
46
|
|
41
47
|
def test_reactivate
|
42
48
|
assert_admin_tabs "Basic Extension Tab"
|
43
49
|
Radiant::ExtensionLoader.reactivate []
|
44
|
-
|
50
|
+
assert Radiant::AdminUI.tabs.all? {|tab| tab.name != "Basic Extension Tab" }
|
45
51
|
ensure
|
46
52
|
Radiant::ExtensionLoader.reactivate Radiant::Extension.descendants
|
47
53
|
assert BasicExtension.active?
|
@@ -60,13 +66,33 @@ class ExtensionInitializationTest < Test::Unit::TestCase
|
|
60
66
|
assert_basic_extension_annotations
|
61
67
|
end
|
62
68
|
|
69
|
+
def test_should_load_plugin_from_vendor_plugin
|
70
|
+
assert_nothing_raised { Radiant::Extension.const_get(:PLUGIN_PLUGIN_NORMAL) }
|
71
|
+
assert_equal BasicExtension.root + "/vendor/plugins/plugin_normal", Radiant::Extension::PLUGIN_PLUGIN_NORMAL
|
72
|
+
assert $LOAD_PATH.include?(BasicExtension.root + "/vendor/plugins/plugin_normal/lib")
|
73
|
+
assert defined?(NormalPlugin)
|
74
|
+
end
|
75
|
+
|
76
|
+
def test_should_load_multiple_location_plugin_from_first_extension_in_load_order
|
77
|
+
assert_nothing_raised { Radiant::Extension.const_get(:PLUGIN_MULTIPLE) }
|
78
|
+
assert_equal BasicExtension.root + "/vendor/plugins/multiple", Radiant::Extension::PLUGIN_MULTIPLE
|
79
|
+
assert $LOAD_PATH.include?(BasicExtension.root + "/vendor/plugins/multiple/lib")
|
80
|
+
assert defined?(Multiple)
|
81
|
+
assert_not_equal OverridingExtension.root + "/vendor/plugins/multiple", Radiant::Extension::PLUGIN_MULTIPLE
|
82
|
+
assert !$LOAD_PATH.include?(OverridingExtension.root + "/vendor/plugins/multiple/lib")
|
83
|
+
end
|
84
|
+
|
63
85
|
private
|
64
86
|
|
65
87
|
def assert_admin_tabs(more_tabs = [])
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
88
|
+
tabnames = []
|
89
|
+
Radiant::AdminUI.tabs.each do |tab|
|
90
|
+
assert "Duplicate Tab", !tabnames.include?(tab.name)
|
91
|
+
tabnames << tab.name
|
92
|
+
end
|
93
|
+
more_tabs.each do |tabname|
|
94
|
+
assert Radiant::AdminUI.tabs.any? {|tab| tab.name == tabname }
|
95
|
+
end
|
70
96
|
end
|
71
97
|
|
72
98
|
def assert_basic_extension_annotations
|