Do not return mail password in EmailController

This commit is contained in:
Chris Hunt
2013-06-11 16:00:13 -07:00
parent acb2126220
commit a362d62b42
2 changed files with 31 additions and 14 deletions

View File

@ -10,11 +10,21 @@ describe Admin::EmailController do
context '.index' do
before do
subject.expects(:action_mailer_settings).returns({
username: 'username',
password: 'secret'
})
xhr :get, :index
end
subject { response }
it { should be_success }
it 'does not include the password in the response' do
mail_settings = JSON.parse(response.body)['settings']
expect(
mail_settings.select { |setting| setting['name'] == 'password' }
).to be_empty
end
end
context '.logs' do