Skip to content

Commit f4032a8

Browse files
committed
Added spec for issue #70 (#70)
1 parent 95d7090 commit f4032a8

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

spec/revised_service_spec.rb

+21
Original file line numberDiff line numberDiff line change
@@ -304,4 +304,25 @@ module OData
304304
lambda { OData::Service.new "http://test.com/test.svc/", { :username => "xxxx\\yyyy", :password=> "zzzz", :verify_ssl => false, :namespace => "VMM" } }.should_not raise_error
305305
end
306306
end
307+
308+
describe "Dual Services" do
309+
before(:all) do
310+
stub_request(:get, "http://service1.com/test.svc/$metadata").
311+
with(:headers => DEFAULT_HEADERS).
312+
to_return(:status => 200, :body => File.new(File.expand_path("../fixtures/sample_service/edmx_categories_products.xml", __FILE__)), :headers => {})
313+
314+
stub_request(:get, "http://service2.com/test.svc/$metadata").
315+
with(:headers => DEFAULT_HEADERS).
316+
to_return(:status => 200, :body => File.new(File.expand_path("../fixtures/int64_ids/edmx_car_service.xml", __FILE__)), :headers => {})
317+
318+
319+
@service1 = OData::Service.new "http://service1.com/test.svc"
320+
@service2 = OData::Service.new "http://service2.com/test.svc"
321+
end
322+
323+
it "should use the correct service uri" do
324+
expect(@service1.class_metadata[:uri]).to eq 'http://service1.com/test.svc'
325+
expect(@service2.class_metadata[:uri]).to eq 'http://service2.com/test.svc'
326+
end
327+
end
307328
end

0 commit comments

Comments
 (0)