Skip to content

Instantly share code, notes, and snippets.

@futurechimp
Created February 17, 2012 14:11
Show Gist options
  • Save futurechimp/1853636 to your computer and use it in GitHub Desktop.
Save futurechimp/1853636 to your computer and use it in GitHub Desktop.
PADRINO_ENV = 'test' unless defined?(PADRINO_ENV)
require File.expand_path('../../config/boot', __FILE__)
require 'minitest/matchers'
require 'valid_attribute'
require 'valid_attribute/minitest'
require PADRINO_ROOT + '/test/blueprints'
class MiniTest::Spec
include Rack::Test::Methods
include ::ValidAttribute::Method
# This is needed in order to make state_machine ActiveRecord validation
# error messages work properly in the test environment.
#
I18n.reload!
def login_as(user)
post "/auth/developer/callback", {
:email => user.email, :name => user.name
}
follow_redirect!
end
def app
##
# You can handle all padrino applications using instead:
# Padrino.application
Super8.tap { |app| }
end
def video_upload
Rack::Test::UploadedFile.new("test/fixtures/fight_test.wmv")
end
def text_upload
Rack::Test::UploadedFile.new("test/fixtures/foo.txt")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment