{"action":"created","comment":{"url":"https://api.github.com/repos/transitland/transitland-datastore/pulls/comments/49256641","id":49256641,"diff_hunk":"@@ -1,64 +1,50 @@\n+# Create a concrete class for testing\n+class TestOnestopId < OnestopId::OnestopIdBase\n+  PREFIX = :s\n+  MODEL = Stop\n+  NUM_COMPONENTS = 3\n+end\n+\n describe OnestopId do\n   it 'fails gracefully when given an invalid geometry' do\n     expect {\n-      OnestopId.new('Retiro Station', '-58.374722 -34.591389')\n+      TestOnestopId.new('Retiro Station', '-58.374722 -34.591389')\n     }.to raise_error(ArgumentError)\n \n     expect {\n-      OnestopId.new('Retiro Station', [-58.374722,-34.591389])\n+      TestOnestopId.new('Retiro Station', [-58.374722,-34.591389])\n     }.to raise_error(ArgumentError)\n   end\n \n-  context 'create' do\n+  context '#geohash' do\n     it 'filters geohashes' do\n       expect(\n-        OnestopId.new(entity_prefix: 's', geohash: 'a9q9', name: 'test').to_s\n+        TestOnestopId.new(entity_prefix: 's', geohash: 'a9q9', name: 'test').to_s\n       ).to eq('s-9q9-test')\n     end\n-    it 'filters names' do\n-      expect(\n-        OnestopId.new(entity_prefix: 's', geohash: '9q9', name: 'Foo Bar!').to_s\n-      ).to eq('s-9q9-foobar')\n-    end\n-    it 'filters names at' do\n-      expect(\n-        OnestopId.new(entity_prefix: 's', geohash: '9q9', name: 'foo@bar').to_s\n-      ).to eq('s-9q9-foo~bar')\n-    end\n   end\n \n-  context 'validation' do\n-    it 'must not be blank' do\n-      is_a_valid_onestop_id, errors = OnestopId.validate_onestop_id_string('')\n-      expect(is_a_valid_onestop_id).to be false\n-      expect(errors).to include 'must not be blank'\n-    end\n-    it 'must start with \"s-\" as its 1st component' do\n-      is_a_valid_onestop_id, errors = OnestopId.validate_onestop_id_string('69y7pwu-RetSta', expected_entity_type: 'stop')\n-      expect(is_a_valid_onestop_id).to be false\n-      expect(errors).to include 'must start with \"s\" as its 1st component'\n+  context '#name' do\n+    it 'allows only letters, digits, ~, @ in name' do\n+      expect(TestOnestopId.new(entity_prefix: 's', geohash: '9q9', name: 'Foo Bar').to_s).to eq('s-9q9-foobar')\n+      expect(TestOnestopId.new(entity_prefix: 's', geohash: '9q9', name: 'Foo Bar!').to_s).to eq('s-9q9-foobar')","path":"spec/services/onestop_id_spec.rb","position":54,"original_position":54,"commit_id":"c75356ca8b4a17ade78f2fadf6524bc9179eb2a2","original_commit_id":"c75356ca8b4a17ade78f2fadf6524bc9179eb2a2","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Line is too long. [112/80]<br>Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","created_at":"2016-01-09T01:07:44Z","updated_at":"2016-01-09T01:07:44Z","html_url":"https://github.com/transitland/transitland-datastore/pull/305#discussion_r49256641","pull_request_url":"https://api.github.com/repos/transitland/transitland-datastore/pulls/305","_links":{"self":{"href":"https://api.github.com/repos/transitland/transitland-datastore/pulls/comments/49256641"},"html":{"href":"https://github.com/transitland/transitland-datastore/pull/305#discussion_r49256641"},"pull_request":{"href":"https://api.github.com/repos/transitland/transitland-datastore/pulls/305"}}},"pull_request":{"url":"https://api.github.com/repos/transitland/transitland-datastore/pulls/305","id":55514648,"html_url":"https://github.com/transitland/transitland-datastore/pull/305","diff_url":"https://github.com/transitland/transitland-datastore/pull/305.diff","patch_url":"https://github.com/transitland/transitland-datastore/pull/305.patch","issue_url":"https://api.github.com/repos/transitland/transitland-datastore/issues/305","number":305,"state":"open","locked":false,"title":"Major refactoring of OnestopId:","user":{"login":"doublestranded","id":3828027,"avatar_url":"https://avatars.githubusercontent.com/u/3828027?v=3","gravatar_id":"","url":"https://api.github.com/users/doublestranded","html_url":"https://github.com/doublestranded","followers_url":"https://api.github.com/users/doublestranded/followers","following_url":"https://api.github.com/users/doublestranded/following{/other_user}","gists_url":"https://api.github.com/users/doublestranded/gists{/gist_id}","starred_url":"https://api.github.com/users/doublestranded/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doublestranded/subscriptions","organizations_url":"https://api.github.com/users/doublestranded/orgs","repos_url":"https://api.github.com/users/doublestranded/repos","events_url":"https://api.github.com/users/doublestranded/events{/privacy}","received_events_url":"https://api.github.com/users/doublestranded/received_events","type":"User","site_admin":false},"body":"top-level module that defines OnestopIdBase and subclasses, and separate initialize method\nidentification of onestop-ids by prefix, number of components, and soon suffixes","created_at":"2016-01-08T21:46:12Z","updated_at":"2016-01-09T01:07:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9c10805623bf1d198c8bcc9a144ac6c55af289b0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/transitland/transitland-datastore/pulls/305/commits","review_comments_url":"https://api.github.com/repos/transitland/transitland-datastore/pulls/305/comments","review_comment_url":"https://api.github.com/repos/transitland/transitland-datastore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/transitland/transitland-datastore/issues/305/comments","statuses_url":"https://api.github.com/repos/transitland/transitland-datastore/statuses/c75356ca8b4a17ade78f2fadf6524bc9179eb2a2","head":{"label":"transitland:onestop_id_refactor","ref":"onestop_id_refactor","sha":"c75356ca8b4a17ade78f2fadf6524bc9179eb2a2","user":{"login":"transitland","id":9141652,"avatar_url":"https://avatars.githubusercontent.com/u/9141652?v=3","gravatar_id":"","url":"https://api.github.com/users/transitland","html_url":"https://github.com/transitland","followers_url":"https://api.github.com/users/transitland/followers","following_url":"https://api.github.com/users/transitland/following{/other_user}","gists_url":"https://api.github.com/users/transitland/gists{/gist_id}","starred_url":"https://api.github.com/users/transitland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/transitland/subscriptions","organizations_url":"https://api.github.com/users/transitland/orgs","repos_url":"https://api.github.com/users/transitland/repos","events_url":"https://api.github.com/users/transitland/events{/privacy}","received_events_url":"https://api.github.com/users/transitland/received_events","type":"Organization","site_admin":false},"repo":{"id":25056419,"name":"transitland-datastore","full_name":"transitland/transitland-datastore","owner":{"login":"transitland","id":9141652,"avatar_url":"https://avatars.githubusercontent.com/u/9141652?v=3","gravatar_id":"","url":"https://api.github.com/users/transitland","html_url":"https://github.com/transitland","followers_url":"https://api.github.com/users/transitland/followers","following_url":"https://api.github.com/users/transitland/following{/other_user}","gists_url":"https://api.github.com/users/transitland/gists{/gist_id}","starred_url":"https://api.github.com/users/transitland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/transitland/subscriptions","organizations_url":"https://api.github.com/users/transitland/orgs","repos_url":"https://api.github.com/users/transitland/repos","events_url":"https://api.github.com/users/transitland/events{/privacy}","received_events_url":"https://api.github.com/users/transitland/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/transitland/transitland-datastore","description":"A community-run and -edited timetable and map of public transit service around the world.","fork":false,"url":"https://api.github.com/repos/transitland/transitland-datastore","forks_url":"https://api.github.com/repos/transitland/transitland-datastore/forks","keys_url":"https://api.github.com/repos/transitland/transitland-datastore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/transitland/transitland-datastore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/transitland/transitland-datastore/teams","hooks_url":"https://api.github.com/repos/transitland/transitland-datastore/hooks","issue_events_url":"https://api.github.com/repos/transitland/transitland-datastore/issues/events{/number}","events_url":"https://api.github.com/repos/transitland/transitland-datastore/events","assignees_url":"https://api.github.com/repos/transitland/transitland-datastore/assignees{/user}","branches_url":"https://api.github.com/repos/transitland/transitland-datastore/branches{/branch}","tags_url":"https://api.github.com/repos/transitland/transitland-datastore/tags","blobs_url":"https://api.github.com/repos/transitland/transitland-datastore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/transitland/transitland-datastore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/transitland/transitland-datastore/git/refs{/sha}","trees_url":"https://api.github.com/repos/transitland/transitland-datastore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/transitland/transitland-datastore/statuses/{sha}","languages_url":"https://api.github.com/repos/transitland/transitland-datastore/languages","stargazers_url":"https://api.github.com/repos/transitland/transitland-datastore/stargazers","contributors_url":"https://api.github.com/repos/transitland/transitland-datastore/contributors","subscribers_url":"https://api.github.com/repos/transitland/transitland-datastore/subscribers","subscription_url":"https://api.github.com/repos/transitland/transitland-datastore/subscription","commits_url":"https://api.github.com/repos/transitland/transitland-datastore/commits{/sha}","git_commits_url":"https://api.github.com/repos/transitland/transitland-datastore/git/commits{/sha}","comments_url":"https://api.github.com/repos/transitland/transitland-datastore/comments{/number}","issue_comment_url":"https://api.github.com/repos/transitland/transitland-datastore/issues/comments{/number}","contents_url":"https://api.github.com/repos/transitland/transitland-datastore/contents/{+path}","compare_url":"https://api.github.com/repos/transitland/transitland-datastore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/transitland/transitland-datastore/merges","archive_url":"https://api.github.com/repos/transitland/transitland-datastore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/transitland/transitland-datastore/downloads","issues_url":"https://api.github.com/repos/transitland/transitland-datastore/issues{/number}","pulls_url":"https://api.github.com/repos/transitland/transitland-datastore/pulls{/number}","milestones_url":"https://api.github.com/repos/transitland/transitland-datastore/milestones{/number}","notifications_url":"https://api.github.com/repos/transitland/transitland-datastore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/transitland/transitland-datastore/labels{/name}","releases_url":"https://api.github.com/repos/transitland/transitland-datastore/releases{/id}","created_at":"2014-10-10T23:06:07Z","updated_at":"2016-01-07T21:43:39Z","pushed_at":"2016-01-09T01:07:36Z","git_url":"git://github.com/transitland/transitland-datastore.git","ssh_url":"git@github.com:transitland/transitland-datastore.git","clone_url":"https://github.com/transitland/transitland-datastore.git","svn_url":"https://github.com/transitland/transitland-datastore","homepage":"https://transit.land/how-it-works","size":23045,"stargazers_count":25,"watchers_count":25,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":29,"forks":3,"open_issues":29,"watchers":25,"default_branch":"master"}},"base":{"label":"transitland:master","ref":"master","sha":"602d00ef149a7e4a4dbab8677624002d10edf688","user":{"login":"transitland","id":9141652,"avatar_url":"https://avatars.githubusercontent.com/u/9141652?v=3","gravatar_id":"","url":"https://api.github.com/users/transitland","html_url":"https://github.com/transitland","followers_url":"https://api.github.com/users/transitland/followers","following_url":"https://api.github.com/users/transitland/following{/other_user}","gists_url":"https://api.github.com/users/transitland/gists{/gist_id}","starred_url":"https://api.github.com/users/transitland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/transitland/subscriptions","organizations_url":"https://api.github.com/users/transitland/orgs","repos_url":"https://api.github.com/users/transitland/repos","events_url":"https://api.github.com/users/transitland/events{/privacy}","received_events_url":"https://api.github.com/users/transitland/received_events","type":"Organization","site_admin":false},"repo":{"id":25056419,"name":"transitland-datastore","full_name":"transitland/transitland-datastore","owner":{"login":"transitland","id":9141652,"avatar_url":"https://avatars.githubusercontent.com/u/9141652?v=3","gravatar_id":"","url":"https://api.github.com/users/transitland","html_url":"https://github.com/transitland","followers_url":"https://api.github.com/users/transitland/followers","following_url":"https://api.github.com/users/transitland/following{/other_user}","gists_url":"https://api.github.com/users/transitland/gists{/gist_id}","starred_url":"https://api.github.com/users/transitland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/transitland/subscriptions","organizations_url":"https://api.github.com/users/transitland/orgs","repos_url":"https://api.github.com/users/transitland/repos","events_url":"https://api.github.com/users/transitland/events{/privacy}","received_events_url":"https://api.github.com/users/transitland/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/transitland/transitland-datastore","description":"A community-run and -edited timetable and map of public transit service around the world.","fork":false,"url":"https://api.github.com/repos/transitland/transitland-datastore","forks_url":"https://api.github.com/repos/transitland/transitland-datastore/forks","keys_url":"https://api.github.com/repos/transitland/transitland-datastore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/transitland/transitland-datastore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/transitland/transitland-datastore/teams","hooks_url":"https://api.github.com/repos/transitland/transitland-datastore/hooks","issue_events_url":"https://api.github.com/repos/transitland/transitland-datastore/issues/events{/number}","events_url":"https://api.github.com/repos/transitland/transitland-datastore/events","assignees_url":"https://api.github.com/repos/transitland/transitland-datastore/assignees{/user}","branches_url":"https://api.github.com/repos/transitland/transitland-datastore/branches{/branch}","tags_url":"https://api.github.com/repos/transitland/transitland-datastore/tags","blobs_url":"https://api.github.com/repos/transitland/transitland-datastore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/transitland/transitland-datastore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/transitland/transitland-datastore/git/refs{/sha}","trees_url":"https://api.github.com/repos/transitland/transitland-datastore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/transitland/transitland-datastore/statuses/{sha}","languages_url":"https://api.github.com/repos/transitland/transitland-datastore/languages","stargazers_url":"https://api.github.com/repos/transitland/transitland-datastore/stargazers","contributors_url":"https://api.github.com/repos/transitland/transitland-datastore/contributors","subscribers_url":"https://api.github.com/repos/transitland/transitland-datastore/subscribers","subscription_url":"https://api.github.com/repos/transitland/transitland-datastore/subscription","commits_url":"https://api.github.com/repos/transitland/transitland-datastore/commits{/sha}","git_commits_url":"https://api.github.com/repos/transitland/transitland-datastore/git/commits{/sha}","comments_url":"https://api.github.com/repos/transitland/transitland-datastore/comments{/number}","issue_comment_url":"https://api.github.com/repos/transitland/transitland-datastore/issues/comments{/number}","contents_url":"https://api.github.com/repos/transitland/transitland-datastore/contents/{+path}","compare_url":"https://api.github.com/repos/transitland/transitland-datastore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/transitland/transitland-datastore/merges","archive_url":"https://api.github.com/repos/transitland/transitland-datastore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/transitland/transitland-datastore/downloads","issues_url":"https://api.github.com/repos/transitland/transitland-datastore/issues{/number}","pulls_url":"https://api.github.com/repos/transitland/transitland-datastore/pulls{/number}","milestones_url":"https://api.github.com/repos/transitland/transitland-datastore/milestones{/number}","notifications_url":"https://api.github.com/repos/transitland/transitland-datastore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/transitland/transitland-datastore/labels{/name}","releases_url":"https://api.github.com/repos/transitland/transitland-datastore/releases{/id}","created_at":"2014-10-10T23:06:07Z","updated_at":"2016-01-07T21:43:39Z","pushed_at":"2016-01-09T01:07:36Z","git_url":"git://github.com/transitland/transitland-datastore.git","ssh_url":"git@github.com:transitland/transitland-datastore.git","clone_url":"https://github.com/transitland/transitland-datastore.git","svn_url":"https://github.com/transitland/transitland-datastore","homepage":"https://transit.land/how-it-works","size":23045,"stargazers_count":25,"watchers_count":25,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":29,"forks":3,"open_issues":29,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/transitland/transitland-datastore/pulls/305"},"html":{"href":"https://github.com/transitland/transitland-datastore/pull/305"},"issue":{"href":"https://api.github.com/repos/transitland/transitland-datastore/issues/305"},"comments":{"href":"https://api.github.com/repos/transitland/transitland-datastore/issues/305/comments"},"review_comments":{"href":"https://api.github.com/repos/transitland/transitland-datastore/pulls/305/comments"},"review_comment":{"href":"https://api.github.com/repos/transitland/transitland-datastore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/transitland/transitland-datastore/pulls/305/commits"},"statuses":{"href":"https://api.github.com/repos/transitland/transitland-datastore/statuses/c75356ca8b4a17ade78f2fadf6524bc9179eb2a2"}}}}