aboutsummaryrefslogtreecommitdiffstats
path: root/spec/helpers/widget_helper_spec.rb
blob: c8c41b14f3141d2ff1e3b34f7cf7e667ffcec717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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