OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/spec/spec_helper.rb

38 lines
1.2 KiB

require 'spec_helper'
# prevent case where we are using rubygems and test-unit 2.x is installed
begin
require 'rubygems'
gem "test-unit", "~> 1.2.3"
rescue LoadError
end
def l(*args)
I18n.t(*args)
end
ENGINE_RAILS_ROOT = File.join(File.dirname(__FILE__), '../')
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[File.join(ENGINE_RAILS_ROOT, "spec/support/**/*.rb")].each {|f| require f }
# not sure whether these are required - commenting them out for now
# - mfrister
# require File.join(RAILS_ROOT, "test", "object_daddy_helpers.rb")
# Dir.glob(File.expand_path("#{__FILE__}/../../../redmine_costs/test/exemplars/*.rb")) { |e| require e }
# Dir.glob(File.expand_path("#{__FILE__}/../models/helpers/*_helper.rb")) { |e| require e }
def login_user(user)
@controller.send(:logged_user=, user)
@controller.stub!(:find_current_user).and_return(user)
end
def is_member(project, user, permissions = [])
role = FactoryGirl.create(:role, :permissions => permissions)
FactoryGirl.create(:member, :project => project,
:principal => user,
:roles => [role])
end