foodsoft/test/test_helper.rb
2013-06-25 13:05:25 +02:00

23 lines
626 B
Ruby

ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
#
# Note: You'll currently still have to declare fixtures explicitly in integration tests
# -- they do not yet inherit this setting
fixtures :all
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
end