lib/fbe/octo.rb in fbe-0.0.16 vs lib/fbe/octo.rb in fbe-0.0.17

- old
+ new

@@ -122,15 +122,12 @@ o end def repositories(_user = nil) [ - { - name: 'judges', - full_name: 'yegor256/judges', - id: 444 - } + repository('yegor256/judges'), + repository('yegor256/factbase') ] end def user(name) { @@ -141,11 +138,42 @@ end def repository(name) { id: name_to_number(name), - full_name: name.is_a?(Integer) ? 'yegor256/test' : name + full_name: name.is_a?(Integer) ? 'yegor256/test' : name, + default_branch: 'master', + private: false, + owner: { login: name.to_s.split('/')[0], id: 526_301, site_admin: false }, + html_url: "https://github.com/#{name}", + description: 'something', + fork: false, + url: "https://github.com/#{name}", + created_at: random_time, + updated_at: random_time, + pushed_at: random_time, + size: 470, + stargazers_count: 1, + watchers_count: 1, + language: 'Ruby', + has_issues: true, + has_projects: true, + has_downloads: true, + has_wiki: true, + has_pages: false, + has_discussions: false, + forks_count: 0, + archived: false, + disabled: false, + open_issues_count: 6, + license: { key: 'mit', name: 'MIT License' }, + allow_forking: true, + is_template: false, + visibility: 'public', + forks: 0, + open_issues: 6, + watchers: 1 } end def add_comment(_repo, _issue, _text) { @@ -169,35 +197,35 @@ end def issue_timeline(_repo, _issue, _options = {}) [ { + event: 'renamed', actor: { id: 888, login: 'torvalds' }, repository: { id: name_to_number('yegor256/judges'), full_name: 'yegor256/judges' }, - event: 'renamed', rename: { from: 'before', to: 'after' }, created_at: random_time }, { + event: 'labeled', actor: { id: 888, login: 'torvalds' }, repository: { id: name_to_number('yegor256/judges'), full_name: 'yegor256/judges' }, - event: 'labeled', label: { name: 'bug' }, created_at: random_time } @@ -206,60 +234,74 @@ def repository_events(repo, _options = {}) [ { id: '123', + type: 'PushEvent', repo: { id: name_to_number(repo), - name: repo + name: repo, + url: "https://api.github.com/repos/#{repo}" }, - type: 'PushEvent', payload: { - push_id: 42 + push_id: 42, + ref: 'refs/heads/master', + size: 1, + distinct_size: 0, + head: 'b7089c51cc2526a0d2619d35379f921d53c72731', + before: '12d3bff1a55bad50ee2e8f29ade7f1c1e07bb025' }, actor: { id: 888, - login: 'torvalds' + login: 'torvalds', + display_login: 'torvalds' }, - created_at: random_time + created_at: random_time, + public: true }, { id: '124', + type: 'IssuesEvent', repo: { id: name_to_number(repo), - name: repo + name: repo, + url: "https://api.github.com/repos/#{repo}" }, - type: 'IssuesEvent', payload: { action: 'closed', issue: { number: 42 } }, actor: { id: 888, - login: 'torvalds' + login: 'torvalds', + display_login: 'torvalds' }, - created_at: random_time + created_at: random_time, + public: true }, { id: '125', + type: 'IssuesEvent', repo: { id: name_to_number(repo), - name: repo + name: repo, + url: "https://api.github.com/repos/#{repo}" }, - type: 'IssuesEvent', payload: { action: 'opened', issue: { number: 42 } }, actor: { id: 888, - login: 'torvalds' + login: 'torvalds', + display_login: 'torvalds' }, - created_at: random_time + created_at: random_time, + public: true } ] end end