From c1d0da0da2e3a350d7a6b57b48dc1c751d9aa3ab Mon Sep 17 00:00:00 2001 From: Devin Gaffney Date: Fri, 20 Oct 2023 12:29:48 -0700 Subject: [PATCH] fix fixtures' --- test/controllers/webhooks_controller_test.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/controllers/webhooks_controller_test.rb b/test/controllers/webhooks_controller_test.rb index 42f340a0ba..b23d9b3b19 100644 --- a/test/controllers/webhooks_controller_test.rb +++ b/test/controllers/webhooks_controller_test.rb @@ -233,19 +233,19 @@ def setup assert_match /ignored/, response.body end - test "should process Alegre webhook" do + test "should process Alegre webhook zzz" do CheckSentry.expects(:notify).never redis = Redis.new(REDIS_CONFIG) redis.del('foo') - payload = { 'action' => 'audio', 'data' => {'requested' => { 'id' => 'foo', 'context' => { 'project_media_id' => random_number } }} } + id = random_number + payload = { 'action' => 'audio', 'data' => {'requested' => { 'id' => 'foo', 'context' => { 'project_media_id' => id } }} } assert_nil redis.lpop('alegre:webhook:foo') post :index, params: { name: :alegre, token: CheckConfig.get('alegre_token') }.merge(payload) response = JSON.parse(redis.lpop('alegre:webhook:foo')) - assert_equal 'foo', response.dig('requested', 'id') - - travel_to Time.now.since(2.days) - assert_nil redis.lpop('alegre:webhook:foo') + assert_equal 'foo', response.dig('data', 'requested', 'id') + expectation = {"action"=>"index", "data"=>{"requested"=>{"context"=>{"project_media_id"=>id.to_s}, "id"=>"foo"}}, "token"=>"test", "name"=>"alegre", "controller"=>"api/v1/webhooks"} + assert_equal expectation, response end test "should report error if can't process Alegre webhook" do