module Safubot::Test

Public Class Methods

clean_environment() click to toggle source
# File lib/safubot/test_helper.rb, line 6
def clean_environment
          MongoMapper.database = "safubot_testing"
  Request.destroy_all
          Query.destroy_all
  Response.destroy_all
  $bot = Safubot.new({
    :database => "safubot_testing",
    :twitter_opts => {
      :username => "safubot",
      :consumer_key => "JgUdmeA1Q8GNm6o7iM6A",
      :consumer_secret => "wo7VKq4AGohHc4RgQEuWs1unjy7dtnKJn3Ojd4jPaA",
      :oauth_token => "391202224-jrdXljH8LxXdU1uz7QbSyRAU8VQId4p4soVJ3NWG",
      :oauth_token_secret => "j44x8UgMZfooPXrhm9XiuCDkWwqO0zHOsWgn8NoXw0"
    },
  })
end
request(text) click to toggle source
# File lib/safubot/test_helper.rb, line 23
def request(text)
      Query.create(:user => KnownUser.by_name('testing'), :text => text).make_request
end