spontaneous 0.2.0.alpha7 → 0.2.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +10 -4
- data/Readme.markdown +1 -1
- data/application/css/definitions.css.scss +5 -0
- data/application/css/dialogue.css.scss +62 -0
- data/application/js/content.js +1 -1
- data/application/js/dom.js +1 -1
- data/application/js/event_source.js +3 -0
- data/application/js/{field_types/date_field.js → field/date.js} +2 -2
- data/application/js/{field_types/file_field.js → field/file.js} +2 -2
- data/application/js/{field_types/image_field.js → field/image.js} +54 -20
- data/application/js/{field_types/long_string_field.js → field/long_string.js} +2 -2
- data/application/js/{field_types/markdown_field.js → field/markdown.js} +2 -2
- data/application/js/{field_types/select_field.js → field/select.js} +2 -2
- data/application/js/{field_types/string_field.js → field/string.js} +21 -7
- data/application/js/{field_types/webvideo_field.js → field/webvideo.js} +2 -2
- data/application/js/field.js +2 -2
- data/application/js/publish.js +99 -19
- data/application/js/spontaneous.js +8 -8
- data/application/js/top_bar.js +6 -4
- data/db/migrations/20130109125023_add_page_publish_lock.rb +17 -0
- data/db/migrations/20130111161934_convert_bcrypt_passwords.rb +22 -0
- data/db/migrations/20130114120000_create_revision_tables.rb +106 -0
- data/db/migrations/20130116220423_add_index_to_archive.rb +9 -0
- data/lib/spontaneous/box.rb +53 -18
- data/lib/spontaneous/box_style.rb +2 -3
- data/lib/spontaneous/change.rb +39 -13
- data/lib/spontaneous/cli/fields.rb +29 -0
- data/lib/spontaneous/cli/init.rb +2 -2
- data/lib/spontaneous/cli/migrate.rb +0 -1
- data/lib/spontaneous/cli/server.rb +14 -10
- data/lib/spontaneous/cli/site.rb +20 -9
- data/lib/spontaneous/cli.rb +8 -6
- data/lib/spontaneous/collections/box_set.rb +11 -0
- data/lib/spontaneous/collections/field_set.rb +24 -1
- data/lib/spontaneous/concern.rb +37 -0
- data/lib/spontaneous/config.rb +3 -4
- data/lib/spontaneous/crypt/version.rb +130 -0
- data/lib/spontaneous/crypt.rb +84 -0
- data/lib/spontaneous/data_mapper/content_model/associations.rb +199 -0
- data/lib/spontaneous/data_mapper/content_model/column_accessors.rb +52 -0
- data/lib/spontaneous/data_mapper/content_model/instance_hooks.rb +34 -0
- data/lib/spontaneous/data_mapper/content_model/serialization.rb +54 -0
- data/lib/spontaneous/data_mapper/content_model/timestamps.rb +39 -0
- data/lib/spontaneous/data_mapper/content_model.rb +343 -0
- data/lib/spontaneous/data_mapper/content_table.rb +103 -0
- data/lib/spontaneous/data_mapper/dataset.rb +194 -0
- data/lib/spontaneous/data_mapper/scope.rb +195 -0
- data/lib/spontaneous/data_mapper.rb +161 -0
- data/lib/spontaneous/facet.rb +2 -2
- data/lib/spontaneous/field/base.rb +418 -0
- data/lib/spontaneous/field/date.rb +54 -0
- data/lib/spontaneous/{field_version.rb → field/field_version.rb} +1 -1
- data/lib/spontaneous/field/file.rb +100 -0
- data/lib/spontaneous/{field_types/image_field.rb → field/image.rb} +33 -33
- data/lib/spontaneous/{field_types/location_field.rb → field/location.rb} +2 -2
- data/lib/spontaneous/{field_types/long_string_field.rb → field/long_string.rb} +3 -3
- data/lib/spontaneous/field/markdown.rb +36 -0
- data/lib/spontaneous/{field_types/select_field.rb → field/select.rb} +4 -5
- data/lib/spontaneous/field/string.rb +17 -0
- data/lib/spontaneous/field/update.rb +156 -0
- data/lib/spontaneous/field/webvideo.rb +310 -0
- data/lib/spontaneous/field.rb +80 -0
- data/lib/spontaneous/generators/site/Gemfile.tt +2 -2
- data/lib/spontaneous/generators/site/config/environments/development.rb.tt +1 -1
- data/lib/spontaneous/generators/site/config/environments/production.rb.tt +1 -1
- data/lib/spontaneous/generators/site/lib/content.rb.tt +6 -0
- data/lib/spontaneous/generators/site/schema/box.rb.tt +3 -2
- data/lib/spontaneous/generators/site/schema/page.rb.tt +3 -1
- data/lib/spontaneous/generators/site/schema/piece.rb.tt +3 -1
- data/lib/spontaneous/generators/site/templates/layouts/standard.html.cut.tt +3 -1
- data/lib/spontaneous/generators/site.rb +4 -3
- data/lib/spontaneous/image_size.rb +8 -1
- data/lib/spontaneous/layout.rb +5 -1
- data/lib/spontaneous/loader.rb +2 -5
- data/lib/spontaneous/media/file.rb +11 -2
- data/lib/spontaneous/media/temp_file.rb +23 -0
- data/lib/spontaneous/media.rb +20 -39
- data/lib/spontaneous/{plugins → model/box}/allowed_types.rb +38 -17
- data/lib/spontaneous/model/box.rb +18 -0
- data/lib/spontaneous/{plugins → model/core}/aliases.rb +10 -14
- data/lib/spontaneous/{plugins → model/core}/boxes.rb +2 -2
- data/lib/spontaneous/{plugins → model/core}/content_groups.rb +2 -2
- data/lib/spontaneous/model/core/editor_class.rb +4 -0
- data/lib/spontaneous/{plugins → model/core}/entries.rb +19 -7
- data/lib/spontaneous/{plugins → model/core}/entry.rb +3 -3
- data/lib/spontaneous/{plugins → model/core}/fields.rb +38 -5
- data/lib/spontaneous/{plugins → model/core}/instance_code.rb +2 -2
- data/lib/spontaneous/{plugins → model/core}/media.rb +2 -12
- data/lib/spontaneous/{plugins → model/core}/modifications.rb +7 -6
- data/lib/spontaneous/model/core/page_search.rb +36 -0
- data/lib/spontaneous/{plugins → model/core}/permissions.rb +4 -4
- data/lib/spontaneous/{plugins → model/core}/prototypes.rb +4 -4
- data/lib/spontaneous/{plugins → model/core}/publishing.rb +93 -115
- data/lib/spontaneous/{plugins → model/core}/render.rb +2 -2
- data/lib/spontaneous/{plugins → model/core}/schema_hierarchy.rb +7 -11
- data/lib/spontaneous/model/core/schema_id.rb +65 -0
- data/lib/spontaneous/{plugins → model/core}/schema_title.rb +2 -2
- data/lib/spontaneous/{plugins → model/core}/serialisation.rb +2 -2
- data/lib/spontaneous/{plugins → model/core}/styles.rb +2 -2
- data/lib/spontaneous/{plugins → model/core}/supertype.rb +2 -2
- data/lib/spontaneous/{plugins → model/core}/visibility.rb +7 -48
- data/lib/spontaneous/model/core.rb +143 -0
- data/lib/spontaneous/{plugins → model/page}/controllers.rb +3 -3
- data/lib/spontaneous/{plugins → model}/page/formats.rb +2 -2
- data/lib/spontaneous/{plugins → model/page}/layouts.rb +2 -2
- data/lib/spontaneous/model/page/locks.rb +14 -0
- data/lib/spontaneous/{plugins → model/page}/page_tree.rb +3 -3
- data/lib/spontaneous/{plugins → model/page}/paths.rb +30 -12
- data/lib/spontaneous/{plugins → model}/page/request.rb +2 -2
- data/lib/spontaneous/{plugins → model/page}/site_map.rb +2 -2
- data/lib/spontaneous/model/page/site_timestamps.rb +44 -0
- data/lib/spontaneous/{page.rb → model/page.rb} +49 -28
- data/lib/spontaneous/{piece.rb → model/piece.rb} +7 -6
- data/lib/spontaneous/model.rb +97 -0
- data/lib/spontaneous/output/context.rb +1 -1
- data/lib/spontaneous/output/format.rb +4 -0
- data/lib/spontaneous/output/template/renderer.rb +2 -2
- data/lib/spontaneous/output.rb +2 -2
- data/lib/spontaneous/page_lock.rb +62 -0
- data/lib/spontaneous/page_piece.rb +1 -1
- data/lib/spontaneous/permissions/access_key.rb +9 -4
- data/lib/spontaneous/permissions/user.rb +19 -9
- data/lib/spontaneous/permissions.rb +2 -5
- data/lib/spontaneous/plugins/application/facets.rb +1 -2
- data/lib/spontaneous/plugins/application/features.rb +1 -1
- data/lib/spontaneous/plugins/application/paths.rb +1 -1
- data/lib/spontaneous/plugins/application/render.rb +1 -1
- data/lib/spontaneous/plugins/application/serialisation.rb +1 -1
- data/lib/spontaneous/plugins/application/state.rb +30 -1
- data/lib/spontaneous/plugins/application/system.rb +12 -12
- data/lib/spontaneous/prototypes/box_prototype.rb +1 -1
- data/lib/spontaneous/prototypes/field_prototype.rb +3 -6
- data/lib/spontaneous/prototypes/style_prototype.rb +1 -1
- data/lib/spontaneous/publishing/immediate.rb +77 -49
- data/lib/spontaneous/publishing/revision.rb +355 -0
- data/lib/spontaneous/publishing/simultaneous.rb +10 -49
- data/lib/spontaneous/publishing.rb +1 -0
- data/lib/spontaneous/rack/around_back.rb +1 -1
- data/lib/spontaneous/rack/around_front.rb +2 -4
- data/lib/spontaneous/rack/around_preview.rb +1 -1
- data/lib/spontaneous/rack/back.rb +80 -63
- data/lib/spontaneous/rack/cacheable_file.rb +2 -2
- data/lib/spontaneous/rack/cookie_authentication.rb +1 -1
- data/lib/spontaneous/rack/front.rb +1 -1
- data/lib/spontaneous/rack/helpers.rb +8 -9
- data/lib/spontaneous/{page_controller.rb → rack/page_controller.rb} +1 -1
- data/lib/spontaneous/rack/public.rb +3 -3
- data/lib/spontaneous/rack.rb +15 -15
- data/lib/spontaneous/schema/uid.rb +4 -1
- data/lib/spontaneous/schema.rb +57 -24
- data/lib/spontaneous/search/database.rb +12 -1
- data/lib/spontaneous/search/index.rb +34 -6
- data/lib/spontaneous/search/results.rb +1 -1
- data/lib/spontaneous/server.rb +3 -3
- data/lib/spontaneous/simultaneous.rb +53 -0
- data/lib/spontaneous/{plugins/site → site}/features.rb +2 -2
- data/lib/spontaneous/{plugins/site → site}/helpers.rb +2 -3
- data/lib/spontaneous/{plugins/site → site}/hooks.rb +2 -2
- data/lib/spontaneous/{plugins/site → site}/instance.rb +4 -6
- data/lib/spontaneous/{plugins/site → site}/level.rb +2 -2
- data/lib/spontaneous/{plugins/site → site}/map.rb +4 -4
- data/lib/spontaneous/{plugins/site → site}/paths.rb +2 -2
- data/lib/spontaneous/site/publishing.rb +89 -0
- data/lib/spontaneous/{plugins/site → site}/schema.rb +4 -4
- data/lib/spontaneous/{plugins/site → site}/search.rb +2 -2
- data/lib/spontaneous/{plugins/site → site}/selectors.rb +15 -7
- data/lib/spontaneous/{plugins/site → site}/state.rb +2 -2
- data/lib/spontaneous/{plugins/site → site}/storage.rb +2 -2
- data/lib/spontaneous/{plugins/site → site}/url.rb +2 -2
- data/lib/spontaneous/site.rb +31 -14
- data/lib/spontaneous/state.rb +5 -6
- data/lib/spontaneous/style.rb +3 -2
- data/lib/spontaneous/utils/database/mysql_dumper.rb +13 -0
- data/lib/spontaneous/utils/database/postgres_dumper.rb +5 -0
- data/lib/spontaneous/version.rb +1 -1
- data/lib/spontaneous.rb +34 -89
- data/spontaneous.gemspec +112 -114
- data/test/experimental/test_crypt.rb +158 -0
- data/test/experimental/test_features.rb +3 -3
- data/test/fixtures/example_application/config/environments/development.rb +1 -1
- data/test/fixtures/example_application/lib/content.rb +5 -0
- data/test/fixtures/example_application/schema/page.rb +2 -1
- data/test/fixtures/example_application/schema/piece.rb +3 -2
- data/test/fixtures/serialisation/class_hash.yaml.erb +5 -5
- data/test/fixtures/serialisation/root_hash.yaml.erb +8 -0
- data/test/functional/test_application.rb +12 -1
- data/test/functional/test_back.rb +80 -48
- data/test/functional/test_front.rb +39 -46
- data/test/functional/test_user_manager.rb +3 -9
- data/test/javascript/test_markdown.rb +2 -2
- data/test/test_helper.rb +78 -23
- data/test/unit/test_alias.rb +21 -15
- data/test/unit/test_asset_bundler.rb +3 -3
- data/test/unit/test_assets.rb +2 -2
- data/test/unit/test_async.rb +7 -6
- data/test/unit/test_authentication.rb +43 -37
- data/test/unit/test_boxes.rb +46 -21
- data/test/unit/test_changesets.rb +65 -20
- data/test/unit/test_config.rb +9 -9
- data/test/unit/test_content.rb +50 -51
- data/test/unit/test_content_inheritance.rb +6 -20
- data/test/unit/test_datamapper.rb +1330 -0
- data/test/unit/test_datamapper_content.rb +214 -0
- data/test/unit/test_fields.rb +543 -54
- data/test/unit/test_formats.rb +2 -3
- data/test/unit/test_generators.rb +6 -6
- data/test/unit/test_helpers.rb +1 -1
- data/test/unit/test_image_size.rb +10 -5
- data/test/unit/test_images.rb +17 -18
- data/test/unit/test_layouts.rb +18 -3
- data/test/unit/test_media.rb +74 -49
- data/test/unit/test_modifications.rb +43 -43
- data/test/unit/test_page.rb +7 -10
- data/test/unit/test_permissions.rb +3 -10
- data/test/unit/test_piece.rb +5 -6
- data/test/unit/test_plugins.rb +7 -14
- data/test/unit/test_prototypes.rb +3 -3
- data/test/unit/test_publishing.rb +49 -27
- data/test/unit/test_render.rb +46 -15
- data/test/unit/test_revisions.rb +124 -127
- data/test/unit/test_schema.rb +53 -58
- data/test/unit/test_search.rb +64 -16
- data/test/unit/test_serialisation.rb +4 -11
- data/test/unit/test_site.rb +11 -12
- data/test/unit/test_structure.rb +2 -5
- data/test/unit/test_styles.rb +22 -24
- data/test/unit/test_type_hierarchy.rb +7 -5
- data/test/unit/test_visibility.rb +79 -55
- metadata +128 -102
- data/lib/sequel/plugins/content_table_inheritance.rb +0 -203
- data/lib/sequel/plugins/scoped_table_name.rb +0 -54
- data/lib/spontaneous/content.rb +0 -129
- data/lib/spontaneous/field_types/date_field.rb +0 -56
- data/lib/spontaneous/field_types/field.rb +0 -302
- data/lib/spontaneous/field_types/file_field.rb +0 -68
- data/lib/spontaneous/field_types/markdown_field.rb +0 -38
- data/lib/spontaneous/field_types/string_field.rb +0 -19
- data/lib/spontaneous/field_types/webvideo_field.rb +0 -313
- data/lib/spontaneous/field_types.rb +0 -38
- data/lib/spontaneous/generators/site/lib/site.rb.tt +0 -4
- data/lib/spontaneous/plugins/field/editor_class.rb +0 -13
- data/lib/spontaneous/plugins/page/site_timestamps.rb +0 -28
- data/lib/spontaneous/plugins/page_search.rb +0 -63
- data/lib/spontaneous/plugins/schema_id.rb +0 -68
- data/lib/spontaneous/plugins/site/publishing.rb +0 -75
- data/lib/spontaneous/rack/fiber_pool.rb +0 -26
- data/test/unit/test_table_scoping.rb +0 -80
data/test/unit/test_formats.rb
CHANGED
@@ -7,12 +7,11 @@ class FormatsTest < MiniTest::Spec
|
|
7
7
|
setup do
|
8
8
|
@site = setup_site
|
9
9
|
@site.paths.add :templates, File.expand_path('../../fixtures/outputs/templates', __FILE__)
|
10
|
-
class Page <
|
11
|
-
class FPage < Page; end
|
10
|
+
# class Page < ::Page; end
|
11
|
+
class FPage < ::Page; end
|
12
12
|
end
|
13
13
|
|
14
14
|
teardown do
|
15
|
-
self.class.send(:remove_const, :Page) rescue nil
|
16
15
|
self.class.send(:remove_const, :FPage) rescue nil
|
17
16
|
teardown_site
|
18
17
|
end
|
@@ -62,15 +62,16 @@ class GeneratorsTest < MiniTest::Spec
|
|
62
62
|
end
|
63
63
|
assert_file_exists(site_root, 'schema')
|
64
64
|
assert_file_exists(site_root, 'schema/page.rb')
|
65
|
-
assert File.read(site_root / 'schema/page.rb') =~ /class Page <
|
65
|
+
assert File.read(site_root / 'schema/page.rb') =~ /class Page < Content::Page/
|
66
66
|
assert_file_exists(site_root, 'schema/piece.rb')
|
67
67
|
assert_file_exists(site_root, 'schema/box.rb')
|
68
|
-
assert File.read(site_root / 'schema/piece.rb') =~ /class Piece <
|
68
|
+
assert File.read(site_root / 'schema/piece.rb') =~ /class Piece < Content::Piece/
|
69
69
|
assert_file_exists(site_root, 'public/js')
|
70
70
|
assert_file_exists(site_root, 'public/css')
|
71
|
-
|
72
|
-
|
73
|
-
assert
|
71
|
+
content_rb = File.read(site_root / 'lib/content.rb')
|
72
|
+
assert content_rb =~ /class Content < Spontaneous::Model\(:content\)/
|
73
|
+
assert content_rb =~ /^Site = Spontaneous\.site\(Content\)/
|
74
|
+
assert_file_exists(site_root, 'lib/tasks/site.rake')
|
74
75
|
assert_file_exists(site_root, 'log')
|
75
76
|
assert_file_exists(site_root, 'tmp')
|
76
77
|
assert_file_exists(site_root, 'cache/media')
|
@@ -78,7 +79,6 @@ class GeneratorsTest < MiniTest::Spec
|
|
78
79
|
assert_file_exists(site_root, 'cache/revisions')
|
79
80
|
assert_file_exists(site_root, '.gitignore')
|
80
81
|
assert File.read(site_root / '.gitignore') =~ /cache\/\*/
|
81
|
-
assert File.read(site_root / 'schema/piece.rb') =~ /class Piece < Spontaneous::Piece/
|
82
82
|
end
|
83
83
|
|
84
84
|
should "specify the current version of spontaneous as the dependency" do
|
data/test/unit/test_helpers.rb
CHANGED
@@ -8,18 +8,23 @@ class ImageSizeTest < MiniTest::Spec
|
|
8
8
|
@base_dir = File.expand_path(File.join(File.dirname(__FILE__), '../fixtures/images'))
|
9
9
|
@dimensions = [50, 67]
|
10
10
|
end
|
11
|
+
|
11
12
|
should "work for PNG24" do
|
12
|
-
ImageSize.read(File.join(@base_dir, "size.png24")).should == @dimensions
|
13
|
+
S::ImageSize.read(File.join(@base_dir, "size.png24")).should == @dimensions
|
13
14
|
end
|
14
15
|
should "work for PNG8" do
|
15
|
-
ImageSize.read(File.join(@base_dir, "size.png8")).should == @dimensions
|
16
|
+
S::ImageSize.read(File.join(@base_dir, "size.png8")).should == @dimensions
|
16
17
|
end
|
17
18
|
should "work for JPG" do
|
18
|
-
ImageSize.read(File.join(@base_dir, "size.jpg")).should == @dimensions
|
19
|
+
S::ImageSize.read(File.join(@base_dir, "size.jpg")).should == @dimensions
|
19
20
|
end
|
20
21
|
should "work for GIF" do
|
21
|
-
ImageSize.read(File.join(@base_dir, "size.gif")).should == @dimensions
|
22
|
+
S::ImageSize.read(File.join(@base_dir, "size.gif")).should == @dimensions
|
23
|
+
end
|
24
|
+
should "return 0x0 for empty files" do
|
25
|
+
Tempfile.open("imagesize") do |file|
|
26
|
+
S::ImageSize.read(file).should == [0,0]
|
27
|
+
end
|
22
28
|
end
|
23
29
|
end
|
24
30
|
end
|
25
|
-
|
data/test/unit/test_images.rb
CHANGED
@@ -5,7 +5,7 @@ require File.expand_path('../../test_helper', __FILE__)
|
|
5
5
|
require 'fog'
|
6
6
|
|
7
7
|
class ImagesTest < MiniTest::Spec
|
8
|
-
|
8
|
+
|
9
9
|
def setup
|
10
10
|
@site = setup_site
|
11
11
|
end
|
@@ -16,7 +16,7 @@ class ImagesTest < MiniTest::Spec
|
|
16
16
|
|
17
17
|
context "Image fields set using absolute values" do
|
18
18
|
setup do
|
19
|
-
@image =
|
19
|
+
@image = S::Field::Image.new(:name => "image")
|
20
20
|
end
|
21
21
|
should "accept and not alter URL values" do
|
22
22
|
url = "http://example.com/image.png"
|
@@ -44,15 +44,14 @@ class ImagesTest < MiniTest::Spec
|
|
44
44
|
@upload_dir.mkpath
|
45
45
|
|
46
46
|
@revision = 10
|
47
|
-
Site.stubs(:working_revision).returns(@revision)
|
47
|
+
S::Site.stubs(:working_revision).returns(@revision)
|
48
48
|
|
49
49
|
@src_image = Pathname.new(File.join(File.dirname(__FILE__), "../fixtures/images/rose.jpg")).realpath
|
50
50
|
@origin_image = @upload_dir + "rose.jpg"
|
51
|
-
# @origin_image.make_link(@src_image.to_s) unless @origin_image.exist?
|
52
51
|
FileUtils.cp(@src_image.to_s, @origin_image.to_s)
|
53
52
|
@origin_image = @origin_image.realpath.to_s
|
54
53
|
|
55
|
-
class ::ResizingImageField <
|
54
|
+
class ::ResizingImageField < S::Field::Image
|
56
55
|
size :preview do
|
57
56
|
width 200
|
58
57
|
optimize!
|
@@ -78,7 +77,7 @@ class ImagesTest < MiniTest::Spec
|
|
78
77
|
|
79
78
|
ResizingImageField.register
|
80
79
|
|
81
|
-
class ::ContentWithImage < Content
|
80
|
+
class ::ContentWithImage < ::Content::Piece
|
82
81
|
field :photo, :resizing_image
|
83
82
|
end
|
84
83
|
|
@@ -103,11 +102,11 @@ class ImagesTest < MiniTest::Spec
|
|
103
102
|
end
|
104
103
|
|
105
104
|
should "create resized versions of the input image" do
|
106
|
-
ImageSize.read(@image.preview.filepath).should == [200, 267]
|
107
|
-
ImageSize.read(@image.tall.filepath).should == [150, 200]
|
108
|
-
ImageSize.read(@image.thumbnail.filepath).should == [38, 50]
|
109
|
-
ImageSize.read(@image.icon.filepath).should == [50, 50]
|
110
|
-
ImageSize.read(@image.greyscale.filepath).should == [38, 50]
|
105
|
+
S::ImageSize.read(@image.preview.filepath).should == [200, 267]
|
106
|
+
S::ImageSize.read(@image.tall.filepath).should == [150, 200]
|
107
|
+
S::ImageSize.read(@image.thumbnail.filepath).should == [38, 50]
|
108
|
+
S::ImageSize.read(@image.icon.filepath).should == [50, 50]
|
109
|
+
S::ImageSize.read(@image.greyscale.filepath).should == [38, 50]
|
111
110
|
end
|
112
111
|
|
113
112
|
should "preserve new format if processing has altered it" do
|
@@ -115,7 +114,7 @@ class ImagesTest < MiniTest::Spec
|
|
115
114
|
end
|
116
115
|
end
|
117
116
|
|
118
|
-
context "with optimization
|
117
|
+
context "with optimization" do
|
119
118
|
should "run jpegoptim" do
|
120
119
|
Spontaneous.expects(:system).with(regexp_matches(/jpegoptim/)).at_least_once
|
121
120
|
Spontaneous.expects(:system).with(regexp_matches(/jpegtran/)).at_least_once
|
@@ -177,7 +176,7 @@ class ImagesTest < MiniTest::Spec
|
|
177
176
|
@image.height.should == 533
|
178
177
|
end
|
179
178
|
|
180
|
-
should "have access to the original uploaded file through field.original" do
|
179
|
+
should "have access to the original uploaded file through field.original xxx" do
|
181
180
|
@image.src.should == "/media/00234/0010/rose.jpg"
|
182
181
|
@image.original.width.should == @image.width
|
183
182
|
@image.original.height.should == @image.height
|
@@ -187,11 +186,11 @@ class ImagesTest < MiniTest::Spec
|
|
187
186
|
|
188
187
|
|
189
188
|
should "have a 'sizes' config option that generates resized versions" do
|
190
|
-
assert_same_elements ResizingImageField.size_definitions.keys, [:preview, :thumbnail, :icon, :tall, :greyscale, :reformatted]
|
189
|
+
assert_same_elements ResizingImageField.size_definitions.keys, [:__ui__, :preview, :thumbnail, :icon, :tall, :greyscale, :reformatted]
|
191
190
|
end
|
192
191
|
|
193
192
|
should "serialise attributes" do
|
194
|
-
serialised = S::
|
193
|
+
serialised = S::Field.deserialize_field(@image.serialize_db)[:processed_values]
|
195
194
|
[:preview, :thumbnail, :icon, :tall].each do |size|
|
196
195
|
serialised.key?(size).should be_true
|
197
196
|
serialised[size][:src].should == "/media/00234/0010/rose.#{size}.jpg"
|
@@ -232,12 +231,12 @@ class ImagesTest < MiniTest::Spec
|
|
232
231
|
@image.original.filesize.should == @image.filesize
|
233
232
|
end
|
234
233
|
should "have a 'sizes' config option that generates resized versions" do
|
235
|
-
assert_same_elements @image.class.size_definitions.keys, [:preview, :thumbnail, :icon, :tall, :greyscale, :reformatted]
|
236
|
-
assert_same_elements @image.class.sizes.keys, [:preview, :thumbnail, :icon, :tall, :greyscale, :reformatted]
|
234
|
+
assert_same_elements @image.class.size_definitions.keys, [:__ui__, :preview, :thumbnail, :icon, :tall, :greyscale, :reformatted]
|
235
|
+
assert_same_elements @image.class.sizes.keys, [:__ui__, :preview, :thumbnail, :icon, :tall, :greyscale, :reformatted]
|
237
236
|
end
|
238
237
|
|
239
238
|
should "serialise attributes" do
|
240
|
-
serialised = S::
|
239
|
+
serialised = S::Field.deserialize_field(@image.serialize_db)[:processed_values]
|
241
240
|
[:preview, :thumbnail, :icon, :tall].each do |size|
|
242
241
|
serialised.key?(size).should be_true
|
243
242
|
serialised[size][:src].should == "/media/00234/0010/rose.#{size}.jpg"
|
data/test/unit/test_layouts.rb
CHANGED
@@ -17,13 +17,13 @@ class LayoutsTest < MiniTest::Spec
|
|
17
17
|
context "layouts" do
|
18
18
|
|
19
19
|
setup do
|
20
|
-
class ::LayoutPage <
|
21
|
-
class ::ABoxClass <
|
20
|
+
class ::LayoutPage < ::Page; end
|
21
|
+
class ::ABoxClass < ::Box; end
|
22
22
|
class ::SubPage < LayoutPage; end
|
23
23
|
ABoxClass.style :monkey
|
24
24
|
ABoxClass.style :crazy
|
25
25
|
|
26
|
-
class ::SomeContent <
|
26
|
+
class ::SomeContent < ::Piece; end
|
27
27
|
end
|
28
28
|
|
29
29
|
teardown do
|
@@ -41,6 +41,20 @@ class LayoutsTest < MiniTest::Spec
|
|
41
41
|
page.render.should == "layouts/standard.html.cut\n"
|
42
42
|
end
|
43
43
|
|
44
|
+
should "use the named template if it exists" do
|
45
|
+
layout = @template_root / "layouts/layout_page.html.cut"
|
46
|
+
begin
|
47
|
+
File.open(layout, "w") do |file|
|
48
|
+
file.write("layouts/layout_page.html.cut\n")
|
49
|
+
end
|
50
|
+
page = LayoutPage.new
|
51
|
+
assert_correct_template(page, @template_root / 'layouts/layout_page')
|
52
|
+
page.render.should == "layouts/layout_page.html.cut\n"
|
53
|
+
ensure
|
54
|
+
FileUtils.rm(layout)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
44
58
|
should "return the first layout if some are declared but none declared default" do
|
45
59
|
LayoutPage.layout :custom1
|
46
60
|
LayoutPage.layout :custom2
|
@@ -48,6 +62,7 @@ class LayoutsTest < MiniTest::Spec
|
|
48
62
|
assert_correct_template(page, @template_root / 'layouts/custom1')
|
49
63
|
page.render.should == "layouts/custom1.html.cut\n"
|
50
64
|
end
|
65
|
+
|
51
66
|
should "return the layout declared default" do
|
52
67
|
LayoutPage.layout :custom1
|
53
68
|
LayoutPage.layout :custom2, :default => true
|
data/test/unit/test_media.rb
CHANGED
@@ -9,14 +9,14 @@ class MediaTest < MiniTest::Spec
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def teardown
|
12
|
+
::Content.delete
|
12
13
|
teardown_site
|
13
|
-
S::Content.delete
|
14
14
|
end
|
15
15
|
|
16
16
|
context "Utility methods" do
|
17
17
|
should "be able to sanitise filenames" do
|
18
18
|
filename = "Something with-dodgy 'characters'.many.jpg"
|
19
|
-
Media.to_filename(filename).should == "Something-with-dodgy-characters.many.jpg"
|
19
|
+
S::Media.to_filename(filename).should == "Something-with-dodgy-characters.many.jpg"
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -45,7 +45,7 @@ class MediaTest < MiniTest::Spec
|
|
45
45
|
@storage = Spontaneous::Storage::Cloud.new(@aws_credentials, 'media.example.com')
|
46
46
|
@storage.backend.directories.create(:key => @bucket_name)
|
47
47
|
@site.stubs(:storage).with(anything).returns(@storage)
|
48
|
-
@content =
|
48
|
+
@content = ::Piece.create
|
49
49
|
@content.stubs(:id).returns(99)
|
50
50
|
Spontaneous::State.stubs(:revision).returns(853)
|
51
51
|
end
|
@@ -108,7 +108,7 @@ class MediaTest < MiniTest::Spec
|
|
108
108
|
@media_dir = Dir.mktmpdir
|
109
109
|
@storage = Spontaneous::Storage::Local.new(@media_dir, '/media')
|
110
110
|
@site.stubs(:storage).with(anything).returns(@storage)
|
111
|
-
@content =
|
111
|
+
@content = ::Piece.create
|
112
112
|
@content.stubs(:id).returns(99)
|
113
113
|
Spontaneous::State.stubs(:revision).returns(853)
|
114
114
|
end
|
@@ -167,62 +167,87 @@ class MediaTest < MiniTest::Spec
|
|
167
167
|
end
|
168
168
|
end
|
169
169
|
|
170
|
-
context "
|
170
|
+
context "temporary media items" do
|
171
171
|
setup do
|
172
|
-
#
|
173
|
-
#
|
174
|
-
|
175
|
-
@
|
176
|
-
@
|
172
|
+
# Setup cloud storage as default to ensure that the temp files
|
173
|
+
# are bypassing this and being written locally
|
174
|
+
Fog.mock!
|
175
|
+
@bucket_name = "media.example.com"
|
176
|
+
@aws_credentials = {
|
177
|
+
:provider=>"AWS",
|
178
|
+
:aws_secret_access_key=>"SECRET_ACCESS_KEY",
|
179
|
+
:aws_access_key_id=>"ACCESS_KEY_ID",
|
180
|
+
:public_host => "http://media.example.com"
|
181
|
+
}
|
182
|
+
cloud = Spontaneous::Storage::Cloud.new(@aws_credentials, 'media.example.com')
|
183
|
+
cloud.backend.directories.create(:key => @bucket_name)
|
184
|
+
@site.stubs(:storage).with(anything).returns(cloud)
|
185
|
+
@media_dir = Dir.mktmpdir
|
186
|
+
@storage = Spontaneous::Storage::Local.new(@media_dir, '/media')
|
187
|
+
@site.stubs(:local_storage).with(anything).returns(@storage)
|
188
|
+
@site.stubs(:default_storage).with(anything).returns(@storage)
|
189
|
+
@content = ::Piece.create
|
190
|
+
@content.stubs(:id).returns(99)
|
177
191
|
end
|
178
192
|
|
179
|
-
should "
|
180
|
-
|
181
|
-
|
193
|
+
should "return an absolute path for the url" do
|
194
|
+
file = Spontaneous::Media::TempFile.new(@content, "file name.txt")
|
195
|
+
file.url.should == "/media/tmp/00099/file-name.txt"
|
182
196
|
end
|
183
197
|
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
@upload_dir = @tmp_dir + "tmp/1234"
|
189
|
-
@upload_dir.mkpath
|
190
|
-
@origin_image = @upload_dir + "rose.jpg"
|
191
|
-
FileUtils.cp(@src_image.to_s, @origin_image.to_s)
|
192
|
-
end
|
198
|
+
should "place files into its configured root" do
|
199
|
+
file = Spontaneous::Media::TempFile.new(@content, "file name.txt")
|
200
|
+
file.path.should == File.join(@media_dir, "/tmp/00099/file-name.txt")
|
201
|
+
end
|
193
202
|
|
194
|
-
|
195
|
-
|
196
|
-
|
203
|
+
should "be able to copy a file into place if passed the path of an existing file" do
|
204
|
+
file_path = File.join(@media_dir, "/tmp/00099/file-name.txt")
|
205
|
+
existing_file = File.expand_path("../../fixtures/images/rose.jpg", __FILE__)
|
206
|
+
::File.exist?(file_path).should be_false
|
207
|
+
::File.exist?(existing_file).should be_true
|
208
|
+
file = Spontaneous::Media::TempFile.new(@content, "file name.txt")
|
209
|
+
file.copy(existing_file)
|
210
|
+
::File.exist?(file_path).should be_true
|
211
|
+
file.source.should == existing_file
|
212
|
+
end
|
197
213
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
214
|
+
should "be able to copy a file into place if passed the handle of an existing file" do
|
215
|
+
file_path = File.join(@media_dir, "/tmp/00099/file-name.txt")
|
216
|
+
existing_file = File.expand_path("../../fixtures/images/rose.jpg", __FILE__)
|
217
|
+
::File.exist?(file_path).should be_false
|
218
|
+
::File.exist?(existing_file).should be_true
|
219
|
+
file = Spontaneous::Media::TempFile.new(@content, "file name.txt")
|
220
|
+
File.open(existing_file, 'rb') do |f|
|
221
|
+
file.copy(f)
|
203
222
|
end
|
223
|
+
::File.exist?(file_path).should be_true
|
224
|
+
file.source.should == existing_file
|
225
|
+
end
|
204
226
|
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
227
|
+
should "provide an open method that writes files to the correct location" do
|
228
|
+
file_path = File.join(@media_dir, "/tmp/00099/file-name.txt")
|
229
|
+
::File.exist?(file_path).should be_false
|
230
|
+
file = Spontaneous::Media::TempFile.new(@content, "file name.txt")
|
231
|
+
content_string = "Hello"
|
232
|
+
file.open do |f|
|
233
|
+
f.write(content_string)
|
210
234
|
end
|
235
|
+
File.read(file_path).should == content_string
|
236
|
+
end
|
237
|
+
end
|
211
238
|
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
dest_image.exist?.should be_true
|
225
|
-
end
|
239
|
+
context "Content items" do
|
240
|
+
setup do
|
241
|
+
# @media_dir = File.expand_path(File.join(File.dirname(__FILE__), "../../tmp/media"))
|
242
|
+
# Spontaneous.media_dir = @media_dir
|
243
|
+
S::Site.stubs(:working_revision).returns(74)
|
244
|
+
@instance = ::Piece.new
|
245
|
+
@instance.stubs(:id).returns(101)
|
246
|
+
end
|
247
|
+
|
248
|
+
should "be able to generate a revision and id based media path" do
|
249
|
+
@instance.media_filepath("something.jpg").should == File.join(@site.media_dir, "00101/0074/something.jpg")
|
250
|
+
@instance.media_urlpath("something.jpg").should == "/media/00101/0074/something.jpg"
|
226
251
|
end
|
227
252
|
end
|
228
253
|
end
|
@@ -21,11 +21,11 @@ class ModificationsTest < MiniTest::Spec
|
|
21
21
|
# DB.logger = Logger.new($stdout)
|
22
22
|
Content.delete
|
23
23
|
|
24
|
-
class Page <
|
24
|
+
class Page < ::Page
|
25
25
|
field :title, :string, :default => "New Page"
|
26
26
|
box :things
|
27
27
|
end
|
28
|
-
class Piece <
|
28
|
+
class Piece < ::Piece
|
29
29
|
box :things
|
30
30
|
end
|
31
31
|
|
@@ -79,7 +79,7 @@ class ModificationsTest < MiniTest::Spec
|
|
79
79
|
should "update modification date of path when page visibility is changed" do
|
80
80
|
now = @now + 100
|
81
81
|
stub_time(now)
|
82
|
-
c = Page.
|
82
|
+
c = Page.uid("0")
|
83
83
|
(c.modified_at.to_i - @now.to_i).abs.should <= 1
|
84
84
|
c.toggle_visibility!
|
85
85
|
(c.modified_at - now).abs.should <= 1
|
@@ -136,7 +136,7 @@ class ModificationsTest < MiniTest::Spec
|
|
136
136
|
page.modified_at.to_i.should == @now.to_i + 3600
|
137
137
|
end
|
138
138
|
|
139
|
-
should "not update the parent page's timestamp on addition of a child page" do
|
139
|
+
should "not update the parent page's timestamp on addition of a child page yyyy" do
|
140
140
|
stub_time(@now+1000)
|
141
141
|
page = Page.first :uid => "0"
|
142
142
|
page.things << Page.new
|
@@ -219,7 +219,7 @@ class ModificationsTest < MiniTest::Spec
|
|
219
219
|
mods = page.pending_modifications(:slug)
|
220
220
|
mods.length.should == 1
|
221
221
|
mod = mods.first
|
222
|
-
mod.must_be_instance_of Spontaneous::
|
222
|
+
mod.must_be_instance_of Spontaneous::Model::Core::Modifications::SlugModification
|
223
223
|
mod.old_value.should == old_slug
|
224
224
|
mod.new_value.should == "changed"
|
225
225
|
mod.created_at.to_i.should == @now.to_i + 3600
|
@@ -356,7 +356,7 @@ class ModificationsTest < MiniTest::Spec
|
|
356
356
|
@final_revision = 2
|
357
357
|
Content.delete_revision(@initial_revision) rescue nil
|
358
358
|
Content.delete_revision(@final_revision) rescue nil
|
359
|
-
|
359
|
+
::Content.publish(@initial_revision)
|
360
360
|
end
|
361
361
|
|
362
362
|
teardown do
|
@@ -370,11 +370,11 @@ class ModificationsTest < MiniTest::Spec
|
|
370
370
|
old_slug = page.slug
|
371
371
|
page.slug = "changed"
|
372
372
|
page.save
|
373
|
-
|
374
|
-
|
373
|
+
::Content.publish(@final_revision, [page.id])
|
374
|
+
::Content.with_revision(@final_revision) do
|
375
375
|
%w(1 1.1.1).each do |uid|
|
376
376
|
published_page = Page.first :uid => uid
|
377
|
-
|
377
|
+
::Content.with_editable do
|
378
378
|
editable_page = Page.first :uid => uid
|
379
379
|
published_page.path.should == editable_page.path
|
380
380
|
end
|
@@ -396,8 +396,8 @@ class ModificationsTest < MiniTest::Spec
|
|
396
396
|
child_page.slug = "changed-too"
|
397
397
|
child_page.save
|
398
398
|
|
399
|
-
|
400
|
-
|
399
|
+
::Content.publish(@final_revision, [page.id])
|
400
|
+
::Content.with_revision(@final_revision) do
|
401
401
|
published = Page.first :uid => "1.0.0"
|
402
402
|
published.path.should == "/changed/#{old_slug}"
|
403
403
|
end
|
@@ -417,8 +417,8 @@ class ModificationsTest < MiniTest::Spec
|
|
417
417
|
child_page.slug = "changed-too"
|
418
418
|
child_page.save
|
419
419
|
|
420
|
-
|
421
|
-
|
420
|
+
::Content.publish(@final_revision, [child_page.id])
|
421
|
+
::Content.with_revision(@final_revision) do
|
422
422
|
published = Page.first :uid => "1.0.0"
|
423
423
|
published.path.should == "/#{old_slug}/changed-too"
|
424
424
|
end
|
@@ -428,11 +428,11 @@ class ModificationsTest < MiniTest::Spec
|
|
428
428
|
should "act on visibility modifications" do
|
429
429
|
page = Page.first :uid => "1"
|
430
430
|
page.hide!
|
431
|
-
|
432
|
-
|
431
|
+
::Content.publish(@final_revision, [page.id])
|
432
|
+
::Content.with_revision(@final_revision) do
|
433
433
|
%w(1 1.1.1).each do |uid|
|
434
434
|
published_page = Page.first :uid => uid
|
435
|
-
|
435
|
+
::Content.with_editable do
|
436
436
|
editable_page = Page.first :uid => uid
|
437
437
|
published_page.hidden?.should == editable_page.hidden?
|
438
438
|
end
|
@@ -448,9 +448,9 @@ class ModificationsTest < MiniTest::Spec
|
|
448
448
|
page.things << child_page
|
449
449
|
page.save
|
450
450
|
|
451
|
-
|
451
|
+
::Content.publish(@final_revision, [child_page.id])
|
452
452
|
|
453
|
-
|
453
|
+
::Content.with_revision(@final_revision) do
|
454
454
|
published = Page.first :uid => "1.0.0"
|
455
455
|
published.visible?.should be_true
|
456
456
|
published = Page.first :uid => "child"
|
@@ -466,9 +466,9 @@ class ModificationsTest < MiniTest::Spec
|
|
466
466
|
page.things << child_page
|
467
467
|
page.save
|
468
468
|
|
469
|
-
|
469
|
+
::Content.publish(@final_revision, [page.id, child_page.id])
|
470
470
|
|
471
|
-
|
471
|
+
::Content.with_revision(@final_revision) do
|
472
472
|
published = Page.first :uid => "child"
|
473
473
|
published.visible?.should be_false
|
474
474
|
end
|
@@ -484,9 +484,9 @@ class ModificationsTest < MiniTest::Spec
|
|
484
484
|
child_page.slug = "changed-too"
|
485
485
|
child_page.save
|
486
486
|
|
487
|
-
|
487
|
+
::Content.publish(@final_revision, [child_page.id])
|
488
488
|
|
489
|
-
|
489
|
+
::Content.with_revision(@final_revision) do
|
490
490
|
published = Page.first :uid => "1.0.0"
|
491
491
|
published.visible?.should be_true
|
492
492
|
end
|
@@ -499,7 +499,7 @@ class ModificationsTest < MiniTest::Spec
|
|
499
499
|
page.things << child_page
|
500
500
|
page.save
|
501
501
|
|
502
|
-
|
502
|
+
::Content.publish(@final_revision, [page.id, child_page.id])
|
503
503
|
|
504
504
|
child_page.hidden?.should be_false
|
505
505
|
|
@@ -507,9 +507,9 @@ class ModificationsTest < MiniTest::Spec
|
|
507
507
|
|
508
508
|
child_page.reload.hidden?.should be_true
|
509
509
|
|
510
|
-
|
510
|
+
::Content.publish(@final_revision + 1, [page.id])
|
511
511
|
|
512
|
-
|
512
|
+
::Content.with_revision(@final_revision + 1) do
|
513
513
|
published = Page.first :uid => "newpage"
|
514
514
|
published.visible?.should be_false
|
515
515
|
end
|
@@ -524,44 +524,44 @@ class ModificationsTest < MiniTest::Spec
|
|
524
524
|
|
525
525
|
child_page.reload.hidden?.should be_true
|
526
526
|
|
527
|
-
|
527
|
+
::Content.publish(@final_revision, [page.id])
|
528
528
|
|
529
|
-
|
529
|
+
::Content.with_revision(@final_revision) do
|
530
530
|
published = Page.first :uid => "1.0.0"
|
531
531
|
published.visible?.should be_false
|
532
532
|
end
|
533
533
|
end
|
534
534
|
|
535
|
-
should "maintain correct published visibility for pieces
|
535
|
+
should "maintain correct published visibility for pieces" do
|
536
536
|
page = Page.first :uid => "1"
|
537
537
|
piece = page.things.first
|
538
538
|
piece.hide!
|
539
|
-
|
540
|
-
|
539
|
+
::Content.publish(@final_revision, [page.id])
|
540
|
+
::Content.with_revision(@final_revision) do
|
541
541
|
piece = Page.first(:uid => "1").things.first
|
542
542
|
piece.visible?.should be_false
|
543
543
|
end
|
544
544
|
|
545
|
-
|
545
|
+
::Content.publish(@final_revision+1, [page.id])
|
546
546
|
|
547
|
-
|
547
|
+
::Content.with_revision(@final_revision+1) do
|
548
548
|
piece = Page.first(:uid => "1").things.first
|
549
549
|
piece.visible?.should be_false
|
550
550
|
end
|
551
551
|
end
|
552
552
|
|
553
|
-
should "maintain correct published visibility for pages
|
553
|
+
should "maintain correct published visibility for pages" do
|
554
554
|
page = Page.first :uid => "1.1.1"
|
555
555
|
page.hide!
|
556
|
-
|
557
|
-
|
556
|
+
::Content.publish(@final_revision, [page.id])
|
557
|
+
::Content.with_revision(@final_revision) do
|
558
558
|
page = Page.first(:uid => "1.1.1")
|
559
559
|
page.visible?.should be_false
|
560
560
|
end
|
561
561
|
|
562
|
-
|
562
|
+
::Content.publish(@final_revision+1, [page.id])
|
563
563
|
|
564
|
-
|
564
|
+
::Content.with_revision(@final_revision+1) do
|
565
565
|
page = Page.first(:uid => "1.1.1")
|
566
566
|
page.visible?.should be_false
|
567
567
|
end
|
@@ -574,11 +574,11 @@ class ModificationsTest < MiniTest::Spec
|
|
574
574
|
page.slug = "changed-again"
|
575
575
|
page.hide!
|
576
576
|
|
577
|
-
|
578
|
-
|
577
|
+
::Content.publish(@final_revision, [page.id])
|
578
|
+
::Content.with_revision(@final_revision) do
|
579
579
|
%w(1 1.1.1).each do |uid|
|
580
580
|
published_page = Page.first :uid => uid
|
581
|
-
|
581
|
+
::Content.with_editable do
|
582
582
|
editable_page = Page.first :uid => uid
|
583
583
|
published_page.hidden?.should == editable_page.hidden?
|
584
584
|
published_page.slug.should == editable_page.slug
|
@@ -592,8 +592,8 @@ class ModificationsTest < MiniTest::Spec
|
|
592
592
|
page = Page.first(:uid => "1")
|
593
593
|
page.destroy
|
594
594
|
page = Page.first(:uid => "root")
|
595
|
-
|
596
|
-
|
595
|
+
::Content.publish(@final_revision, [page.id])
|
596
|
+
::Content.with_revision(@final_revision) do
|
597
597
|
%w(1 1.1.1).each do |uid|
|
598
598
|
published_page = Page.first :uid => uid
|
599
599
|
published_page.should be_nil
|
@@ -607,7 +607,7 @@ class ModificationsTest < MiniTest::Spec
|
|
607
607
|
page = Page.first :uid => "1"
|
608
608
|
page.slug = "changed"
|
609
609
|
page.hide!
|
610
|
-
|
610
|
+
::Content.publish(@final_revision, [page.id])
|
611
611
|
page = Page.first :id => page.id
|
612
612
|
page.pending_modifications.length.should == 0
|
613
613
|
end
|