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.10.0 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.9.0 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.8.19 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.8.18 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.8.17 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.8.16 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.8.15 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.8.14 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.8.13 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.8.12 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.8.11 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.8.10 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.8.9 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.8.8 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.8.7 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.8.6 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.8.5 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.8.4 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.8.3 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb
woople-theme-0.8.2 spec/presenters/woople_theme/dashboard/status_alert_presenter_spec.rb