aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--db/seeds.rb2
-rw-r--r--spec/lib/refinery/blog/engine_spec.rb19
2 files changed, 16 insertions, 5 deletions
diff --git a/db/seeds.rb b/db/seeds.rb
index bd273ea..d603553 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -5,7 +5,7 @@ Refinery::User.find(:all).each do |user|
end
end if defined?(Refinery::User)
-if defined?(Refinery::Page)
+if defined?(Refinery::Page) and !Refinery::Page.exists?(:link_url => '/blog')
page = Refinery::Page.create(
:title => "Blog",
:link_url => "/blog",
diff --git a/spec/lib/refinery/blog/engine_spec.rb b/spec/lib/refinery/blog/engine_spec.rb
index 5b36fd8..1c44da7 100644
--- a/spec/lib/refinery/blog/engine_spec.rb
+++ b/spec/lib/refinery/blog/engine_spec.rb
@@ -3,12 +3,23 @@ require 'spec_helper'
module Refinery
module Blog
describe Engine do
- let(:activity) do
- Refinery::Plugins.registered.find_by_name("refinerycms_blog").activity.first
+ describe "plugin activity" do
+ let(:activity) do
+ Refinery::Plugins.registered.find_by_name("refinerycms_blog").activity.first
+ end
+
+ it "sets the correct path for activity entries" do
+ activity.url.should eq("edit_refinery_admin_blog_posts_path")
+ end
end
- it "sets the correct path for activity entries" do
- activity.url.should eq("edit_refinery_admin_blog_posts_path")
+ describe ".load_seed" do
+ it "is idempotent" do
+ Refinery::Blog::Engine.load_seed
+ Refinery::Blog::Engine.load_seed
+
+ Refinery::Page.where(:link_url => '/blog').count.should eq(1)
+ end
end
end
end