Skip to content

Commit

Permalink
remove duplicate jira issues found
Browse files Browse the repository at this point in the history
  • Loading branch information
RestlessThinker committed Aug 6, 2018
1 parent 7efcc5a commit d8ea3ed
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/jira/gem_version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Jira
VERSION = "0.4.1".freeze
VERSION = "0.4.2".freeze
end
2 changes: 1 addition & 1 deletion lib/jira/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def find_jira_issues(key: nil, search_title: true, search_commits: false)
jira_issues << match
end
end
return jira_issues
return jira_issues.uniq
end

def ensure_url_ends_with_slash(url)
Expand Down
6 changes: 6 additions & 0 deletions spec/jira_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ def single_commit.message
)
expect((issues <=> ["WEB-126"]) == 0)
end

it "can remove duplicates" do
allow(@jira).to receive_message_chain("github.pr_title").and_return("Ticket [WEB-123] and WEB-123")
issues = @jira.find_jira_issues(key: "WEB")
expect((issues <=> ["WEB-123"]) == 0)
end
end
end
end

0 comments on commit d8ea3ed

Please sign in to comment.