Sha256: 9bf6f793d0325652a9e74a32b4b50231a23e561908bb4b2009269a6e21b49642

Contents?: true

Size: 977 Bytes

Versions: 4

Compression:

Stored size: 977 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_successful
    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

4 entries across 4 versions & 1 rubygems

Version Path
fluentd-ui-1.0.0.beta.1 spec/controllers/polling_controller_spec.rb
fluentd-ui-1.0.0.alpha.3 spec/controllers/polling_controller_spec.rb
fluentd-ui-1.0.0.alpha.2 spec/controllers/polling_controller_spec.rb
fluentd-ui-1.0.0.alpha.1 spec/controllers/polling_controller_spec.rb