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

Unique Profile in Writing Tests - Fixtures [Solved]

I've gotten every test to work up to this point. The first_name, last_name, profile_name tests were all working. When I got to the unique profile name, I got these errors. I have followed the tutorial video (even though in the notes they attach to delete password and password confirmation in the Users.yml file. I've done that. I still get this set of code errors. Anyone with some insight, or solution would be much appreciated. I've looked it up, and basically found nothing.

# Running tests: 



Finished tests in 0.006389s, 626.0560 tests/s, 0.0000 assertions/s.
1) Error:
test_a_user_should_enter_a_first_name(UserTest):
ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError 
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures/file.rb:60:in `validate'          /home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures/file.rb:47:in `rows
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures/file.rb:29:in `each'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:670:in `block (2 levels) in read_fixture_files'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures/file.rb:20:in `open"
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:669:in `block in read_fixture_files'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:668:in `each'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:668:in `read_fixture_files'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:548:in `initialize'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:482:in `new'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:482:in `block (2 levels) in create_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:479:in `map'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:479:in `block in create_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract_adapter.rb:168:in     `disable_referential_integrity'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:476:in `create_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:895:in `load_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:849:in `setup_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:407:in     `_run__4220708267194389613__setup__11689859806218904__callbacks'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `__run_callback'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:385:in `_run_setup_callbacks'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:81:in `run_callbacks'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/testing/setup_and_teardown.rb:35:in `run'

 2) Error:


test_a_user_should_enter_a_last_name(UserTest):

ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError

/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures/file.rb:60:in `validate'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures/file.rb:47:in `rows'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures/file.rb:29:in `each'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:670:in `block (2 levels) in read_fixture_files'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures/file.rb:20:in `open'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:669:in `block in read_fixture_files'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:668:in `each' 
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:668:in `read_fixture_files'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:548:in `initialize'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:482:in `new'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:482:in `block (2 levels) in create_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:479:in `map'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:479:in `block in create_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract_adapter.rb:168:in     `disable_referential_integrity'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:476:in `create_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:895:in `load_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:849:in `setup_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:407:in     `_run__4220708267194389613__setup__11689859806218904__callbacks'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `__run_callback'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:385:in `_run_setup_callbacks'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:81:in `run_callbacks'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/testing/setup_and_teardown.rb:35:in `run'


3) Error:


test_a_user_should_enter_a_profile_name(UserTest):

ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError


/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures/file.rb:60:in `validate'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures/file.rb:47:in `rows'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures/file.rb:29:in `each'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:670:in `block (2 levels) in read_fixture_files'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures/file.rb:20:in `open'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:669:in `block in read_fixture_files'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:668:in `each'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:668:in `read_fixture_files'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:548:in `initialize'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:482:in `new'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:482:in `block (2 levels) in create_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:479:in `map'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:479:in `block in create_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract_adapter.rb:168:in     `disable_referential_integrity'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:476:in `create_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:895:in `load_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:849:in `setup_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:407:in     `_run__4220708267194389613__setup__11689859806218904__callbacks'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `__run_callback'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:385:in `_run_setup_callbacks'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:81:in `run_callbacks'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/testing/setup_and_teardown.rb:35:in `run'


4) Error:

test_a_user_should_enter_a_unique_profile_name(UserTest):

ActiveRecord::Fixture::FormatError: ActiveRecord::Fixture::FormatError

/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures/file.rb:60:in `validate'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures/file.rb:47:in `rows'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures/file.rb:29:in `each'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:670:in `block (2 levels) in read_fixture_files'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures/file.rb:20:in `open'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:669:in `block in read_fixture_files'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:668:in `each'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:668:in `read_fixture_files'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:548:in `initialize'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:482:in `new'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:482:in `block (2 levels) in create_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:479:in `map'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:479:in `block in create_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract_adapter.rb:168:in             `disable_referential_integrity'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:476:in `create_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:895:in `load_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:849:in `setup_fixtures'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:407:in             `_run__4220708267194389613__setup__11689859806218904__callbacks'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `__run_callback'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:385:in     `_run_setup_callbacks'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:81:in `run_callbacks'
/home/action/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/testing/setup_and_teardown.rb:35:in     `run'                                                                                                                        


4 tests, 0 assertions, 0 failures, 4 errors, 0 skips

3 Answers

From what I saw, is that all .yml files are EXTREMELY picky about indentation. After like 30-45 minutes of checking and re-checking everything I saw something on StackOverflow about someone's indenting.

I went back and made the changes:

This was my original code:
jason:
first_name: "Jason"
last_name: "Seifer"
email: "jason@teamtreehouse.com"
profile_name: "jasonseifer"

This is my code after:
jason:
  first_name: "Jason"
  last_name: "Seifer"
  email: "jason@teamtreehouse.com"
  profile_name: "jasonseifer"

I am just following up to help people if they fall into this in the future.

Thanks! I also realised that YAML is using indented spaces. One space and it will work:

Check my code below:

            <p>This is code!</p>
            ``` 
jason:

 first_name: "Jason"
 last_name: "Seifer"
 email: "jason@teamtreehouse.com"
 profile_name: "jasonseifer"

Much appreciated Eddie.