fluentd-ui/spec/controllers/polling_controller_spec.rb
Kenji Okimoto ca76a1e6f9 Suppress deprecation warning
> DEPRECATION WARNING: The success? predicate is deprecated and will
> be removed in Rails 6.0. Please use successful? as provided by
> Rack::Response::Helpers.

Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
2018-05-21 17:43:52 +09:00

40 lines
977 B
Ruby

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