Sha256: b70ffd787e486fad2feab8e008090fa1013c6ed1b2adcaa0a445a66ff80948d8

Contents?: true

Size: 1.01 KB

Versions: 31

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'

describe PluginDecorator do
  let(:decorated_plugin) { build(:plugin).decorate }

  describe "#status" do
    subject { decorated_plugin.status }

    context "plugin is processing" do
      before { decorated_plugin.stub(:processing?).and_return(true) }

      it "returns the term for processing" do
        expect(subject).to eq I18n.t("terms.processing")
      end
    end

    context "plugin isn't while processing" do
      before { decorated_plugin.stub(:processing?).and_return(false) }

      context "plugin is already installed" do
        before { decorated_plugin.stub(:installed?).and_return(true) }

        it "returns the term for installed" do
          expect(subject).to eq I18n.t("terms.installed")
        end
      end

      context "plugin isn't installed yet" do
        before { decorated_plugin.stub(:installed?).and_return(false) }

        it "returns the term for not installed" do
          expect(subject).to eq I18n.t("terms.not_installed")
        end
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
fluentd-ui-1.0.0.beta.1 spec/decorators/plugin_decorator_spec.rb
fluentd-ui-1.0.0.alpha.3 spec/decorators/plugin_decorator_spec.rb
fluentd-ui-1.0.0.alpha.2 spec/decorators/plugin_decorator_spec.rb
fluentd-ui-1.0.0.alpha.1 spec/decorators/plugin_decorator_spec.rb
fluentd-ui-0.4.5 spec/decorators/plugin_decorator_spec.rb
fluentd-ui-0.4.4 spec/decorators/plugin_decorator_spec.rb
fluentd-ui-0.4.3 spec/decorators/plugin_decorator_spec.rb
fluentd-ui-0.4.2 spec/decorators/plugin_decorator_spec.rb
fluentd-ui-0.4.1 spec/decorators/plugin_decorator_spec.rb
fluentd-ui-0.4.0 spec/decorators/plugin_decorator_spec.rb
fluentd-ui-0.3.21 spec/decorators/plugin_decorator_spec.rb
fluentd-ui-0.3.20 spec/decorators/plugin_decorator_spec.rb
fluentd-ui-0.3.19 spec/decorators/plugin_decorator_spec.rb
fluentd-ui-0.3.18 spec/decorators/plugin_decorator_spec.rb
fluentd-ui-0.3.17 spec/decorators/plugin_decorator_spec.rb
fluentd-ui-0.3.16 spec/decorators/plugin_decorator_spec.rb
fluentd-ui-0.3.15 spec/decorators/plugin_decorator_spec.rb
fluentd-ui-0.3.14 spec/decorators/plugin_decorator_spec.rb
fluentd-ui-0.3.13 spec/decorators/plugin_decorator_spec.rb
fluentd-ui-0.3.12 spec/decorators/plugin_decorator_spec.rb