Add test/controllers/polling_controller_test.rb

Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
Kenji Okimoto 2018-08-01 16:26:43 +09:00
parent bc76f8c875
commit 5d25cf1625
No known key found for this signature in database
GPG Key ID: F9E3E329A5C5E4A1

View File

@ -0,0 +1,29 @@
require "test_helper"
class PollingControllerTest < ActionDispatch::IntegrationTest
setup do
user = FactoryBot.build(:user)
post(sessions_path(session: { name: user.name, password: user.password }))
end
test "may find nothing" do
stub(Plugin).installing { [] }
stub(Plugin).uninstalling { [] }
get(polling_alerts_path)
assert_response(:success)
end
test "may find gems being uninstalled" do
stub(Plugin).installing { [] }
stub(Plugin).uninstalling { [FactoryBot.build(:plugin)] }
get(polling_alerts_path)
assert_response(:success)
end
test "may find gems being installed" do
stub(Plugin).installing { [FactoryBot.build(:plugin)] }
stub(Plugin).uninstalling { [] }
get(polling_alerts_path)
assert_response(:success)
end
end