Skip to content

Commit 81ed71e

Browse files
Fix: check for dispositon changes in tests
Looks like the log entries are getting stored in different order in the CI, which is probably not really an issue. This commit changes how we check for the last disposition change in the tests, so we avoid asserting on a "response" entry log instead. See #2337
1 parent c96c29b commit 81ed71e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

test/ask/runtime/survey_test.exs

+1-2
Original file line numberDiff line numberDiff line change
@@ -3693,10 +3693,9 @@ defmodule Ask.Runtime.SurveyTest do
36933693

36943694
defp assert_disposition_changed(respondent_id, old_disposition, new_disposition) do
36953695
last_entry =
3696-
Repo.all(from log in SurveyLogEntry, where: log.respondent_id == ^respondent_id)
3696+
Repo.all(from log in SurveyLogEntry, where: log.respondent_id == ^respondent_id, where: log.action_type == "disposition changed")
36973697
|> take_last
36983698

3699-
assert last_entry.action_type == "disposition changed"
37003699
assert last_entry.disposition == to_string(old_disposition)
37013700
assert last_entry.action_data == upcaseFirst(new_disposition)
37023701
end

0 commit comments

Comments
 (0)