require "minitest_helper" describe User do describe "password authentication" do let(:user) { User.new } it { user.must validate_presence_of(:email) } it { user.must_respond_to(:password) } it { user.must_respond_to(:password_confirmation) } it { user.must_respond_to(:authenticate) } describe "uniqueness" do before do existing_user = User.new(email: "blah@blah.com") existing_user.stubs(:valid?).returns(true) existing_user.save end it { user.must validate_presence_of(:email) } end end end