diff options
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/admin_helper_spec.rb | 1 | ||||
-rw-r--r-- | spec/helpers/application_helper_spec.rb | 1 | ||||
-rw-r--r-- | spec/helpers/date_time_helper_spec.rb | 1 | ||||
-rw-r--r-- | spec/helpers/health_checks_helper_spec.rb | 6 | ||||
-rw-r--r-- | spec/helpers/highlight_helper_spec.rb | 1 | ||||
-rw-r--r-- | spec/helpers/link_to_helper_spec.rb | 1 | ||||
-rw-r--r-- | spec/helpers/public_body_helper_spec.rb | 2 | ||||
-rw-r--r-- | spec/helpers/track_helper_spec.rb | 1 | ||||
-rw-r--r-- | spec/helpers/widget_helper_spec.rb | 29 |
9 files changed, 42 insertions, 1 deletions
diff --git a/spec/helpers/admin_helper_spec.rb b/spec/helpers/admin_helper_spec.rb index 804fcc7fd..1f0155c98 100644 --- a/spec/helpers/admin_helper_spec.rb +++ b/spec/helpers/admin_helper_spec.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe AdminHelper do diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 6407eaf3a..2035c343a 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe ApplicationHelper do diff --git a/spec/helpers/date_time_helper_spec.rb b/spec/helpers/date_time_helper_spec.rb index c4fdee1d1..f69a0ef80 100644 --- a/spec/helpers/date_time_helper_spec.rb +++ b/spec/helpers/date_time_helper_spec.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe DateTimeHelper do diff --git a/spec/helpers/health_checks_helper_spec.rb b/spec/helpers/health_checks_helper_spec.rb index 7d4083da5..9418864b5 100644 --- a/spec/helpers/health_checks_helper_spec.rb +++ b/spec/helpers/health_checks_helper_spec.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe HealthChecksHelper do @@ -10,6 +11,11 @@ describe HealthChecksHelper do expect(check_status(check)).to include('red') end + it 'sets style to a blank string if ok' do + check = double(:message => '', :ok? => true) + expect(check_status(check)).to include('style=""') + end + end end diff --git a/spec/helpers/highlight_helper_spec.rb b/spec/helpers/highlight_helper_spec.rb index e1be7e153..2641a4400 100644 --- a/spec/helpers/highlight_helper_spec.rb +++ b/spec/helpers/highlight_helper_spec.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe HighlightHelper do diff --git a/spec/helpers/link_to_helper_spec.rb b/spec/helpers/link_to_helper_spec.rb index 261e1ef3e..fbb0c2313 100644 --- a/spec/helpers/link_to_helper_spec.rb +++ b/spec/helpers/link_to_helper_spec.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe LinkToHelper do diff --git a/spec/helpers/public_body_helper_spec.rb b/spec/helpers/public_body_helper_spec.rb index d4f3acf78..8db07b979 100644 --- a/spec/helpers/public_body_helper_spec.rb +++ b/spec/helpers/public_body_helper_spec.rb @@ -1,4 +1,4 @@ -# encoding: UTF-8 +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe PublicBodyHelper do diff --git a/spec/helpers/track_helper_spec.rb b/spec/helpers/track_helper_spec.rb index b6252ab39..bc1266338 100644 --- a/spec/helpers/track_helper_spec.rb +++ b/spec/helpers/track_helper_spec.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe TrackHelper do 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 |