test/angelo/mustermann_spec.rb in angelo-0.5.0 vs test/angelo/mustermann_spec.rb in angelo-0.5.1

- old
+ new

@@ -14,11 +14,11 @@ get pattern do params end - [:post, :put].each do |m| + [:patch, :post, :put].each do |m| __send__ m, pattern do params end end @@ -37,11 +37,11 @@ end it 'overrides post body params' do path = '/some/things/are_good' headers = {Angelo::CONTENT_TYPE_HEADER_KEY => Angelo::JSON_TYPE} - [:post, :put].each do |m| + [:patch, :post, :put].each do |m| __send__ m, path, {foo: 'other', bar: 'are_bad'}.to_json, headers last_response_must_be_json mm_pattern.params(path) end end @@ -99,20 +99,20 @@ @foo = params[:foo] end content_type :json - [:get, :post, :put].each do |m| + [:get, :patch, :post, :put].each do |m| __send__ m, '/before/:bar' do { bar: params[:bar], foo: params[:foo], foo_from_before: @foo } end end end it 'does not infect route block params with filter pattern params' do - [:get, :post, :put].each do |m| + [:get, :patch, :post, :put].each do |m| __send__ m, '/before/hi' last_response_must_be_json 'bar' => 'hi', 'foo' => nil, 'foo_from_before' => 'hi' end end @@ -129,11 +129,11 @@ before path: '/before*' do @bar = params[:bar] if @foo @bat = params[:bat] if @foo end - [:get, :post, :put].each do |m| + [:get, :patch, :post, :put].each do |m| __send__ m, '/before' do content_type :json { foo: @foo, bar: @bar, bat: @bat }.select {|k,v| !v.nil?} end @@ -154,18 +154,18 @@ it 'runs wildcarded before filters' do get '/before_bar', obj last_response_must_be_json obj_s - [:post, :put].each do |m| + [:patch, :post, :put].each do |m| __send__ m, '/before_bar', obj.to_json, {Angelo::CONTENT_TYPE_HEADER_KEY => Angelo::JSON_TYPE} last_response_must_be_json obj end get '/before_bat', obj last_response_must_be_json obj_s - [:post, :put].each do |m| + [:patch, :post, :put].each do |m| __send__ m, '/before_bat', obj.to_json, {Angelo::CONTENT_TYPE_HEADER_KEY => Angelo::JSON_TYPE} last_response_must_be_json obj end end