From 5d25cf1625c9e99aeb94e3eae59b65ae3689f4ac Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Wed, 1 Aug 2018 16:26:43 +0900 Subject: [PATCH] Add test/controllers/polling_controller_test.rb Signed-off-by: Kenji Okimoto --- test/controllers/polling_controller_test.rb | 29 +++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/controllers/polling_controller_test.rb diff --git a/test/controllers/polling_controller_test.rb b/test/controllers/polling_controller_test.rb new file mode 100644 index 0000000..1dfe5e7 --- /dev/null +++ b/test/controllers/polling_controller_test.rb @@ -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