Skip to content

Commit

Permalink
Fix some json tests
Browse files Browse the repository at this point in the history
  • Loading branch information
indocomsoft committed Jun 23, 2018
1 parent 8518c0f commit 988b205
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/cadet/assessments/answer_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ defmodule Cadet.Assessments.AnswerTest do
marks: 100,
answer: %{},
type: :programming,
raw_answer: ~s({"answer": "This is a sample json"})
raw_answer: Poison.encode!(%{answer: "This is a sample json"})
}
end

Expand Down
5 changes: 2 additions & 3 deletions test/cadet/assessments/question_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ defmodule Cadet.Assessments.QuestionTest do
weight: 4,
question: %{},
type: :programming,
raw_library: ~s({"week": 5, "globals": [], "externals": [],
"files": []}),
raw_question: ~s({"question": "This is a sample json"})
raw_library: Poison.encode!(%{week: 5, globals: [], externals: [], files: []}),
raw_question: Poison.encode!(%{question: "This is a sample json"})
}
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ defmodule Cadet.Assessments.QuestionTypes.ProgrammingQuestionTest do

%{
raw_programmingquestion:
"{\"solution_template\":\"asd\",\"solution_header\":\"asd\",\"solution\":\"asd\",\"content\":\"asd\",\"library\":{\"version\":1}}"
Poison.encode!(%{
content: "asd",
solution_template: "asd",
solution: "asd",
library: %{version: 1}
})
}
end

Expand Down

0 comments on commit 988b205

Please sign in to comment.