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
make_ssl_cert
_system('bundle', 'exec', 'rake', 'db:test:load')
_system('bundle', 'exec', 'rake', 'db:fixtures:load')
- _system('bundle', 'exec', 'passenger', 'start', '-d', '-p3001',
+ _system('bundle', 'exec', 'passenger', 'start', '-d', '-p3000',
'--pid-file', SERVER_PID_PATH,
'--ssl',
'--ssl-certificate', 'self-signed.pem',
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