Sha256: 107ee3e35b7a52ab7214b07f7168c560596d92a3cef37bc70275ffd1b0281cb0

Contents?: true

Size: 974 Bytes

Versions: 16

Compression:

Stored size: 974 Bytes

Contents

require 'spec_helper'

describe PollingController do
  describe 'polling for alerts' do
    before do
      allow(controller).to receive(:current_user).and_return true
    end

    after do
      response.should be_success
    end

    it 'may find nothing' do
      expect(controller).to receive(:uninstalling_gems).and_return []
      expect(controller).to receive(:installing_gems).and_return []
      get :alerts
    end

    it 'may find gems being uninstalled' do
      expect(controller).to receive(:uninstalling_gems).and_return [
        double(gem_name: "foobar", version: "1.0.0")
      ]

      allow(controller).to receive(:installing_gems).and_return []

      get :alerts
    end

    it 'may find gems being installed' do
      expect(controller).to receive(:installing_gems).and_return [
        double(gem_name: "bazbang", version: "0.0.1")
      ]

      allow(controller).to receive(:uninstalling_gems).and_return []

      get :alerts
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
fluentd-ui-0.4.5 spec/controllers/polling_controller_spec.rb
fluentd-ui-0.4.4 spec/controllers/polling_controller_spec.rb
fluentd-ui-0.4.3 spec/controllers/polling_controller_spec.rb
fluentd-ui-0.4.2 spec/controllers/polling_controller_spec.rb
fluentd-ui-0.4.1 spec/controllers/polling_controller_spec.rb
fluentd-ui-0.4.0 spec/controllers/polling_controller_spec.rb
fluentd-ui-0.3.21 spec/controllers/polling_controller_spec.rb
fluentd-ui-0.3.20 spec/controllers/polling_controller_spec.rb
fluentd-ui-0.3.19 spec/controllers/polling_controller_spec.rb
fluentd-ui-0.3.18 spec/controllers/polling_controller_spec.rb
fluentd-ui-0.3.17 spec/controllers/polling_controller_spec.rb
fluentd-ui-0.3.16 spec/controllers/polling_controller_spec.rb
fluentd-ui-0.3.15 spec/controllers/polling_controller_spec.rb
fluentd-ui-0.3.14 spec/controllers/polling_controller_spec.rb
fluentd-ui-0.3.13 spec/controllers/polling_controller_spec.rb
fluentd-ui-0.3.12 spec/controllers/polling_controller_spec.rb