2012-02-22 10:42:38 +00:00
|
|
|
# Configure Rails Environment
|
|
|
|
ENV["RAILS_ENV"] = "test"
|
2012-02-22 18:14:00 +00:00
|
|
|
$:.unshift File.expand_path('../../lib', __FILE__)
|
2012-02-22 10:42:38 +00:00
|
|
|
|
2012-02-27 13:49:34 +00:00
|
|
|
require 'rspec/mocks'
|
2012-02-22 18:14:00 +00:00
|
|
|
require 'minitest/autorun'
|
|
|
|
require 'active_support/test_case'
|
|
|
|
require 'rabl-fast-json'
|
2012-02-27 13:49:34 +00:00
|
|
|
|
|
|
|
module ActiveSupport
|
|
|
|
class TestCase
|
|
|
|
RSpec::Mocks::setup(self)
|
|
|
|
include RSpec::Mocks::ExampleMethods
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Context
|
|
|
|
attr_accessor :virtual_path
|
|
|
|
|
|
|
|
def initialize
|
|
|
|
@_assigns = {}
|
|
|
|
@virtual_path = '/users'
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_assign(key, value)
|
|
|
|
@_assigns[key] = value
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_assign(key)
|
|
|
|
@_assigns[key]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class User
|
|
|
|
attr_accessor :name
|
|
|
|
end
|