Q:

Rails (hartl tutorial) table user has no column named

I'm working through chapter 9 of Mike Hartl's fabulous Rails tutorial (V3).  Everything went swimmingly until I tried to set up an integration test for the users_index page. 
Relevant files, that I know of:
users.yml
michael:
name: Michael Example
email: michael@example.com
password_digest: <%= User.digest('password') %>

archer:
name: Sterling Archer
email: duchess@example.gov
password_digest: <%= User.digest('password') %>

lana:
name: Lana Kane
email: hands@example.gov
password_digest: <%= User.digest('password') %>

mallory:
name: Mallory Archer
email: boss@example.gov
password_digest: <%= User.digest('password') %>

<% 30.times do |n| %>
user_<%= n %>:
name: <%=  "User #{n}" %>
email: <%= "user-#{n}@example.com" %>
password_digest: <%= User.digest('password') %>
<% end %>

EDIT: That last block in users.yml is definitely involved somehow, when I remove it the rest of the tests pass just fine...but I think it is the database interacting with this code, and I'm not sure exactly how to go about debugging it. 
users_index_test.rb:
require 'test_helper'

class UsersIndexTest < ActionDispatch::IntegrationTest

def setup
@user = users(:michael)
end

test "index including pagination" do
log_in_as(@user)
get users_path
assert_template 'users/index'
assert_select 'div.pagination'
User.paginate(page: 1).each do |user|
  assert_select 'a[href=?]',  user_path(user), text: user.name
end
end

end

Far as I can tell, these match the text and the reference implementation, but when I
bundle exec rake test

I get output just like this for all 34 tests in the suite:
ERROR["test_should_redirect_edit_when_not_logged_in" UsersControllerTest, 2015-09-02 14:05:27 +0000]
test_should_redirect_edit_when_not_logged_in#UsersControllerTest (1441202727.48s)
ActiveRecord::StatementInvalid:         ActiveRecord::StatementInvalid: SQLite3::SQLException: table users has no column named user_0: INSERT INTO "users" ("name", "email", "password_digest", "user_0", "user_1", "user_2", "user_3", "user_4", "user_5", "user_6", "user_7", "user_8", "user_9", "user_10", "user_11", "user_12", "user_13", "user_14", "user_15", "user_16", "user_17", "user_18", "user_19", "user_20", "user_21", "user_22", "user_23", "user_24", "user_25", "user_26", "user_27", "user_28", "user_29", "created_at", "updated_at", "id") VALUES ('User 29', 'user-29@example.com', '$2a$04$WuzW.yzF5SQELTCJdmvA2ubopDH0BA305WKiysdCI1pkzlCPv.v/.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2015-09-02 20:42:20', '2015-09-02 20:42:20', 785162917)

Something is obviously off, but I am not experienced enough with rails to track it down.  The closest problems I have found give similar output ("SQLite3::SQLException: table users has no column named..."), but the solutions I have seen usually involve yaml spacing with tab (which I made sure to check after that tripped me up earlier on in the tutorial). 

A:

Well, this turned out to be a YAML spacing issue - but I don't fully understand why. 
Doesn't work:
<% 30.times do |n| %>
  user_<%= n %>:
  name: <%= "User #{n}" %>
  email: <%= "user-#{n}@example.com" %>
  password_digest: <%= User.digest('password') %>
<% end %>

Doesn't work:
<% 30.times do |n| %>
user_<%= n %>:
name:  <%= "User #{n}" %>
email: <%= "user-#{n}@example.com" %>
password_digest: <%= User.digest('password') %>
<% end %>

Does work:
<% 30.times do |n| %>
user_<%= n %>:
  name:  <%= "User #{n}" %>
  email: <%= "user-#{n}@example.com" %>
  password_digest: <%= User.digest('password') %>
<% end %>

If Line 2 is indented, or if any of lines 3,4 or 5 is NOT indented, it breaks all 34 tests and 116 assertions in my test suite.