docbrown/spec/models/github_issue_spec.rb
dependabot[bot] eafefd7422 Bump octokit from 4.8.0 to 4.12.0 (#744) [ci skip]
* Bump octokit from 4.8.0 to 4.12.0

Bumps [octokit](https://github.com/octokit/octokit.rb) from 4.8.0 to 4.12.0.
- [Release notes](https://github.com/octokit/octokit.rb/releases)
- [Changelog](https://github.com/octokit/octokit.rb/blob/master/RELEASE.md)
- [Commits](https://github.com/octokit/octokit.rb/compare/v4.8.0...v4.12.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Update spec
2018-09-25 17:04:58 -04:00

20 lines
742 B
Ruby

require "rails_helper"
vcr_option = {
cassette_name: "github_issue_api",
allow_playback_repeats: "true"
}
RSpec.describe GithubIssue, type: :model, vcr: vcr_option do
let(:link) { "https://api.github.com/repos/thepracticaldev/dev.to/issues/510#issue-354483683" }
it "finds or fetches based on URL" do
# NB: this approvals test is a little harder to update
# because a legitimate github access token is required for octokit
# which is then captured via vcr.
# IF YOU DO PLAN TO UPDATE THIS: be sure to remove your access token
# from the vcr cassette generated by this
issue = described_class.find_or_fetch(link)
Approvals.verify(issue.processed_html, name: "github_issue_test", format: :html)
end
end