Rails Noob's Notes

Because my memory is good but short.

Rspec

Fake user console input (fake Readline.readline)

In spec_helper.rb


def setup_fake_input(*args)
  allow(Readline).to receive(:readline).and_return(*args)
end

In spec file setup fake input queue

setup_fake_input('help', 'exit')