Class: FakeMDEX
- Inherits:
-
Object
- Object
- FakeMDEX
- Extended by:
- WebMock::API
- Defined in:
- lib/mdex_client/fake_mdex/fake_mdex.rb
Constant Summary collapse
- WSDL_FILE =
File.("#{__FILE__}/../mdex.wsdl")
- NAVIGATION_RESULT_FILE =
File.("#{__FILE__}/../mdex_response.xml")
Class Method Summary collapse
Class Method Details
.navigation_result ⇒ Object
17 18 19 20 21 22 |
# File 'lib/mdex_client/fake_mdex/fake_mdex.rb', line 17 def self. xml = Nokogiri::XML.parse(File.new(NAVIGATION_RESULT_FILE)) result = xml.xpath("/env:Envelope/env:Body/mdata:Response/mdata:TypedResult/mdata:NavigationResults", MDEXClient::Client::NAMESPACES) MDEXClient::MData::NavigationResult.new(result) end |
.setup_stubs! ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/mdex_client/fake_mdex/fake_mdex.rb', line 9 def self.setup_stubs! stub_request(:post, %r{^https://(.*:.*@)?mdex.gively.com/ws/mdex}). to_return(:body => File.new(NAVIGATION_RESULT_FILE), :status => 200) stub_request(:get, %r{^https://(.*:.*@)?mdex.gively.com/ws/mdex}). to_return(:body => File.new(WSDL_FILE), :status => 200) end |