Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/appfigures.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def product_sales
'store_name' => hash['product']['store_name'],
'name' => hash['product']['name'],
'sku' => hash['product']['sku'],
'ref_no' => hash['product']['ref_no'],
'added_timestamp' => Date.parse(hash['product']['added_timestamp']),
'icon' => hash['product']['icon'],
'downloads' => hash['downloads'].to_i,
'returns' => hash['returns'].to_i,
'updates' => hash['updates'].to_i,
Expand Down
9 changes: 9 additions & 0 deletions spec/product_sales_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,14 @@
it 'returns a revenue number' do
expect(@api.product_sales.first.revenue).to eq(100.99)
end
it 'returns a ref_no' do
expect(@api.product_sales.first.ref_no).to eq('536354432')
end
it 'returns an added timestamp' do
expect(@api.product_sales.first.added_timestamp).to eq(Date.parse('2012-07-23T00:00:00'))
end
it 'returns an icon' do
expect(@api.product_sales.first.icon).to eq('http://a5.mzstatic.com/us/r1000/091/Purple/v4/20/69/65/20696562-4e19-17fe-5ffe-cb77a78e1651/mzl.jtpselsb.png')
end

end