freight v0.3.1 Freight.Helpers.Test

These helpers can be used in your ExUnit tests, while dealing with mutation payloads.

Example

test "throws errors" do
    map
    |> assert_unsuccessful?()
    |> assert_has_error?("this does not work this way")
    |> assert_has_error?("and neither does this")
end

Link to this section Summary

Functions

Checks whether the mutation returned an error with the given message in its payload

Asserts whether the mutation was successful

Asserts whether the mutation was not successful

Link to this section Functions

Link to this function

assert_has_error?(map, message)

Checks whether the mutation returned an error with the given message in its payload

Link to this function

assert_successful?(map)

Asserts whether the mutation was successful

Link to this function

assert_unsuccessful?(map)

Asserts whether the mutation was not successful