Welcome to the Treehouse Community
Looking to learn something new?
test_a_user_can_have_a_correctly_formatted_profile_name(UserTest) [test/unit/use r_test.rb:46]:
Finished tests in 0.359020s, 16.7122 tests/s, 33.4243 assertions/s.
1) Failure: test_a_user_can_have_a_correctly_formatted_profile_name(UserTest) [test/unit/use r_test.rb:46]: Failed assertion, no message given.
6 tests, 12 assertions, 1 failures, 0 errors, 0 skips
did you ever figure that out cuz I'm getting the same thing if so can you help me with this problem thanks
to Robert ho, change your can to should and the error should go away. at least it worked for me but I'm get a status controller failure that I need to work on. can you try this and repost it to see if it worked. code should look like this. test "a user should have a correctly formatted profile name " do
Robert HoCourses Plus Student 11,383 Points
i think it doesn't matter what you put in between the quotes. it's just a name for the test. for example, you can type: test "whats up everbody!" do for the name of any test and it will work as long the code for what you are testing is correct.
can you paste you code and I will check mine.
This is my code and it passed, test "a user should have a profile name without spaces" do user = User.new(first_name: ' ', last_name: ' ', email: ) user.password = user.password_confirmation = ' I just removed my personal info
C:\Users\Documents\Applications\treebook>ruby -I test test/unit/user_test.rb Run options:
Finished tests in 0.312001s, 19.2307 tests/s, 38.4614 assertions/s.
6 tests, 12 assertions, 0 failures, 0 errors, 0 skips
Jason SeiferTreehouse Guest Teacher
Hey all, in the future, please paste a link to your code on GitHub or some place else so we can take a look and troubleshoot. That makes it much easier to figure out what's going on. If you aren't that far yet, you can also always drop a line to email@example.com.
Frankie Rosa what's in your test/fixtures/users.yml file? And in your user_test file?
I had the same error (slightly different line number). Simple fix, once you know the problem.
The problem was that you need to set the user email: address in user_test.rb to NOT MATCH the email address set in the users.yml fixture.
This was hard to figure out since Jason set the parameters of the user variable in user_test.rb to values that were very similar to the fixture.