Updated to latest refinerycms(-blog)
* bundle update * new migrations * fixed specs for new behaviour
This commit is contained in:
@@ -24,4 +24,6 @@ Dummy::Application.configure do
|
||||
config.action_dispatch.best_standards_support = :builtin
|
||||
end
|
||||
|
||||
Refinery.rescue_not_found = false
|
||||
Refinery.rescue_not_found = false# When true will use Amazon's Simple Storage Service on your production machine
|
||||
# instead of the default file system for resources and images
|
||||
Refinery.s3_backend = !(ENV['S3_KEY'].nil? || ENV['S3_SECRET'].nil?)
|
||||
|
||||
@@ -47,4 +47,6 @@ Dummy::Application.configure do
|
||||
# Send deprecation notices to registered listeners
|
||||
config.active_support.deprecation = :notify
|
||||
end
|
||||
Refinery.rescue_not_found = true
|
||||
Refinery.rescue_not_found = true# When true will use Amazon's Simple Storage Service on your production machine
|
||||
# instead of the default file system for resources and images
|
||||
Refinery.s3_backend = !(ENV['S3_KEY'].nil? || ENV['S3_SECRET'].nil?)
|
||||
|
||||
@@ -33,4 +33,6 @@ Dummy::Application.configure do
|
||||
# Print deprecation notices to the stderr
|
||||
config.active_support.deprecation = :stderr
|
||||
end
|
||||
Refinery.rescue_not_found = false
|
||||
Refinery.rescue_not_found = false# When true will use Amazon's Simple Storage Service on your production machine
|
||||
# instead of the default file system for resources and images
|
||||
Refinery.s3_backend = !(ENV['S3_KEY'].nil? || ENV['S3_SECRET'].nil?)
|
||||
|
||||
11
spec/dummy/db/migrate/20110812162202_add_cached_slugs.rb
Normal file
11
spec/dummy/db/migrate/20110812162202_add_cached_slugs.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class AddCachedSlugs < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :blog_categories, :cached_slug, :string
|
||||
add_column :blog_posts, :cached_slug, :string
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :blog_categories, :cached_slug
|
||||
remove_column :blog_posts, :cached_slug
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class AddCustomUrlFieldToBlogPosts < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :blog_posts, :custom_url, :string
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :blog_posts, :custom_url
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,10 @@
|
||||
class AddCustomTeaserFieldToBlogPosts < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :blog_posts, :custom_teaser, :text
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :blog_posts, :custom_teaser
|
||||
end
|
||||
end
|
||||
|
||||
@@ -10,12 +10,13 @@
|
||||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20110602094445) do
|
||||
ActiveRecord::Schema.define(:version => 20110812162204) do
|
||||
|
||||
create_table "blog_categories", :force => true do |t|
|
||||
t.string "title"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "cached_slug"
|
||||
end
|
||||
|
||||
add_index "blog_categories", ["id"], :name => "index_blog_categories_on_id"
|
||||
@@ -48,6 +49,9 @@ ActiveRecord::Schema.define(:version => 20110602094445) do
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer "user_id"
|
||||
t.string "cached_slug"
|
||||
t.string "custom_url"
|
||||
t.text "custom_teaser"
|
||||
end
|
||||
|
||||
add_index "blog_posts", ["id"], :name => "index_blog_posts_on_id"
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
::Page.reset_column_information
|
||||
# Check whether all columns are applied yet by seo_meta.
|
||||
unless !defined?(::SeoMeta) || ::SeoMeta.attributes.keys.all? { |k|
|
||||
::Page.translation_class.instance_methods.include?(k)
|
||||
}
|
||||
# Make pages model seo_meta because not all columns are accessible.
|
||||
::Page.translation_class.send :is_seo_meta
|
||||
end
|
||||
|
||||
page_position = -1
|
||||
|
||||
home_page = Page.create(:title => "Home",
|
||||
|
||||
@@ -63,6 +63,7 @@ describe Refinery::WordPress::Post, :type => :model do
|
||||
@comment.body.should == comment.content
|
||||
@comment.state.should == 'approved'
|
||||
@comment.created_at.should == comment.date
|
||||
@comment.created_at.should == comment.date
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -79,16 +80,13 @@ describe Refinery::WordPress::Post, :type => :model do
|
||||
@post = post.to_refinery
|
||||
end
|
||||
|
||||
specify { BlogPost.should have(1).record }
|
||||
specify { BlogPost.should have(1).record }
|
||||
|
||||
it "should copy the attributes from Refinery::WordPress::Post" do
|
||||
@post.title.should == post.title
|
||||
@post.body.should == post.content_formatted
|
||||
@post.draft.should == post.draft?
|
||||
@post.published_at.should == post.post_date
|
||||
@post.created_at.should == post.post_date
|
||||
@post.author.username.should == post.creator
|
||||
end
|
||||
specify { @post.title.should == post.title }
|
||||
specify { @post.body.should == post.content_formatted }
|
||||
specify { @post.draft.should == post.draft? }
|
||||
specify { @post.published_at.should == post.post_date }
|
||||
specify { @post.author.username.should == post.creator }
|
||||
|
||||
it "should assign a category for each Refinery::WordPress::Category" do
|
||||
@post.categories.should have(post.categories.count).records
|
||||
|
||||
Reference in New Issue
Block a user