Skip to content

Commit

Permalink
Merge pull request #151 from rubyforgood/api_demo_data
Browse files Browse the repository at this point in the history
#146 Api demo data
  • Loading branch information
abachman authored May 31, 2024
2 parents ca2381e + f5c8fb3 commit 7dbba10
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/jobs/stock_prices_update_job.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class StockPricesUpdateJob < ApplicationJob
queue_as :default

def perform(*args)
# For each stock symbol, request the latest closing cost
# update the stocks table with each new closing cost
end
end
14 changes: 14 additions & 0 deletions test/data/global_quote_ibm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"Global Quote": {
"01. symbol": "IBM",
"02. open": "165.5600",
"03. high": "166.7300",
"04. low": "164.2300",
"05. price": "165.6300",
"06. volume": "3852963",
"07. latest trading day": "2024-05-30",
"08. previous close": "167.0500",
"09. change": "-1.4200",
"10. change percent": "-0.8500%"
}
}
14 changes: 14 additions & 0 deletions test/data/global_quote_shz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"Global Quote": {
"01. symbol": "300135.SHZ",
"02. open": "2.4700",
"03. high": "2.5100",
"04. low": "2.3900",
"05. price": "2.4400",
"06. volume": "38891270",
"07. latest trading day": "2024-03-01",
"08. previous close": "2.4500",
"09. change": "-0.0100",
"10. change percent": "-0.4082%"
}
}
7 changes: 7 additions & 0 deletions test/jobs/stock_prices_update_job_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require "test_helper"

class StockPricesUpdateJobTest < ActiveJob::TestCase
# test "the truth" do
# assert true
# end
end

0 comments on commit 7dbba10

Please sign in to comment.