sumoheavy / jira-ruby

A Ruby gem for the JIRA REST API
MIT License
654 stars 412 forks source link

Upgrade webmock #430

Closed bobbrodie closed 4 months ago

bobbrodie commented 5 months ago

It would be worth upgrading webmock, which will require changes to resolve WebMock::NetConnectNotAllowedError:

  1) JIRA::Resource::Attachment it should behave like a resource with a singular GET endpoint GETs a single resource
     Failure/Error: response = basic_auth_http_conn.request(request)

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://localhost:2990/jira/rest/api/2/issue/10002/attachments/10000 with headers {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization'=>'Basic Zm9vOmJhcg==', 'User-Agent'=>'Ruby'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://localhost:2990/jira/rest/api/2/issue/10002/attachments/10000").
         with(
           headers: {
          'Accept'=>'application/json',
          'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
          'Authorization'=>'Basic Zm9vOmJhcg==',
          'User-Agent'=>'Ruby'
           }).
         to_return(status: 200, body: "", headers: {})

       registered request stubs:

       stub_request(:get, "http://foo:bar@localhost:2990/jira/rest/api/2/issue/10002/attachments/10000")

       ============================================================