aboutsummaryrefslogtreecommitdiffstats
path: root/spec/helpers/refinery
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/refinery')
-rw-r--r--spec/helpers/refinery/blog/controller_helper_spec.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/helpers/refinery/blog/controller_helper_spec.rb b/spec/helpers/refinery/blog/controller_helper_spec.rb
new file mode 100644
index 0000000..732f2bd
--- /dev/null
+++ b/spec/helpers/refinery/blog/controller_helper_spec.rb
@@ -0,0 +1,27 @@
+require 'spec_helper'
+
+module Refinery
+ module Blog
+ describe ControllerHelper do
+ describe "#find_tags" do
+ let(:tags) { helper.find_tags }
+
+ context "with draft posts" do
+ let!(:blog_post) { FactoryGirl.create(:blog_post, :draft => true, :tag_list => "first, second" ) }
+
+ it "does not return tags" do
+ expect(tags).to be_empty
+ end
+ end
+
+ context "with live posts" do
+ let!(:blog_post) { FactoryGirl.create(:blog_post, :tag_list => "first, second" ) }
+
+ it "does return tags" do
+ expect(tags).to_not be_empty
+ end
+ end
+ end
+ end
+ end
+end