Advertisement
Guest User

ConnTest dispatch/5 map flatten issue Raw

a guest
Oct 20th, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. @valid_school_bmu %{adr_city: "Somewhere",
  2. adr_line_1: "555 Some St",
  3. adr_line_2: "Suite 100",
  4. adr_state: "TN",
  5. adr_zip: "37203",
  6. is_active: true,
  7. is_editable: true,
  8. name: "BMU",
  9. timezone: "-8",
  10. email_domains: [
  11. %{
  12. email_domain: "@bmu.edu",
  13. is_professor_only: false
  14. },
  15. %{
  16. email_domain: "@abc.edu",
  17. is_professor_only: false
  18. }
  19. ]}
  20.  
  21. test "Create/2 creates and responds with a newly created school if attributes are valid", %{jwt: jwt} do
  22. response = build_conn()
  23. |> put_req_header("authorization", "Bearer #{jwt}")
  24. |> put_req_header("content-type", "application/json")
  25. |> post(v1_school_path(build_conn(), :create, Poison.encode!(@valid_school_bmu)))
  26. |> json_response(200)
  27.  
  28. assert response["id"] |> is_integer
  29. assert response["id"] > 0
  30. end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement