Sha256: 16d14e32e41c5423e0dbab66863b68655c47ad4a4718e0569e8a8696e4fa6804
Contents?: true
Size: 1.93 KB
Versions: 84
Compression:
Stored size: 1.93 KB
Contents
require 'spec_helper' require 'acceptance/webmock_shared' if RUBY_PLATFORM =~ /java/ require 'acceptance/manticore/manticore_spec_helper' describe "Manticore" do include ManticoreSpecHelper include_context "with WebMock", :no_status_message context "calling http methods on Manticore directly using Manticore's facade" do it "handles GET" do stub_request(:get, "http://example-foo.com").to_return(:status => 301) response = Manticore.get("http://example-foo.com") expect(response.code).to eq(301) end it "handles POST" do stub_request(:post, "http://example-foo.com").to_return(:status => 201) response = Manticore.post("http://example-foo.com", {:hello => "world"}) expect(response.code).to eq(201) end it "handles PUT" do stub_request(:put, "http://example-foo.com").to_return(:status => 409) response = Manticore.put("http://example-foo.com", {:hello => "world"}) expect(response.code).to eq(409) end it "handles PATCH" do stub_request(:patch, "http://example-foo.com").to_return(:status => 409) response = Manticore.patch("http://example-foo.com", {:hello => "world"}) expect(response.code).to eq(409) end it "handles DELETE" do stub_request(:delete, "http://example-foo.com").to_return(:status => 204) response = Manticore.delete("http://example-foo.com", {:id => 1}) expect(response.code).to eq(204) end it "handles OPTIONS" do stub_request(:options, "http://example-foo.com").to_return(:status => 200) response = Manticore.options("http://example-foo.com") expect(response.code).to eq(200) end it "handles HEAD" do stub_request(:head, "http://example-foo.com").to_return(:status => 204) response = Manticore.head("http://example-foo.com") expect(response.code).to eq(204) end end end end
Version data entries
84 entries across 84 versions & 6 rubygems