diff --git a/lib/tasks/dummy_gem_records.csv b/lib/dummy_gem_records.csv similarity index 100% rename from lib/tasks/dummy_gem_records.csv rename to lib/dummy_gem_records.csv diff --git a/lib/tasks/gem_records_csv.rake b/lib/tasks/gem_records_csv.rake index a7fb311..7543cbf 100644 --- a/lib/tasks/gem_records_csv.rake +++ b/lib/tasks/gem_records_csv.rake @@ -9,6 +9,6 @@ namespace :gem_records_csv do task load: :environment do GemRecord.delete_all gem_load = LoadGemRecordsCSV.new - gem_load.load_csv('dummy_gem_records.csv') + gem_load.load_csv('lib/dummy_gem_records.csv') end end diff --git a/lib/tasks/load_gem_records_csv.rb b/lib/tasks/load_gem_records_csv.rb index ae93e83..b5a6fbf 100644 --- a/lib/tasks/load_gem_records_csv.rb +++ b/lib/tasks/load_gem_records_csv.rb @@ -11,8 +11,6 @@ class LoadGemRecordsCSV def load_csv(filename) count = 0 - filename = File.join(File.dirname(__FILE__), filename) - CSV.foreach(filename, headers: true) do |row| seqgradevent = row['seqgradevent'].strip unless GemRecord.find_by_seqgradevent(seqgradevent) diff --git a/test/helpers/load_gem_records_test.rb b/test/helpers/load_gem_records_test.rb index b234f99..c396804 100644 --- a/test/helpers/load_gem_records_test.rb +++ b/test/helpers/load_gem_records_test.rb @@ -4,7 +4,7 @@ class LoadGemRecordsTest < ActiveSupport::TestCase setup do gem_load = LoadGemRecordsCSV.new - gem_load.load_csv('dummy_gem_records.csv') + gem_load.load_csv('lib/dummy_gem_records.csv') end should "parse csv" do