Sha256: b08e8249fef54578ca652f958859e93cf8cb105c92577459ccb54cbbef4550c6

Contents?: true

Size: 1.19 KB

Versions: 36

Compression:

Stored size: 1.19 KB

Contents

require 'spec_helper'

describe WoopleTheme::Dashboard::StatusAlertPresenter do
  describe '#css_class' do
    context 'red status' do
      subject do
        data = OpenStruct.new({ color: :red, description: 'FOO' })
        WoopleTheme::Dashboard::StatusAlertPresenter.new(data).css_class
      end

      it 'returns alert-error' do
        should eq('alert-error')
      end
    end

    context 'yellow status' do
      subject do
        data = OpenStruct.new({ color: :yellow, description: 'FOO' })
        WoopleTheme::Dashboard::StatusAlertPresenter.new(data).css_class
      end

      it 'returns nil' do
        should be_nil
      end
    end

    context 'green status' do
      subject do
        data = OpenStruct.new({ color: :green, description: 'FOO' })
        WoopleTheme::Dashboard::StatusAlertPresenter.new(data).css_class
      end

      it 'returns alert-success' do
        should eq('alert-success')
      end
    end
  end

  describe '#color' do
    subject do
      data = OpenStruct.new({ color: :red, description: 'FOO' })
      WoopleTheme::Dashboard::StatusAlertPresenter.new(data).color
    end

    it 'returns a capitalized string' do
      should eq('Red')
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
woople-theme-0.8.1 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.8.0 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.6.27 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.6.26 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.6.25 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.6.24 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.6.23 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.6.22 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.6.21 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.6.20 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.6.19 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.6.18 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.6.17 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.6.14 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.6.13 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.6.12 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb