browsercms 3.0.1 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,10 @@
1
1
  require File.join(File.dirname(__FILE__), '/../../test_helper')
2
2
 
3
+ # Sample Model for testing naming/model classes
4
+ class Kindness < ActiveRecord::Base
5
+ acts_as_content_block
6
+ end
7
+
3
8
  class ContentTypeTest < ActiveSupport::TestCase
4
9
  def setup
5
10
  @c = ContentType.new(:name => "HtmlBlock")
@@ -20,4 +25,20 @@ class ContentTypeTest < ActiveSupport::TestCase
20
25
  def test_content_block_type
21
26
  assert_equal "html_blocks", @c.content_block_type
22
27
  end
23
- end
28
+
29
+ test "find_by_key handles names that end with s correctly" do
30
+ ContentType.create!(:name => "Kindness", :group_name => "Anything")
31
+
32
+ ct = ContentType.find_by_key("kindness")
33
+ assert_not_nil ct
34
+ assert_equal "Kindness", ct.display_name
35
+ end
36
+
37
+ test "calculate the model_class name with s" do
38
+ ct = ContentType.new(:name=>"Kindness")
39
+ assert_equal Kindness, ct.model_class
40
+ end
41
+
42
+
43
+ end
44
+
@@ -0,0 +1,41 @@
1
+ require File.join(File.dirname(__FILE__), '/../test_helper')
2
+
3
+ class SchemaStatementsTest < ActiveSupport::TestCase
4
+
5
+ def teardown
6
+ %w(fake_contents fake_content_versions).each do |table|
7
+ ActiveRecord::Base.connection.drop_table(table) rescue nil
8
+ end
9
+ end
10
+
11
+ test "create_content_table should make two tables" do
12
+ conn = ActiveRecord::Base.connection
13
+ conn.create_content_table :fake_contents do |t|
14
+ t.string :name
15
+ end
16
+
17
+ expected_columns = %w(archived created_at created_by_id deleted id lock_version name published updated_at updated_by_id version)
18
+ expected_columns_v = %w(archived created_at created_by_id deleted fake_content_id id name published updated_at updated_by_id version version_comment)
19
+ assert_equal expected_columns, conn.columns(:fake_contents).map { |c| c.name }.sort
20
+ assert_equal expected_columns_v, conn.columns(:fake_content_versions).map { |c| c.name }.sort
21
+ end
22
+
23
+ test "add_content_column should add columns to both primary and versions table" do
24
+ connection.create_content_table :fake_contents do |t| end
25
+
26
+ connection.add_content_column :fake_contents, :foo, :string
27
+
28
+ found_c = connection.columns(:fake_contents).map { |c| c.name }
29
+ assert found_c.include?("foo")
30
+
31
+ found_c = connection.columns(:fake_content_versions).map { |c| c.name }
32
+ assert found_c.include?("foo")
33
+ end
34
+
35
+
36
+ def connection
37
+ ActiveRecord::Base.connection
38
+ end
39
+ end
40
+
41
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: browsercms
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - BrowserMedia
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-14 00:00:00 -04:00
12
+ date: 2009-10-06 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -553,6 +553,7 @@ files:
553
553
  - doc/app/index.html
554
554
  - doc/app/rdoc-style.css
555
555
  - doc/guides/html/build_it_yourself.html
556
+ - doc/guides/html/building_modules.html
556
557
  - doc/guides/html/deployment_guide.html
557
558
  - doc/guides/html/designer_guide.html
558
559
  - doc/guides/html/developer_guide.html
@@ -1262,64 +1263,66 @@ signing_key:
1262
1263
  specification_version: 2
1263
1264
  summary: BrowserCMS is a general purpose, open source Web Content Management System (CMS), written in Ruby on Rails.
1264
1265
  test_files:
1265
- - test/custom_assertions.rb
1266
- - test/factories.rb
1267
- - test/functional/cms/cache_controller_test.rb
1268
- - test/functional/cms/categories_controller_test.rb
1269
- - test/functional/cms/connectors_controller_test.rb
1270
- - test/functional/cms/content_controller_test.rb
1266
+ - test/functional/cms/file_blocks_controller_test.rb
1267
+ - test/functional/cms/toolbar_controller_test.rb
1268
+ - test/functional/cms/sessions_controller_test.rb
1271
1269
  - test/functional/cms/content_types_controller_test.rb
1272
1270
  - test/functional/cms/dashboard_controller_test.rb
1273
- - test/functional/cms/dynamic_views_controller_test.rb
1274
- - test/functional/cms/file_blocks_controller_test.rb
1275
- - test/functional/cms/groups_controller_test.rb
1276
- - test/functional/cms/home_controller_test.rb
1271
+ - test/functional/cms/cache_controller_test.rb
1277
1272
  - test/functional/cms/html_blocks_controller_test.rb
1278
- - test/functional/cms/image_blocks_controller_test.rb
1273
+ - test/functional/cms/users_controller_test.rb
1274
+ - test/functional/cms/content_controller_test.rb
1279
1275
  - test/functional/cms/links_controller_test.rb
