spec/lib/hyperion/test_spec.rb in hyperion_http-0.2.4 vs spec/lib/hyperion/test_spec.rb in hyperion_http-0.3.0

- old
+ new

@@ -208,9 +208,21 @@ # restating a route routes that uses headers to differentiate replaces it (last one wins) result = Hyperion.request(RestRoute.new(:get, 'http://somesite.org/users/0', user_response_params)) expect(result.body).to eql({'user' => 'new user'}) end + it 'forgets routes after being reset' do + Hyperion.fake('https://www.google.com') do |svr| + svr.allow(:get, '/webhp') { 'fake google' } + end + result = Hyperion.request(RestRoute.new(:get, 'https://www.google.com/webhp')) + expect(result.body).to include 'fake google' + Hyperion.reset + result = Hyperion.request(RestRoute.new(:get, 'https://www.google.com/webhp')) + expect(result.status).to eql HyperionStatus::SUCCESS + expect(result.body).to include 'Google Search' + end + def success_response(body) [200, {'Content-Type' => 'application/json'}, write(body, :json)] end def expect_success(result, body)