From eff755504d45bfeff415786dcd0dbbb4c47e8dd0 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 14 Mar 2014 11:47:52 +0000 Subject: Add AdminHelper#comment_visibility Get the canonical human-readable status of a comment --- spec/helpers/admin_helper_spec.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 spec/helpers/admin_helper_spec.rb (limited to 'spec/helpers/admin_helper_spec.rb') diff --git a/spec/helpers/admin_helper_spec.rb b/spec/helpers/admin_helper_spec.rb new file mode 100644 index 000000000..804fcc7fd --- /dev/null +++ b/spec/helpers/admin_helper_spec.rb @@ -0,0 +1,21 @@ +require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') + +describe AdminHelper do + + include AdminHelper + + describe :comment_visibility do + + it 'shows the status of a visible comment' do + comment = Factory.build(:visible_comment) + comment_visibility(comment).should == 'Visible' + end + + it 'shows the status of a hidden comment' do + comment = Factory.build(:hidden_comment) + comment_visibility(comment).should == 'Hidden' + end + + end + +end -- cgit v1.2.3