Skip to content

Commit

Permalink
fixes the master matrix rake due to hard coded year (#2459)
Browse files Browse the repository at this point in the history
Co-authored-by: Sri Harsha <sriharsha.poosa@gmail.com>
  • Loading branch information
utkarsh7989 and sri49 authored Oct 25, 2023
1 parent d8ea062 commit 84b3b03
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,10 @@ namespace :import do
result = Roo::Spreadsheet.open(file)
sheets = if year == 2017
["MA SHOP QHP"]
elsif year == 2018
["2018_QHP", "2018_QDP"]
elsif year == 2019
["2019_QHP", "2019_QDP"]
elsif year == 2020
["2020_QHP", "2020_QDP"]
elsif year == 2021
["2021_QHP", "2021_QDP"]
elsif year == 2022
["2022_QHP", "2022_QDP"]
elsif year == 2023
["2023_QHP", "2023_QDP"]
else
["#{year}_QHP", "#{year}_QDP"]
end

sheets.each do |sheet_name|
sheet_data = result.sheet(sheet_name)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
expect(@health_product2.provider_directory_url).to eq @row_info[14]
expect(@health_product2.product_package_kinds).to eq [:metal_level, :single_issuer, :single_product]
end

it "should access year from sheet name and update product attributes" do
expect(@sheet_data.default_sheet).to eq "2018_QHP"
expect(@health_product2.rx_formulary_url).to eq "http://#{@row_info[13]}"
end
end
end

Expand All @@ -86,6 +91,6 @@ def invoke_url_tasks

def read_excel(file)
result = Roo::Spreadsheet.open(file)
sheet_data = result.sheet("2018_QHP")
@row_info = sheet_data.row(2)
end
@sheet_data = result.sheet("2018_QHP")
@row_info = @sheet_data.row(2)
end

0 comments on commit 84b3b03

Please sign in to comment.