|
8 | 8 | end |
9 | 9 |
|
10 | 10 | describe ".state_code_to_name_map" do |
11 | | - it "returns a map of all the state codes to state names" do |
12 | | - result = { |
13 | | - "az" => "Arizona", |
14 | | - "md" => "Maryland", |
15 | | - "nc" => "North Carolina", |
16 | | - "nj" => "New Jersey", |
17 | | - "ny" => "New York", |
18 | | - "id" => "Idaho", |
19 | | - } |
20 | | - expect(described_class.state_code_to_name_map).to eq result |
| 11 | + it "returns a map of all the state codes to state names in English by default" do |
| 12 | + I18n.with_locale(:en) do |
| 13 | + result = { |
| 14 | + "az" => "Arizona", |
| 15 | + "md" => "Maryland", |
| 16 | + "nc" => "North Carolina", |
| 17 | + "nj" => "New Jersey", |
| 18 | + "ny" => "New York", |
| 19 | + "id" => "Idaho", |
| 20 | + } |
| 21 | + |
| 22 | + expect(described_class.state_code_to_name_map).to eq(result) |
| 23 | + end |
| 24 | + end |
| 25 | + |
| 26 | + it "is locale aware and returns localized state names for the current locale" do |
| 27 | + I18n.with_locale(:es) do |
| 28 | + result = { |
| 29 | + "az" => I18n.t("state_file.state_information_service.az.state_name"), |
| 30 | + "md" => I18n.t("state_file.state_information_service.md.state_name"), |
| 31 | + "nc" => I18n.t("state_file.state_information_service.nc.state_name"), |
| 32 | + "nj" => I18n.t("state_file.state_information_service.nj.state_name"), |
| 33 | + "ny" => I18n.t("state_file.state_information_service.ny.state_name"), |
| 34 | + "id" => I18n.t("state_file.state_information_service.id.state_name"), |
| 35 | + } |
| 36 | + |
| 37 | + expect(described_class.state_code_to_name_map).to eq(result) |
| 38 | + end |
21 | 39 | end |
22 | 40 | end |
23 | 41 |
|
24 | 42 | describe ".state_intake_classes" do |
25 | 43 | it "returns an array of the intake classes" do |
26 | | - expect(described_class.state_intake_classes).to match_array [StateFileAzIntake, StateFileIdIntake, StateFileMdIntake, StateFileNcIntake, StateFileNjIntake, StateFileNyIntake] |
| 44 | + expect(described_class.state_intake_classes).to match_array [ |
| 45 | + StateFileAzIntake, |
| 46 | + StateFileIdIntake, |
| 47 | + StateFileMdIntake, |
| 48 | + StateFileNcIntake, |
| 49 | + StateFileNjIntake, |
| 50 | + StateFileNyIntake, |
| 51 | + ] |
27 | 52 | end |
28 | 53 | end |
29 | 54 |
|
30 | 55 | describe ".state_intake_class_names" do |
31 | 56 | it "returns an array of the intake classes as strings" do |
32 | | - expect(described_class.state_intake_class_names).to match_array ["StateFileAzIntake", "StateFileIdIntake", "StateFileMdIntake", "StateFileNcIntake", "StateFileNjIntake", "StateFileNyIntake"] |
| 57 | + expect(described_class.state_intake_class_names).to match_array [ |
| 58 | + "StateFileAzIntake", |
| 59 | + "StateFileIdIntake", |
| 60 | + "StateFileMdIntake", |
| 61 | + "StateFileNcIntake", |
| 62 | + "StateFileNjIntake", |
| 63 | + "StateFileNyIntake", |
| 64 | + ] |
33 | 65 | end |
34 | 66 | end |
35 | 67 |
|
|
0 commit comments