X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/37404e821668b6b9b1952a0a5a3b28901835884b..0a78f5a0efe0c88fddcd2ee91065f2a8da79055a:/apps/workbench/test/test_helper.rb diff --git a/apps/workbench/test/test_helper.rb b/apps/workbench/test/test_helper.rb index 3b6dc036a6..1195798312 100644 --- a/apps/workbench/test/test_helper.rb +++ b/apps/workbench/test/test_helper.rb @@ -22,6 +22,7 @@ end require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' +require 'mocha/mini_test' class ActiveSupport::TestCase # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in @@ -152,6 +153,26 @@ class ApiServerForTests end end +class ActionController::TestCase + setup do + @counter = 0 + end + + def check_counter action + @counter += 1 + if @counter == 2 + assert_equal 1, 2, "Multiple actions in functional test" + end + end + + [:get, :post, :put, :patch, :delete].each do |method| + define_method method do |action, *args| + check_counter action + super action, *args + end + end +end + if ENV["RAILS_ENV"].eql? 'test' ApiServerForTests.run end