-
-
Save lmansur/f4cd08e00e8821a93f2b8b2a4a42ffe3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rails_helper' | |
describe CsvHandler::TotalRevenue do | |
describe '#total_revenue' do | |
before do | |
@import = CsvHandler::ImportData.new('public', 'purchases.csv') | |
@import.import | |
@revenue = CsvHandler::TotalRevenue.new('public', 'purchases.csv') | |
end | |
context 'given a purchase file' do | |
it 'calculates total revenue and updates db' do | |
expect{ @revenue.total_revenue }.to change(Import.last, :total_revenue) | |
end | |
end | |
end | |
end |
Author
lmansur
commented
Oct 29, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment