Sha256: 84ddfcb196b836401bacee689ac120407745563065ba00d3ee8bb0d2ad1f35ee
Contents?: true
Size: 819 Bytes
Versions: 12
Compression:
Stored size: 819 Bytes
Contents
require 'spec_helper' require 'cuba_api/response_status' class E def initialize( args = nil ) @errors = args.delete( :errors ) || {} @attributes = args end def deleted? @attrbutes.nil? end def errrors @errors end end describe CubaApi::ResponseStatus do before do Cuba.reset! Cuba.plugin CubaApi::ResponseStatus Cuba.plugin CubaApi::WriteAspect Cuba.define do on get do write E.new :errors => { :name => 'missing name' } end on post do write E.new :message => 'be happy' end on put do write E.new :message => 'be happy' end on delete do write E.new end end end it 'status 200' do _, _, resp = Cuba.call({'REQUEST_METHOD' => 'GET'}) resp.join.must.eq "" end end
Version data entries
12 entries across 12 versions & 1 rubygems