Skip to content

Commit 692f387

Browse files
committed
Add spec for systemCodes
1 parent 063fef1 commit 692f387

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

lib/interscript-api/graphql/types/query_type.rb

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def info
4141
# interscript_version: InterscriptApi::INTERSCRIPT_VERSION
4242
# })
4343
JSON.generate({
44-
limit: InterscriptApi::LIMITS[:input_max_size],
44+
# limit: InterscriptApi::LIMITS[:input_max_size],
4545
interscript_version: InterscriptApi::VERSION
4646
})
4747
end
@@ -51,13 +51,16 @@ def info
5151
# end
5252

5353
def system_codes
54-
spec = Gem::Specification.find_by_name("interscript")
55-
gem_root = spec.gem_dir
56-
57-
maps_root = "#{gem_root}/maps"
58-
Dir.entries(maps_root).
59-
select { |file| file.end_with?(".yaml") }.
60-
map { |file| File.basename(file, ".yaml") }
54+
# Interscript.map_locations
55+
# spec = Gem::Specification.find_by_name("interscript")
56+
# gem_root = spec.gem_dir
57+
#
58+
# maps_root = "#{gem_root}/maps"
59+
# maps_root = Interscript.map_aliases
60+
# Dir.entries(maps_root).
61+
# select { |file| file.end_with?(".yaml") }.
62+
# map { |file| File.basename(file, ".yaml") }
63+
["not supported for now"]
6164
end
6265
end
6366

spec/interscript-api/lambda_function_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@
1414
expect(rs).to eql("Mikhail Timofeyevich Kalashnikov")
1515
end
1616

17+
it "should print system_codes" do
18+
ENV['INTERSCRIPT_STAGING'] = '1'
19+
event = {
20+
"body" => '{systemCodes}'
21+
}
22+
rs = handler(event: event)
23+
# rs = JSON.parse(rs[:body])["data"]
24+
puts rs
25+
# expect(rs).to eql("Mikhail Timofeyevich Kalashnikov")
26+
end
1727
end
1828

1929
context "Cross origin input" do

0 commit comments

Comments
 (0)