lib/fbe/octo.rb in fbe-0.0.34 vs lib/fbe/octo.rb in fbe-0.0.35
- old
+ new
@@ -299,22 +299,53 @@
line: 1,
position: 1
}
end
- def search_issues(_query, _options = {})
- {
- items: [
- {
- number: 42,
- labels: [
- {
- name: 'bug'
- }
- ]
- }
- ]
- }
+ def search_issues(query, _options = {})
+ if query.include?('type:pr') && query.include?('is:unmerged')
+ {
+ total_count: 1,
+ incomplete_results: false,
+ items: [
+ {
+ id: 42,
+ number: 10,
+ title: 'Awesome PR 10'
+ }
+ ]
+ }
+ elsif query.include?('type:pr')
+ {
+ total_count: 2,
+ incomplete_results: false,
+ items: [
+ {
+ id: 42,
+ number: 10,
+ title: 'Awesome PR 10'
+ },
+ {
+ id: 43,
+ number: 11,
+ title: 'Awesome PR 11'
+ }
+ ]
+ }
+ else
+ {
+ items: [
+ {
+ number: 42,
+ labels: [
+ {
+ name: 'bug'
+ }
+ ]
+ }
+ ]
+ }
+ end
end
def commits_since(repo, _since)
[
commit(repo, 'a1b2c3d4e5f6a1b2c3d4e5f6'),