1276
+ - test/functional/cms/dynamic_views_controller_test.rb
1277
+ - test/functional/cms/categories_controller_test.rb
1280
1278
  - test/functional/cms/pages_controller_test.rb
1281
- - test/functional/cms/portlets_controller_test.rb
1279
+ - test/functional/cms/connectors_controller_test.rb
1280
+ - test/functional/cms/home_controller_test.rb
1282
1281
  - test/functional/cms/section_nodes_controller_test.rb
1282
+ - test/functional/cms/groups_controller_test.rb
1283
1283
  - test/functional/cms/sections_controller_test.rb
1284
- - test/functional/cms/sessions_controller_test.rb
1285
- - test/functional/cms/toolbar_controller_test.rb
1286
- - test/functional/cms/users_controller_test.rb
1287
- - test/integration/login_test.rb
1288
- - test/test_helper.rb
1284
+ - test/functional/cms/portlets_controller_test.rb
1285
+ - test/functional/cms/image_blocks_controller_test.rb
1286
+ - test/factories.rb
1287
+ - test/custom_assertions.rb
1289
1288
  - test/test_logging.rb
1290
- - test/unit/behaviors/attaching_test.rb
1291
- - test/unit/behaviors/dynamic_attributes_test.rb
1292
- - test/unit/behaviors/publishable_test.rb
1293
- - test/unit/behaviors/searching_test.rb
1294
- - test/unit/behaviors/taggable_test.rb
1295
- - test/unit/extensions/active_record/base_test.rb
1296
- - test/unit/extensions/hash_test.rb
1297
- - test/unit/extensions/integer_test.rb
1298
- - test/unit/helpers/application_helper_test.rb
1299
- - test/unit/helpers/form_builder_test.rb
1300
- - test/unit/helpers/menu_helper_test.rb
1289
+ - test/test_helper.rb
1301
1290
  - test/unit/helpers/page_helper_test.rb
1291
+ - test/unit/helpers/application_helper_test.rb
1302
1292
  - test/unit/helpers/path_helper_test.rb
1303
- - test/unit/lib/content_block_test.rb
1304
- - test/unit/lib/generators_test.rb
1305
- - test/unit/models/attachment_test.rb
1306
- - test/unit/models/category_test.rb
1307
- - test/unit/models/category_type_test.rb
1308
- - test/unit/models/connector_test.rb
1309
- - test/unit/models/content_type_test.rb
1293
+ - test/unit/helpers/menu_helper_test.rb
1294
+ - test/unit/helpers/form_builder_test.rb
1295
+ - test/unit/schema_statements_test.rb
1296
+ - test/unit/models/user_test.rb
1297
+ - test/unit/models/link_test.rb
1310
1298
  - test/unit/models/email_page_portlet_test.rb
1311
- - test/unit/models/file_block_test.rb
1312
1299
  - test/unit/models/group_test.rb
1300
+ - test/unit/models/site_test.rb
1301
+ - test/unit/models/sections_test.rb
1302
+ - test/unit/models/section_node_test.rb
1303
+ - test/unit/models/content_type_test.rb
1313
1304
  - test/unit/models/html_block_test.rb
1314
- - test/unit/models/link_test.rb
1315
- - test/unit/models/page_partial_test.rb
1316
- - test/unit/models/page_route_test.rb
1317
- - test/unit/models/page_template_test.rb
1318
- - test/unit/models/page_test.rb
1319
- - test/unit/models/permission_test.rb
1320
1305
  - test/unit/models/portlet_test.rb
1321
- - test/unit/models/section_node_test.rb
1322
- - test/unit/models/sections_test.rb
1323
- - test/unit/models/site_test.rb
1306
+ - test/unit/models/connector_test.rb
1324
1307
  - test/unit/models/task_test.rb
1325
- - test/unit/models/user_test.rb
1308
+ - test/unit/models/page_test.rb
1309
+ - test/unit/models/category_test.rb
1310
+ - test/unit/models/page_route_test.rb
1311
+ - test/unit/models/page_partial_test.rb
1312
+ - test/unit/models/attachment_test.rb
1313
+ - test/unit/models/file_block_test.rb
1314
+ - test/unit/models/permission_test.rb
1315
+ - test/unit/models/page_template_test.rb
1316
+ - test/unit/models/category_type_test.rb
1317
+ - test/unit/behaviors/publishable_test.rb
1318
+ - test/unit/behaviors/searching_test.rb
1319
+ - test/unit/behaviors/dynamic_attributes_test.rb
1320
+ - test/unit/behaviors/taggable_test.rb
1321
+ - test/unit/behaviors/attaching_test.rb
1322
+ - test/unit/extensions/hash_test.rb
1323
+ - test/unit/extensions/active_record/base_test.rb
1324
+ - test/unit/extensions/integer_test.rb
1325
+ - test/unit/lib/routes_test.rb
1326
+ - test/unit/lib/generators_test.rb
1327
+ - test/unit/lib/content_block_test.rb
1328
+ - test/integration/login_test.rb