aboutsummaryrefslogtreecommitdiffstats
path: root/spec/helpers/widget_helper_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2015-04-28 10:12:16 +0100
committerLouise Crow <louise.crow@gmail.com>2015-04-28 10:12:16 +0100
commitc884121722919307984dd2080f01268b271ea1d7 (patch)
treeb5ddeca65d5d4b9c1724d1d87d6a6e6a2661b9c5 /spec/helpers/widget_helper_spec.rb
parentd1e666da6fde288bebaea9ade9a6978bcc796ece (diff)
parent527c0010cad17f043663ea21b8e58395eac72e02 (diff)
Merge branch 'add-widget' into rails-3-develop
Diffstat (limited to 'spec/helpers/widget_helper_spec.rb')
-rw-r--r--spec/helpers/widget_helper_spec.rb28
1 files changed, 28 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..c8c41b14f
--- /dev/null
+++ b/spec/helpers/widget_helper_spec.rb
@@ -0,0 +1,28 @@
+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 \ No newline at end of file