diff options
-rw-r--r-- | lib/refinery/blog/engine.rb | 8 | ||||
-rw-r--r-- | spec/lib/refinery/blog/engine_spec.rb | 15 | ||||
-rw-r--r-- | spec/spec_helper.rb | 4 |
3 files changed, 24 insertions, 3 deletions
diff --git a/lib/refinery/blog/engine.rb b/lib/refinery/blog/engine.rb index 58e38f4..46ebea1 100644 --- a/lib/refinery/blog/engine.rb +++ b/lib/refinery/blog/engine.rb @@ -13,7 +13,13 @@ module Refinery plugin.url = app.routes.url_helpers.refinery_admin_blog_posts_path plugin.menu_match = /refinery\/blog\/?(posts|comments|categories)?/ plugin.activity = { - :class_name => :'refinery/blog/post' + :class_name => :'refinery/blog/post', + + # Workaround bug #1193 in refinerycms. + # Without this line, the route fragment generated by the Refinery's + # activity dashboard would be refinery_blog_admin_blog_posts_path, + # which does not exist. + :url => "refinery_admin_blog_posts_path" } end end diff --git a/spec/lib/refinery/blog/engine_spec.rb b/spec/lib/refinery/blog/engine_spec.rb new file mode 100644 index 0000000..5b36fd8 --- /dev/null +++ b/spec/lib/refinery/blog/engine_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +module Refinery + module Blog + describe Engine 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 + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ea550e2..9d4bffe 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -23,9 +23,9 @@ end def each_run FactoryGirl.reload ActiveSupport::Dependencies.clear - + load_all 'spec/support/**/*.rb' - load_all 'spec/factories/**/*.rb' + load_all 'spec/factories/**/*.rb' if FactoryGirl.factories.none? end # If spork is available in the Gemfile it'll be used but we don't force it. |