samedi 27 juin 2015

How to determine why an integration test with post request fails

I have written an integration test for a signup form that writes to two tables/models. It fails with the message "Organization.count" didn't change by 1. Is there, however, a way to see with what kind of error message the test fails (the form works in development, although there is an issue with displaying error messages, so I don't understand why the test fails). So I mean the error message you would have seen if you had done the same exact thing on the server to help me find out why it didn't save the organization/user.

  test "valid combined organization user signup" do
    get new_path
    assert_template 'organizations/new'
    assert_difference ['Organization.count', 'User.count'], 1 do
      post organizations_path, organization: { name: "Abc1",
                                               bag: "aef1",
                            users_attributes: [email: "test@test.br",
                                               username: "abc1",
                                               password: "foobar",
                                               password_confirmation: "foobar"] }
       end
  end

Aucun commentaire:

Enregistrer un commentaire