docbrown/spec/services/github/client_spec.rb
rhymes ae8a58fec2
[deploy] Decouple GitHub authentication from fetching GitHub issues (#7660)
* Improve error handling

* Add tests for Github::Client

* Add GithubIssue validation

* Refactor GithubIssue and fix bug with pull requests

* Improve tests

* Fix PR API URL generation

* Improve logic and get rid of the issue fragment

* Fix disappeared avatar

* Improve rendering

* Activate client side caching using Redis

* Remove unnecessary file

* Add RemoveGithubIssues data update script

* Fix comma

* Forgot to disable the approvals verify text

* Apply PR feedback
2020-05-04 16:17:16 -04:00

22 lines
596 B
Ruby

require "rails_helper"
RSpec.describe Github::Client, type: :service, vcr: true do
let(:repo) { "thepracticaldev/dev.to" }
describe ".issue" do
it "returns a an issue" do
VCR.use_cassette("github_client_issue") do
issue = described_class.issue(repo, 7434)
expect(issue.title).to be_present
end
end
it "raises NotFound if the issue does not exist" do
VCR.use_cassette("github_client_issue_not_found") do
expect do
described_class.issue(repo, 0)
end.to raise_error(Github::Errors::NotFound)
end
end
end
end