reveal API key with user password
This commit is contained in:
committed by
Pete Matsyburka
parent
c04bb2d7cf
commit
f40f1d25de
@@ -14,4 +14,26 @@ RSpec.describe 'API Settings' do
|
||||
token = user.access_token.token
|
||||
expect(page).to have_field('X-Auth-Token', with: token.sub(token[5..], '*' * token[5..].size))
|
||||
end
|
||||
|
||||
it 'reveals API key with correct password' do
|
||||
find('#api_key').click
|
||||
|
||||
within('.modal') do
|
||||
fill_in 'password', with: user.password
|
||||
click_button 'Submit'
|
||||
end
|
||||
|
||||
expect(page).to have_field('X-Auth-Token', with: user.access_token.token)
|
||||
end
|
||||
|
||||
it 'shows error with incorrect password' do
|
||||
find('#api_key').click
|
||||
|
||||
within('.modal') do
|
||||
fill_in 'password', with: 'wrong_password'
|
||||
click_button 'Submit'
|
||||
end
|
||||
|
||||
expect(page).to have_content('Wrong password')
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user