Skip to content

Commit

Permalink
Stub prometheus gauge in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
richardTowers committed Aug 1, 2024
1 parent 184990d commit 0a76c36
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/integration/fact_check_email_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def assert_correct_state(key, value, state)
message[key] = value

Mail.stubs(:all).yields(message)
FactCheckEmailHandler.new(fact_check_config).process
FactCheckEmailHandler.new(fact_check_config, stub.stubs(:set)).process

answer.reload
assert answer.public_send("#{state}?")
Expand All @@ -41,7 +41,7 @@ def assert_correct_state(key, value, state)

answer.destroy!

handler = FactCheckEmailHandler.new(fact_check_config)
handler = FactCheckEmailHandler.new(fact_check_config, stub.stubs(:set))
handler.process

assert message.is_marked_for_delete?
Expand All @@ -53,7 +53,7 @@ def assert_correct_state(key, value, state)
message = fact_check_mail_for(answer)
Mail.stubs(:all).yields(message)

handler = FactCheckEmailHandler.new(fact_check_config)
handler = FactCheckEmailHandler.new(fact_check_config, stub.stubs(:set))
handler.process

answer.reload
Expand All @@ -71,7 +71,7 @@ def assert_correct_state(key, value, state)

Mail.stubs(:all).yields(fact_check_mail_for(answer))

handler = FactCheckEmailHandler.new(fact_check_config)
handler = FactCheckEmailHandler.new(fact_check_config, stub.stubs(:set))
handler.process

answer.reload
Expand All @@ -96,7 +96,7 @@ def assert_correct_state(key, value, state)
fact_check_mail_for(answer1, body: "Third Message"),
)

handler = FactCheckEmailHandler.new(fact_check_config)
handler = FactCheckEmailHandler.new(fact_check_config, stub.stubs(:set))
handler.process

answer1.reload
Expand All @@ -122,7 +122,7 @@ def assert_correct_state(key, value, state)

Mail.stubs(:all).yields(message)

handler = FactCheckEmailHandler.new(fact_check_config)
handler = FactCheckEmailHandler.new(fact_check_config, stub.stubs(:set))
handler.process

assert_not message.is_marked_for_delete?
Expand All @@ -139,7 +139,7 @@ def assert_correct_state(key, value, state)

Mail.stubs(:all).multiple_yields(message_cc, message_bcc)

handler = FactCheckEmailHandler.new(fact_check_config)
handler = FactCheckEmailHandler.new(fact_check_config, stub.stubs(:set))
handler.process

assert message_cc.is_marked_for_delete?
Expand All @@ -152,7 +152,7 @@ def assert_correct_state(key, value, state)

Mail.stubs(:all).yields(message)

handler = FactCheckEmailHandler.new(fact_check_config)
handler = FactCheckEmailHandler.new(fact_check_config, stub.stubs(:set))
handler.process_message(message)
assert message.is_marked_for_delete?
end
Expand All @@ -163,7 +163,7 @@ def assert_correct_state(key, value, state)

Mail.stubs(:all).yields(message)

handler = FactCheckEmailHandler.new(fact_check_config)
handler = FactCheckEmailHandler.new(fact_check_config, stub.stubs(:set))

handler.process_message(message)
assert message.is_marked_for_delete?
Expand All @@ -182,7 +182,7 @@ def assert_correct_state(key, value, state)
fact_check_mail_for(answer2, body: "Second Message"),
)

handler = FactCheckEmailHandler.new(fact_check_config)
handler = FactCheckEmailHandler.new(fact_check_config, stub.stubs(:set))

invocations = 0
handler.process do
Expand Down

0 comments on commit 0a76c36

Please sign in to comment.