Skip to content

Instantly share code, notes, and snippets.

@akinsgre
Last active December 23, 2015 22:08
Show Gist options
  • Select an option

  • Save akinsgre/6700701 to your computer and use it in GitHub Desktop.

Select an option

Save akinsgre/6700701 to your computer and use it in GitHub Desktop.
db_user.emp_id = EmployeeID.find_by_Username(login).Employee #Returns 9999 in script/console... but 1806 in script/server
def after_initialize
require 'test/unit'
require 'mocha/setup'
require 'employee_id'
# dbconfig = YAML.load(File.read('config/database.yml'))
# ActiveRecord::Base.establish_connection dbconfig[ENV['RACK_ENV']||'development']
# @users = Array.new
# user = User.new
# user.login = 'akinsgp'
# user.email = 'g.akins@insomna-consulting.org'
# user.save
# @users << user
# User.stubs( :find_all_users_in_ad ).returns(@users)
EmployeeID.any_instance.stubs(:Employee).returns(9999)
puts "This sucks"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment