`method_missing': undefined local variable or method `ture' for #<Class:0x007f9922f68110> (NameError) : <p>Hello guys I'm learning how to test code with RSpec and I'm having this error when I try to run Rspec. I think is a bug on Active Record but I search googling and I don't have nothing for help me with this... so my error is this:</p>

<pre><code>$ rspec
/Users/romenigld/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.7.1/lib/active_record/dynamic_matchers.rb:26:in `method_missing': undefined local variable or method `ture' for #&lt;Class:0x007f9922f68110&gt; (NameError)
    from /Users/romenigld/workspace/ebooks/everyday_rails_Testing_with_RSpec/contact_app/app/models/contact.rb:6:in `&lt;class:Contact&gt;'
    from /Users/romenigld/workspace/ebooks/everyday_rails_Testing_with_RSpec/contact_app/app/models/contact.rb:1:in `&lt;top (required)&gt;'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:360:in `require_or_load'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:494:in `load_missing_constant'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:184:in `const_missing'
    from /Users/romenigld/workspace/ebooks/everyday_rails_Testing_with_RSpec/contact_app/spec/models/contact_spec.rb:3:in `&lt;top (required)&gt;'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `load'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `block in load'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `load'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1105:in `block in load_spec_files'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1105:in `each'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1105:in `load_spec_files'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:96:in `setup'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:84:in `run'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:69:in `run'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:37:in `invoke'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/gems/rspec-core-3.1.7/exe/rspec:4:in `&lt;top (required)&gt;'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/bin/rspec:22:in `load'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/bin/rspec:22:in `&lt;main&gt;'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in `eval'
    from /Users/romenigld/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in `&lt;main&gt;'
</code></pre>

<p>My contact_spec.rb</p>

<pre><code>require 'rails_helper'

describe Contact do
  it "is valid with a first_name, last_name and email" do
    contact = Contact.new(
      first_name: 'Aaron',
      last_name: 'Sumner',
      email: 'tester@example.com')
    expect(contact).to be_valid
  end

  it "is invalid without a firstname" do
    contact = Contact.new(first_name: nil)
    contact.valid?
    expect(contact.errors[:first_name]).to include("can't be blank")
  end

  it "is invalid without a lastname" do
    contact = Contact.new(last_name: nil)
    contact.valid?
    expect(contact.errors[:last_name]).to include("can't be blank")
  end

  it "is invalid without an email address" do

  end
  it "is invalid with a duplicate email address" do
    Contact.create(
      first_name: 'Joe',
      last_name: 'Tester',
      email: 'tester@example.com'
    )
    contact = Contact.new(
      first_name: 'Jane',
      last_name: 'Tester',
      email: 'tester@example.com'
    )
    contact.valid?
    expect(contact.errors[:email]).to include("has already been taken")
  end

  it "returns a contact's full name as a string" do
    contact = Contact.new(
      first_name: 'John',
      last_name: 'Doe',
      email: 'johndoe@example.com')
    expect(contact.name).to eq 'John Doe'
  end

  it "returns a sorted array of results taht match" do
    smith = Contact.create(
      first_name: 'John',
      last_name: 'Smith',
      email: 'jsmith@example.com'
    )
    jones = Contact.create(
      first_name: 'Tim',
      last_name: 'Jones',
      email: 'tjones@example.com'
    )
    johnson = Contact.create(
      first_name: 'John',
      last_name: 'johnson',
      email: 'jjohnson@example.com'
    )
    expect(Contact.by_letter("J")).to eq [johnson, jones]
  end

  it "omits results that do not match" do
    smith = Contact.create(
      first_name: 'John',
      last_name: 'Smith',
      email: 'jsmith@example.com'
    )
    jones = Contact.create(
      first_name: 'Tim',
      last_name: 'Jones',
      email: 'tjones@example.com'
    )
    johnson = Contact.create(
      first_name: 'John',
      last_name: 'Johnson',
      email: 'jjohnson@example.com'
    )
    expect(Contact.by_letter("J")).not_to include smith
  end
end
</code></pre>

<p>My contact.rb</p>

<pre><code>class Contact &lt; ActiveRecord::Base
  has_many :phones
  #accepts_nested_attributes_for :phones

  validates :first_name, presence: true
  validates :last_name, presence: ture
  validates :email, presence: true, uniqueness: true
  validates :phones, length: { is: 3 }

  def name
    [first_name, last_name].join('')
  end

  def self.by_letter(letter)
    where("last_name LIKE ?", "#{letter}%").order(:last_name)
  end
end
</code></pre>

<p>If someone can help me I will appreciate!</p>
