From c19807e2834d6457f9191d7df44afece6a95ec54 Mon Sep 17 00:00:00 2001 From: Ibrahim Hussein Date: Thu, 25 Jan 2018 13:29:37 +1100 Subject: [PATCH] added test for access with default credentials #8 --- security/author_spec.rb | 10 +++++++++- security/publish_spec.rb | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/security/author_spec.rb b/security/author_spec.rb index 2fded01..37bffe3 100644 --- a/security/author_spec.rb +++ b/security/author_spec.rb @@ -3,9 +3,17 @@ describe 'Author', type: :feature do before :each do @conf = read_config + @aem_author = init_author_client(@conf['aem']['author']) end it 'should not be able to login using default admin password' do + # use aem api calls + aem = @aem_author.aem + begin + aem.get_agents('author') + rescue RubyAem::Error => error + # response should be unauthorized + expect(error.result.response.status_code).to eq(401) + end end - end diff --git a/security/publish_spec.rb b/security/publish_spec.rb index 3871239..66b1f94 100644 --- a/security/publish_spec.rb +++ b/security/publish_spec.rb @@ -3,9 +3,17 @@ describe 'Publish', type: :feature do before :each do @conf = read_config + @aem_publish = init_publish_client(@conf['aem']['publish']) end it 'should not be able to login using default admin password' do + # use aem api calls + aem = @aem_publish.aem + begin + aem.get_agents('publish') + rescue RubyAem::Error => error + # response should be unauthorized + expect(error.result.response.status_code).to eq(401) + end end - end