diff options
Diffstat (limited to 'spec/helpers/widget_helper_spec.rb')
-rw-r--r-- | spec/helpers/widget_helper_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/helpers/widget_helper_spec.rb b/spec/helpers/widget_helper_spec.rb new file mode 100644 index 000000000..614ed92ad --- /dev/null +++ b/spec/helpers/widget_helper_spec.rb @@ -0,0 +1,29 @@ +# -*- encoding : utf-8 -*- +require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') + +describe WidgetHelper do + + include WidgetHelper + + describe :status_description do + + before do + @info_request = FactoryGirl.build(:info_request) + end + + it 'should return "Awaiting classification" for "waiting_classification' do + expect(status_description(@info_request, 'waiting_classification')).to eq('Awaiting classification') + end + + it 'should call theme_display_status for a theme status' do + @info_request.stub!(:theme_display_status).and_return("Special status") + expect(status_description(@info_request, 'special_status')).to eq('Special status') + end + + it 'should return unknown for an unknown status' do + expect(status_description(@info_request, 'special_status')).to eq('Unknown') + end + + end + +end |