Skip to content

Commit

Permalink
Trying to debug failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
caiosba committed Dec 26, 2023
1 parent 45946b8 commit b30cb07
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test/models/bot/alegre_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

class Bot::AlegreTest < ActiveSupport::TestCase
def setup
BotUser.delete_all
puts "[Starting test #{self.class.name}::#{self.method_name}]" # Output which test has started running
ft = DynamicAnnotation::FieldType.where(field_type: 'language').last || create_field_type(field_type: 'language', label: 'Language')
at = create_annotation_type annotation_type: 'language', label: 'Language'
create_field_instance annotation_type_object: at, name: 'language', label: 'Language', field_type_object: ft, optional: false
Expand All @@ -21,6 +23,7 @@ def setup

def teardown
Bot::Alegre.unstub(:media_file_url)
puts "[Finishing test #{self.class.name}::#{self.method_name}]" # Output which test has finished running
end

test "should return an alegre matching model" do
Expand Down Expand Up @@ -199,11 +202,13 @@ def teardown
end

test "should index report data" do
WebMock.stub_request(:delete, 'http://alegre:3100/text/similarity/').to_return(body: {success: true}.to_json)
WebMock.stub_request(:post, 'http://alegre:3100/text/similarity/').to_return(body: {}.to_json)
pm = create_project_media team: @team
assert_nothing_raised do
publish_report(pm)
stub_configs({ 'alegre_host' => 'http://alegre', 'alegre_token' => 'test' }) do
WebMock.stub_request(:delete, 'http://alegre/text/similarity/').to_return(body: {success: true}.to_json)
WebMock.stub_request(:post, 'http://alegre/text/similarity/').to_return(body: {}.to_json)
pm = create_project_media team: @team
assert_nothing_raised do
publish_report(pm)
end
end
end

Expand Down

0 comments on commit b30cb07

Please sign in to comment.