expected true to respond to true?

From rspec 3.0, be_true is renamed to be_truthy and be_false to be_falsey The behavior has not changed. So (nil).should be_falsey (false).should be_falsey will pass, and (anything other than nil or false).should be_truthy will also pass From the changelog 3.0.0.beta1 / 2013-11-07 Rename be_true and be_false to be_truthy and be_falsey. (Sam Phippen)

RSpec allow/expect vs just expect/and_return

See the classic article Mocks Aren’t Stubs. allow makes a stub while expect makes a mock. That is allow allows an object to return X instead of whatever it would return unstubbed, and expect is an allow plus an expectation of some state or event. When you write allow(Foo).to receive(:bar).with(baz).and_return(foobar_result) … you’re telling the spec … Read more

How is spec/rails_helper.rb different from spec/spec_helper.rb? Do I need it?

rspec-rails 3 generates spec_helper.rb and rails_helper.rb. spec_helper.rb is for specs which don’t depend on Rails (such as specs for classes in the lib directory). rails_helper.rb is for specs which do depend on Rails (in a Rails project, most or all of them). rails_helper.rb requires spec_helper.rb. So no, don’t get rid of rails_helper.rb; require it (and … Read more