Features API GETD, [2016-10-14T17:24:34.771306 #21948] DEBUG -- : Calling API: FeaturesApi.features_get ... Trying ::1...Connected to localhost (::1) port 1234 (#0)GET /api/features?quiz_id=1 HTTP/1.1Host: localhost:1234User-Agent: Swagger-Codegen/1.0.0/rubyContent-Type: application/jsonAccept: application/json
HTTP/1.1 500 Internal Server ErrorContent-Type: application/jsonServer: WEBrick/1.3.1 (Ruby/2.3.1/2016-04-26)Date: Fri, 14 Oct 2016 21:24:34 GMTContent-Length: 89Connection: Keep-Alive
Connection #0 to host localhost left intactD, [2016-10-14T17:24:34.775727 #21948] DEBUG -- : HTTP response body ~BEGIN~{"message":"No interaction found for GET /api/features?quiz_id=1","interaction_diffs":[]}require_relative '../pact_helper'
RSpec.describe 'Features API', pact: true do let(:config) do config = SwaggerClient::Configuration.new config.scheme = 'http' config.base_path = '/api' config.host = 'localhost:1234' config.timeout = 5 config.debugging = true config.verify_ssl = false config.verify_ssl_host = false config end let(:client) { SwaggerClient::ApiClient.new(config) } subject { SwaggerClient::FeaturesApi.new(client) }
describe 'GET' do let(:opts) { { quiz_id: 1 } } let(:setup) do quiz_api.given('a quiz with features') .upon_receiving('a request for the quiz\'s features') .with(method: :get, path: '/features', query: opts) .will_respond_with( status: 200, headers: { 'Content-Type' => 'application/json' } ) end
# TODO: define spec it 'returns the features for the quiz' do # features = [] # expect(subject.features_get(opts)).to eq(features) result = subject.features_get(opts) p result end endend
Are you able to post the pact logs or even a runnable gist for us? I think you're right in that perhaps the interactions aren't being registered.
--
You received this message because you are subscribed to the Google Groups "Pact" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pact-support+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I, [2016-10-15T08:12:03.978996 #27363] INFO -- : Starting app Quiz API #<Pact::MockService::App:0x007f9d76f62aa0> on port 1234...I, [2016-10-15T08:12:04.094271 #27363] INFO -- : Started on port 1234I, [2016-10-15T08:12:04.121629 #27363] INFO -- : Clearing all expectationsI, [2016-10-15T08:12:04.129746 #27363] INFO -- : Verifying interactions for Features API GET returns the features for the quizD, [2016-10-15T08:12:04.135901 #27363] DEBUG -- : Supposed to be stoppingI, [2016-10-15T08:12:04.124551 #27363] INFO -- : Cleared interactions before example "Features API GET returns the features for the quiz"I, [2016-10-15T08:12:04.128838 #27363] INFO -- : Received request GET /api/features?quiz_id=1D, [2016-10-15T08:12:04.128954 #27363] DEBUG -- : { "path": "/api/features", "query": "quiz_id=1", "method": "get", "headers": { "Content-Type": "application/json", "Host": "localhost:1234", "User-Agent": "Swagger-Codegen/1.0.0/ruby", "Accept": "application/json", "Version": "HTTP/1.1" }}E, [2016-10-15T08:12:04.128995 #27363] ERROR -- : No matching interaction found for GET /api/features?quiz_id=1E, [2016-10-15T08:12:04.129007 #27363] ERROR -- : Interaction diffs for that route:E, [2016-10-15T08:12:04.129016 #27363] ERROR -- : W, [2016-10-15T08:12:04.132299 #27363] WARN -- : Verifying - actual interactions do not match expected interactions for example "Features API GET returns the features for the quiz". Unexpected requests: GET /api/features?quiz_id=1
W, [2016-10-15T08:12:04.132323 #27363] WARN -- : Unexpected requests: GET /api/features?quiz_id=1
I, [2016-10-15T08:12:04.135378 #27363] INFO -- : Writing pact with details {:consumer=>{:name=>"Swagger Client - Ruby"}, :provider=>{:name=>"Quiz API"}, :pactfile_write_mode=>"overwrite", :pact_dir=>"pacts/"}
To unsubscribe from this group and stop receiving emails from it, send an email to pact-support...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pact-support+unsubscribe@googlegroups.com.
let!(:setup)