Sha256: c24568ce7280da6c174c8e9e7e208026fb7b43aa79e711e97eaa4c8656d88e29
Contents?: true
Size: 1.05 KB
Versions: 22
Compression:
Stored size: 1.05 KB
Contents
RSpec.shared_examples 'Nyauth::Authenticatable' do |klass| it_behaves_like 'Nyauth::PasswordDigestAbility', klass let!(:instance) { create(klass.name.downcase.to_sym, email: email, password: password) } describe '.authenticate' do let(:email) { 'correct@example.com' } let(:password) { 'password' } subject { klass.authenticate(given_email, given_password) } context 'when correct email' do let(:given_email) { email } context 'and correct password' do let(:given_password) { password } it { is_expected.to eq instance } end context 'and wrong password' do let(:given_password) { 'invalid' } it { is_expected.to be_nil } end end context 'when wrong email' do let(:given_email) { 'wrong@example.com' } context 'and correct password' do let(:given_password) { password } it { is_expected.to be_nil } end context 'and wrong password' do let(:given_password) { 'invalid' } it { is_expected.to be_nil } end end end end
Version data entries
22 entries across 22 versions & 1 rubygems