Skip to content
Snippets Groups Projects
Commit 4c541a32 authored by Israel Barreto Sant'Anna's avatar Israel Barreto Sant'Anna
Browse files

Merge branch 'master' into search-api

parents 0c071080 f247ab50
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,10 @@ class FeedbackService
@bugreporter_service = bugreporter_service
end
def get_report_service
@bugreporter_service
end
##
# delegates the behavior for a bug reporter service
def report_bug(bug)
......@@ -20,4 +24,4 @@ class FeedbackService
# send notification
end
end
\ No newline at end of file
end
require 'test_helper'
class FeedbackServiceTest < ActiveSupport::TestCase
PORTALMEC_PROJECT_ID = 633
mock = MiniTest::Mock.new
report_service = GitlabBugreporterService.new(mock)
feedback = FeedbackService.new(report_service)
test 'initializing bug reporter service' do
assert_equal feedback.get_report_service, report_service
end
test 'reporting bug' do
bug = Bug.new
bug.title = 'Título'
bug.description = 'Descrição do bug'
mock.expect(:create_issue, nil, [PORTALMEC_PROJECT_ID, bug.title, description: bug.description])
assert feedback.report_bug(bug)
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment