@@ -34,8 +34,7 @@ module TaiwanCity
end
def city(code)
- id_match = match(code)
- "#{id_match[1]}#{id_match[2]}".ljust(5, '0')
+ match(code)[1].ljust(5, '0')
private
@@ -4,7 +4,7 @@ describe TaiwanCity::DataController do
describe "GET 'show'" do
it "returns http success" do
- get 'show', id: '000', use_route: 'taiwan_city'
+ get 'show', id: '00000', use_route: 'taiwan_city'
response.should be_success