Sha256: 6ca8d4f7db9860161ba8cbd4dd8696f13b544977e3297c2be949aa816102411a

Contents?: true

Size: 633 Bytes

Versions: 50

Compression:

Stored size: 633 Bytes

Contents

require 'test/unit'
require 'arrest'
class ContextTest < Test::Unit::TestCase

  def setup
    Arrest::Source.source = nil
  end

  class Facility < Arrest::RootResource
  end
  

  class HeaderDeco
    def self.headers
      puts "MAAAAAHH"
      {}
    end
  end

  def test_context
    context = Arrest::RequestContext.new()
    context.header_decorator = HeaderDeco
    scope = Arrest::ScopedRoot.new(context)
    assert_not_nil scope.Facility
    assert_not_nil scope.Facility.all

    f0 = scope.Facility.new(:name => 'Foo')
    assert f0.save

    f1 = scope.Facility.all.first
    f2 = scope.Facility.find(f1.id)

  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
arrest-0.0.75 test/context.rb
arrest-0.0.74 test/context.rb
arrest-0.0.73 test/context.rb
arrest-0.0.72 test/context.rb
arrest-0.0.71 test/context.rb
arrest-0.0.70 test/context.rb
arrest-0.0.69 test/context.rb
arrest-0.0.68 test/context.rb
arrest-0.0.67 test/context.rb
arrest-0.0.66 test/context.rb
arrest-0.0.65 test/context.rb
arrest-0.0.64 test/context.rb
arrest-0.0.63 test/context.rb
arrest-0.0.62 test/context.rb
arrest-0.0.61 test/context.rb
arrest-0.0.60 test/context.rb
arrest-0.0.59 test/context.rb
arrest-0.0.58 test/context.rb
arrest-0.0.57 test/context.rb
arrest-0.0.56 test/context.rb