# Copyright (C) 2015 Centro de Computacao Cientifica e Software Livre # Departamento de Informatica - Universidade Federal do Parana # # This file is part of portalmec. # # portalmec is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # portalmec is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with portalmec. If not, see . ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' require 'minitest/mock' require 'minitest/reporters' # disable public activity gem for testing purpouses require 'public_activity/testing' class ActiveSupport::TestCase # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. fixtures :all # load seeds # Rails.application.load_seed # Add more helper methods to be used by all tests here... def assert_count(expected, actual = 0) assert_equal expected.to_i, actual.count end # authenticate requests using devise_token_auth def auth_request(user) auth_application sign_in user @request.headers.merge!(user.create_new_auth_token) end def auth_application @request.headers['PortalMEC-AppID'] = applications(:test_app).application_id end def mock MiniTest::Mock.new end # config.after :all do # ActiveRecord::Base.subclasses.each(&:delete_all) # end Minitest::Reporters.use! PublicActivity.enabled = false end