dimanche 24 mai 2020

Can I see registers after model test in Rails?

I'm new in Ruby on Rails and testing and I'm doign some model tests.

After using rails test command and the test passed, I made a query to the affected tables, but it's empty (there are only two empty registers but no the test ones).

My test code it's this:

test "sign up successful username-pw" do
    params =  { "username": "acme", "password": "foo123" }
    user = User.new(params)
    assert user.save
end

I'm worried about the results because I added in the seed file more registers but I can't see if really are used in the test (according with the results, they didn't).

Is it normal the empty test database or it's something that I'm not considering?

Thanks.

Aucun commentaire:

Enregistrer un commentaire