everydayrails / rails-4-1-rspec-3-0

Code samples for Everyday Rails Testing with RSpec, Rails 4.1/RSpec 3.0 edition
272 stars 229 forks source link

Ch.5 be_true should be be_truthy #63

Open JunichiIto opened 9 years ago

JunichiIto commented 9 years ago

In chapter 5 Testing non-CRUD methods, the test code uses "be_true" but it should be "be_truthy" since RSpec 3.0. At least, RSpec 3.2 will fail like this:

    example do
      expect(true).to be_true
    end

  4) Sample test true should be true
     Failure/Error: expect(true).to be_true
       expected true to respond to `true?`
     # ./test_spec.rb:46:in `block (3 levels) in <top (required)>'