2009-01-06 11:49:19 +01:00
|
|
|
ENV["RAILS_ENV"] = "test"
|
2011-05-11 01:32:21 +02:00
|
|
|
require File.expand_path('../../config/environment', __FILE__)
|
|
|
|
require 'rails/test_help'
|
2009-01-06 11:49:19 +01:00
|
|
|
|
2011-05-11 01:32:21 +02:00
|
|
|
class ActiveSupport::TestCase
|
|
|
|
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
2009-01-06 11:49:19 +01:00
|
|
|
#
|
2011-05-11 01:32:21 +02:00
|
|
|
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
|
|
|
# -- they do not yet inherit this setting
|
|
|
|
fixtures :all
|
2009-01-06 11:49:19 +01:00
|
|
|
|
2013-06-25 13:04:55 +02:00
|
|
|
def login(nick='admin', pass='secret')
|
|
|
|
open_session do |session|
|
|
|
|
session.post '/f/login', nick: nick, password: pass
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def logout
|
|
|
|
open_session do |session|
|
|
|
|
session.post '/f/logout'
|
|
|
|
end
|
|
|
|
end
|
2009-01-06 11:49:19 +01:00
|
|
|
end
|