{"action":"created","comment":{"url":"https://api.github.com/repos/SUSE/rmt/pulls/comments/188908943","pull_request_review_id":120972027,"id":188908943,"diff_hunk":"@@ -0,0 +1,285 @@\n+require 'rails_helper'\n+require 'rmt/cli/smt_importer'\n+\n+describe SMTImporter do\n+  let(:config) do\n+    config = OpenStruct.new\n+    config.data_dir = File.join(Dir.pwd, 'spec/fixtures/files/csv')\n+    config.no_systems = false\n+    config\n+  end\n+\n+  let(:script) { described_class.new(config) }\n+\n+  describe '#read_csv' do\n+    let(:login) { 'SCC_620a989bc9fb44cc95e7f96390bd979e' }\n+    let(:product_id) { '1421' }\n+\n+    it 'reads the file by tabs and returns the parsed values as array' do\n+      expect(script.read_csv('activations')).to be_a(CSV)\n+      expect(script.read_csv('activations').first).to eq([login, product_id])\n+      expect(script.read_csv('activations').count).to be(2)\n+    end\n+\n+    it 'throws when the file could not be found' do","path":"spec/lib/rmt/cli/smt_importer_spec.rb","position":24,"original_position":24,"commit_id":"2cb275bc6916b73946bc1e1a387a9d0471994463","original_commit_id":"4922a4076ac7f5b4782bdf8da496786c89d879cd","user":{"login":"ikapelyukhin","id":1793699,"avatar_url":"https://avatars1.githubusercontent.com/u/1793699?v=4","gravatar_id":"","url":"https://api.github.com/users/ikapelyukhin","html_url":"https://github.com/ikapelyukhin","followers_url":"https://api.github.com/users/ikapelyukhin/followers","following_url":"https://api.github.com/users/ikapelyukhin/following{/other_user}","gists_url":"https://api.github.com/users/ikapelyukhin/gists{/gist_id}","starred_url":"https://api.github.com/users/ikapelyukhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikapelyukhin/subscriptions","organizations_url":"https://api.github.com/users/ikapelyukhin/orgs","repos_url":"https://api.github.com/users/ikapelyukhin/repos","events_url":"https://api.github.com/users/ikapelyukhin/events{/privacy}","received_events_url":"https://api.github.com/users/ikapelyukhin/received_events","type":"User","site_admin":false},"body":"```\r\ncontext 'when CSV file doesn't exist' do\r\n  it 'raises an error' do\r\n```","created_at":"2018-05-17T10:21:34Z","updated_at":"2018-05-17T10:38:17Z","html_url":"https://github.com/SUSE/rmt/pull/170#discussion_r188908943","pull_request_url":"https://api.github.com/repos/SUSE/rmt/pulls/170","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/SUSE/rmt/pulls/comments/188908943"},"html":{"href":"https://github.com/SUSE/rmt/pull/170#discussion_r188908943"},"pull_request":{"href":"https://api.github.com/repos/SUSE/rmt/pulls/170"}}},"pull_request":{"url":"https://api.github.com/repos/SUSE/rmt/pulls/170","id":188088538,"html_url":"https://github.com/SUSE/rmt/pull/170","diff_url":"https://github.com/SUSE/rmt/pull/170.diff","patch_url":"https://github.com/SUSE/rmt/pull/170.patch","issue_url":"https://api.github.com/repos/SUSE/rmt/issues/170","number":170,"state":"open","locked":false,"title":"Prepare migration script","user":{"login":"felixsch","id":4460715,"avatar_url":"https://avatars2.githubusercontent.com/u/4460715?v=4","gravatar_id":"","url":"https://api.github.com/users/felixsch","html_url":"https://github.com/felixsch","followers_url":"https://api.github.com/users/felixsch/followers","following_url":"https://api.github.com/users/felixsch/following{/other_user}","gists_url":"https://api.github.com/users/felixsch/gists{/gist_id}","starred_url":"https://api.github.com/users/felixsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixsch/subscriptions","organizations_url":"https://api.github.com/users/felixsch/orgs","repos_url":"https://api.github.com/users/felixsch/repos","events_url":"https://api.github.com/users/felixsch/events{/privacy}","received_events_url":"https://api.github.com/users/felixsch/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-15T10:54:11Z","updated_at":"2018-05-17T10:38:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc5121ee6910683f0f93257418ea2f10059afcba","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/SUSE/rmt/pulls/170/commits","review_comments_url":"https://api.github.com/repos/SUSE/rmt/pulls/170/comments","review_comment_url":"https://api.github.com/repos/SUSE/rmt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SUSE/rmt/issues/170/comments","statuses_url":"https://api.github.com/repos/SUSE/rmt/statuses/2cb275bc6916b73946bc1e1a387a9d0471994463","head":{"label":"SUSE:prepare-migration-script","ref":"prepare-migration-script","sha":"2cb275bc6916b73946bc1e1a387a9d0471994463","user":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars0.githubusercontent.com/u/1067733?v=4","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":96195015,"name":"rmt","full_name":"SUSE/rmt","owner":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars0.githubusercontent.com/u/1067733?v=4","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SUSE/rmt","description":"RPM repository mirroring tool and registration proxy for SUSE Customer Center.","fork":false,"url":"https://api.github.com/repos/SUSE/rmt","forks_url":"https://api.github.com/repos/SUSE/rmt/forks","keys_url":"https://api.github.com/repos/SUSE/rmt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SUSE/rmt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SUSE/rmt/teams","hooks_url":"https://api.github.com/repos/SUSE/rmt/hooks","issue_events_url":"https://api.github.com/repos/SUSE/rmt/issues/events{/number}","events_url":"https://api.github.com/repos/SUSE/rmt/events","assignees_url":"https://api.github.com/repos/SUSE/rmt/assignees{/user}","branches_url":"https://api.github.com/repos/SUSE/rmt/branches{/branch}","tags_url":"https://api.github.com/repos/SUSE/rmt/tags","blobs_url":"https://api.github.com/repos/SUSE/rmt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SUSE/rmt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SUSE/rmt/git/refs{/sha}","trees_url":"https://api.github.com/repos/SUSE/rmt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SUSE/rmt/statuses/{sha}","languages_url":"https://api.github.com/repos/SUSE/rmt/languages","stargazers_url":"https://api.github.com/repos/SUSE/rmt/stargazers","contributors_url":"https://api.github.com/repos/SUSE/rmt/contributors","subscribers_url":"https://api.github.com/repos/SUSE/rmt/subscribers","subscription_url":"https://api.github.com/repos/SUSE/rmt/subscription","commits_url":"https://api.github.com/repos/SUSE/rmt/commits{/sha}","git_commits_url":"https://api.github.com/repos/SUSE/rmt/git/commits{/sha}","comments_url":"https://api.github.com/repos/SUSE/rmt/comments{/number}","issue_comment_url":"https://api.github.com/repos/SUSE/rmt/issues/comments{/number}","contents_url":"https://api.github.com/repos/SUSE/rmt/contents/{+path}","compare_url":"https://api.github.com/repos/SUSE/rmt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SUSE/rmt/merges","archive_url":"https://api.github.com/repos/SUSE/rmt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SUSE/rmt/downloads","issues_url":"https://api.github.com/repos/SUSE/rmt/issues{/number}","pulls_url":"https://api.github.com/repos/SUSE/rmt/pulls{/number}","milestones_url":"https://api.github.com/repos/SUSE/rmt/milestones{/number}","notifications_url":"https://api.github.com/repos/SUSE/rmt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SUSE/rmt/labels{/name}","releases_url":"https://api.github.com/repos/SUSE/rmt/releases{/id}","deployments_url":"https://api.github.com/repos/SUSE/rmt/deployments","created_at":"2017-07-04T08:33:17Z","updated_at":"2018-05-17T08:57:26Z","pushed_at":"2018-05-17T10:25:45Z","git_url":"git://github.com/SUSE/rmt.git","ssh_url":"git@github.com:SUSE/rmt.git","clone_url":"https://github.com/SUSE/rmt.git","svn_url":"https://github.com/SUSE/rmt","homepage":"","size":1337,"stargazers_count":18,"watchers_count":18,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":5,"open_issues":15,"watchers":18,"default_branch":"master"}},"base":{"label":"SUSE:master","ref":"master","sha":"e264102cb7f4b4137384a372b3d066727026354f","user":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars0.githubusercontent.com/u/1067733?v=4","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":96195015,"name":"rmt","full_name":"SUSE/rmt","owner":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars0.githubusercontent.com/u/1067733?v=4","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SUSE/rmt","description":"RPM repository mirroring tool and registration proxy for SUSE Customer Center.","fork":false,"url":"https://api.github.com/repos/SUSE/rmt","forks_url":"https://api.github.com/repos/SUSE/rmt/forks","keys_url":"https://api.github.com/repos/SUSE/rmt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SUSE/rmt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SUSE/rmt/teams","hooks_url":"https://api.github.com/repos/SUSE/rmt/hooks","issue_events_url":"https://api.github.com/repos/SUSE/rmt/issues/events{/number}","events_url":"https://api.github.com/repos/SUSE/rmt/events","assignees_url":"https://api.github.com/repos/SUSE/rmt/assignees{/user}","branches_url":"https://api.github.com/repos/SUSE/rmt/branches{/branch}","tags_url":"https://api.github.com/repos/SUSE/rmt/tags","blobs_url":"https://api.github.com/repos/SUSE/rmt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SUSE/rmt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SUSE/rmt/git/refs{/sha}","trees_url":"https://api.github.com/repos/SUSE/rmt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SUSE/rmt/statuses/{sha}","languages_url":"https://api.github.com/repos/SUSE/rmt/languages","stargazers_url":"https://api.github.com/repos/SUSE/rmt/stargazers","contributors_url":"https://api.github.com/repos/SUSE/rmt/contributors","subscribers_url":"https://api.github.com/repos/SUSE/rmt/subscribers","subscription_url":"https://api.github.com/repos/SUSE/rmt/subscription","commits_url":"https://api.github.com/repos/SUSE/rmt/commits{/sha}","git_commits_url":"https://api.github.com/repos/SUSE/rmt/git/commits{/sha}","comments_url":"https://api.github.com/repos/SUSE/rmt/comments{/number}","issue_comment_url":"https://api.github.com/repos/SUSE/rmt/issues/comments{/number}","contents_url":"https://api.github.com/repos/SUSE/rmt/contents/{+path}","compare_url":"https://api.github.com/repos/SUSE/rmt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SUSE/rmt/merges","archive_url":"https://api.github.com/repos/SUSE/rmt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SUSE/rmt/downloads","issues_url":"https://api.github.com/repos/SUSE/rmt/issues{/number}","pulls_url":"https://api.github.com/repos/SUSE/rmt/pulls{/number}","milestones_url":"https://api.github.com/repos/SUSE/rmt/milestones{/number}","notifications_url":"https://api.github.com/repos/SUSE/rmt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SUSE/rmt/labels{/name}","releases_url":"https://api.github.com/repos/SUSE/rmt/releases{/id}","deployments_url":"https://api.github.com/repos/SUSE/rmt/deployments","created_at":"2017-07-04T08:33:17Z","updated_at":"2018-05-17T08:57:26Z","pushed_at":"2018-05-17T10:25:45Z","git_url":"git://github.com/SUSE/rmt.git","ssh_url":"git@github.com:SUSE/rmt.git","clone_url":"https://github.com/SUSE/rmt.git","svn_url":"https://github.com/SUSE/rmt","homepage":"","size":1337,"stargazers_count":18,"watchers_count":18,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":5,"open_issues":15,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SUSE/rmt/pulls/170"},"html":{"href":"https://github.com/SUSE/rmt/pull/170"},"issue":{"href":"https://api.github.com/repos/SUSE/rmt/issues/170"},"comments":{"href":"https://api.github.com/repos/SUSE/rmt/issues/170/comments"},"review_comments":{"href":"https://api.github.com/repos/SUSE/rmt/pulls/170/comments"},"review_comment":{"href":"https://api.github.com/repos/SUSE/rmt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SUSE/rmt/pulls/170/commits"},"statuses":{"href":"https://api.github.com/repos/SUSE/rmt/statuses/2cb275bc6916b73946bc1e1a387a9d0471994463"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ikapelyukhin"}}