thoughtbot/factory_girl — comment on commit a883315bc4775f5b9996a378d6c4ebe0ebf44a5e
File:  line 0
By masterkain:

Uhm..while `@track_attributes = attributes_for(:audio_file)` returned a set of attributes valid for creating a record `@track_attributes = build(:audio_file).attributes` will return a complete object with the undeclared attributes set to `nil`

The key difference here is that if someone is using `config.active_record.mass_assignment_sanitizer = :strict` like me we have a hard time using the method to generate a proper test:

string = $verifier.generate(audio: @track_attributes, auth_token: @user.authentication_token, now: Time.now.utc, pass: Settings.app.node.crypto_key)
post 'notify_file_ready', k: string, format: 'json'

Failure/Error: post 'notify_file_ready', k: string, format: 'json'
ActiveModel::MassAssignmentSecurity::Error:
Can't mass-assign protected attributes: ....