Sha256: e42abd4fae194a78105d8085da865bcf3f65689780e586c1e62bd1bae55fdbcb

Contents?: true

Size: 847 Bytes

Versions: 12

Compression:

Stored size: 847 Bytes

Contents

require 'spec_helper'

describe "Http basics" do
  with_prepare_params
  inject environment: :environment, conveyors: :conveyors    
  
  isolate :conveyors
  
  before do
    rad.conveyors.web do |web|
      web.use Rad::Http::Processors::HttpWriter
      web.use Rad::Http::Processors::PrepareParams
      web.use Rad::Http::Processors::EvaluateFormat
    end
  end
    
  it "http call" do    
    workspace = nil

    rad.http.call rad.http.mock_environment do |c|      
      c.call
      workspace = rad.workspace
    end
    # .should == [200, {"Content-Type" => "text/html"}, ""]      
    
    workspace.delete(:env).should be_a(Hash)
    expected_result = {path: "/", response: [200, {"Content-Type" => "text/html"}, ""], params: {format: 'html'}}
    workspace.to_h.subset(expected_result.keys).should == expected_result      
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rad_core-0.0.25 spec/http/http_spec.rb
rad_core-0.0.24 spec/http/http_spec.rb
rad_core-0.0.23 spec/http/http_spec.rb
rad_core-0.0.22 spec/http/http_spec.rb
rad_core-0.0.21 spec/http/http_spec.rb
rad_core-0.0.20 spec/http/http_spec.rb
rad_core-0.0.19 spec/http/http_spec.rb
rad_core-0.0.18 spec/http/http_spec.rb
rad_core-0.0.17 spec/http/http_spec.rb
rad_core-0.0.16 spec/http/http_spec.rb
rad_core-0.0.15 spec/http/http_spec.rb
rad_core-0.0.14 spec/http/http_spec.rb