Module: Safubot::Test

Defined in:
lib/safubot/test_helper.rb

Class Method Summary (collapse)

Class Method Details

+ (Object) clean_environment



20
21
22
23
24
25
26
27
28
# File 'lib/safubot/test_helper.rb', line 20

def clean_environment
		MongoMapper.database = "safubot_testing"
  Request.destroy_all
		Query.destroy_all
  Response.destroy_all
		KnownUser.destroy_all
		Safubot::mode = :testing
  $bot = Safubot::Bot.new(:database => "safubot_testing")
end

+ (Object) request(text)



30
31
32
# File 'lib/safubot/test_helper.rb', line 30

def request(text)
		Query.create(:user => KnownUser.by_name('testing'), :text => text).make_request
end