spec/support/stub_api.rb
def stub_api_request(http_method, path, status, path_params = {})
  api = "#{http_method.upcase} #{path} #{status}"
  case api
  # Subject APIs
  when "GET /articles 200"
    stub_request(:get, "https://dev.to/api/articles")
      .to_return(status: 200, body: file_fixture("responses/articles_get.json"))
  end
end
# TODO: fix this - my brain is too lazy atm
fix this - my brain is too lazy atm
fix this - my brain is too lazy atm
def stub_api_request(http_method, path, status, path_params = {})
  api = "#{http_method.upcase} #{path} #{status}"
  case api
  when "GET /articles 200"
    stub_request(:get, "https://dev.to/api/articles")
      .to_return(status: 200, body: file_fixture("responses/articles_get.json"))
  end
end
def stub_api_request ( http_method , path , status , path_params = { } ) api = "#{http_method.upcase} #{path} #{status}" case api when "GET /articles 200" stub_request ( :get , "https://dev.to/api/articles" ) . to_return ( status : 200 , body : file_fixture ( "responses/articles_get.json" ) ) end end
TODO: fix this - my brain is too lazy atm
TODO : fix this - my brain is too lazy atm
# Subject APIs
http_method
path
status
path_params