Skip to content

Commit

Permalink
Test duplicate surveys don't have exit status
Browse files Browse the repository at this point in the history
See #2351
  • Loading branch information
matiasgarciaisaia committed Jul 19, 2024
1 parent 40d851e commit 83f6c88
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/ask_web/controllers/survey_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -1398,6 +1398,26 @@ defmodule AskWeb.SurveyControllerTest do

assert (new_survey.questionnaires |> hd).id == questionnaire.id
end

test "finished survey copies don't copy their exit status", %{ conn: conn, user: user } do
project = create_project_for_user(user)

survey =
insert(:survey,
project: project,
state: "terminated",
exit_code: 0,
exit_message: "Successfully completed"
)

conn = post conn, project_survey_survey_path(conn, :duplicate, project, survey)

new_survey = Repo.get(Survey, json_response(conn, 201)["data"]["id"])

assert new_survey.state == :not_ready
assert new_survey.exit_code == nil
assert new_survey.exit_message == nil
end
end

describe "update" do
Expand Down

0 comments on commit 83f6c88

Please sign in to comment.