Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Integration Test Error

I'm on the very first video for Integration Testing Our Whole App section in the Rails beginner course.

My custom_test.rb file is this:

require 'test_helper'

class CustomTest < ActionDispatch::IntegrationTest
test "that login route opens the login page" do
get '/login'
assert_response :success
end
end

But when I run the test, I get this error in terminal:

1) Error: CustomTest#test_that_login_route_opens_the_login_page: ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError

1 runs, 0 assertions, 0 failures, 1 errors, 0 skips

I've been looking around for this particular error, and I'm not finding much on it. Can anyone help me out with this?

Does this have to do with the fact that I'm using Rails 4?

I checked the rails guides docs, and it does show the code as being right, so I'm not to sure what I should do.

Thanks, David, but no that is in another section of the course.

You probably don't have a valid yaml fixture. Can you post your fixtures code?

3 Answers

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Anthony Myers in your test/fixtures/users.yml file, everything below the line that says "tony:" needs to be indented with two spaces, then that error should disappear.

Thanks, Jason!

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Hey Anthony Myers try checking all of the yml files in your test/fixtures directory. Make sure that any indentation is done with spaces instead of tabs. You can also post a link to your code up on GitHub and we can take a look.

Thanks, Jason Seifer here is the link to the app so far, on github: https://github.com/Preeminent/treebook

Thanks, Bernardo Simรตes , here is the users.yml test file

tony:
first_name: "tony"
last_name: "test"
profile_name: "demodude"
password: "password"
password_confirmation: "password"