Show source code of registered plugins

Change-Id: I8ddc6b59fe3dbff068a23c4aca6d17181a881a2e
diff --git a/t/plugin/auth-oauth.t b/t/plugin/auth-oauth.t
index 80afe05..45281df 100644
--- a/t/plugin/auth-oauth.t
+++ b/t/plugin/auth-oauth.t
@@ -494,7 +494,7 @@
 $csrf = $t->post_ok('/settings/oauth/register' => form => {
   name => 'MyApp',
   type => 'PUBLIC',
-  desc => 'This is my application'
+  desc => 'This is my plugin application'
 })
   ->text_is('div.notify-error', 'Bad CSRF token')
   ->tx->res->dom->at('input[name="csrf_token"]')
@@ -504,7 +504,7 @@
 $t->post_ok('/settings/oauth/register' => form => {
   name => 'MyApp',
   type => 'CONFIDENTIAL',
-  desc => 'This is my application',
+  desc => 'This is my plugin application',
   csrf_token => $csrf,
   src => {
     filename => '',
@@ -526,7 +526,7 @@
   ->text_is('.form-table legend', 'Register new client application')
   ->attr_is('.oauth-register','action', '/settings/oauth/register')
   ->text_is('ul.client-list > li > span.client-name a', 'MyApp')
-  ->text_is('ul.client-list > li > p.client-desc', 'This is my application')
+  ->text_is('ul.client-list > li > p.client-desc', 'This is my plugin application')
   ->header_is('Cache-Control','max-age=0, no-cache, no-store, must-revalidate')
   ->header_is('Expires','Thu, 01 Jan 1970 00:00:00 GMT')
   ->header_is('Pragma','no-cache')
@@ -537,7 +537,7 @@
 $t->get_ok('/settings/oauth/fCBbQkA2NDA3MzM1Yw==')
   ->status_is(200)
   ->text_is('ul.client-list > li.client > span.client-name', 'MyApp')
-  ->text_is('ul.client-list > li.client > p.client-desc', 'This is my application')
+  ->text_is('ul.client-list > li.client > p.client-desc', 'This is my plugin application')
   ->text_is('a.client-unregister', 'Unregister')
   ->attr_is('a.client-unregister', 'href', '/settings/oauth/fCBbQkA2NDA3MzM1Yw==/unregister?name=MyApp')
   ;
@@ -591,7 +591,7 @@
 $t->post_ok('/settings/oauth/register' => form => {
   name => 'MyApp2',
   type => 'PUBLIC',
-  desc => 'This is my application',
+  desc => 'This is my plugin application',
   csrf_token => $csrf
 })->status_is(200)
   ->element_exists('div.notify-success')
@@ -607,7 +607,7 @@
 
 $t->get_ok('/settings/oauth/fCBbQkA2NDA3MzM1Yw==')
   ->text_is('.client-name', 'MyApp2')
-  ->text_is('.client-desc', 'This is my application')
+  ->text_is('.client-desc', 'This is my plugin application')
   ->text_is('.client-issue-token', 'Issue new token')
   ->attr_is('.client-issue-token', 'href', '/settings/oauth/fCBbQkA2NDA3MzM1Yw==/token?name=MyApp2')
   ->header_is('Cache-Control','max-age=0, no-cache, no-store, must-revalidate')
@@ -725,7 +725,7 @@
 $csrf = $t->post_ok('/settings/oauth/register' => form => {
   name => 'MyConfApp',
   type => 'CONFIDENTIAL',
-  desc => 'This is my application',
+  desc => 'This is my plugin application',
 })
   ->text_is('div.notify-error', 'Bad CSRF token')
   ->tx->res->dom->at('input[name="csrf_token"]')
@@ -896,7 +896,7 @@
 my $json_post = {
   name => 'Funny',
   type => 'PUBLIC',
-  desc => 'This is my application',
+  desc => 'This is my plugin application 2',
   csrf_token => $csrf,
   src => 'hMMM'
 };
@@ -938,6 +938,15 @@
   ->text_is('div.notify-success', 'Registration successful')
   ;
 
+$t->get_ok('/settings/oauth/jh0gfjhjbfdsgzjghj==')
+  ->status_is(200)
+  ->text_is('div.notify-error', undef)
+  ->text_is('li.client #client_source', '{"name":"example"}')
+  ->text_is('li.client span.client-name', 'Funny')
+  ->text_is('li.client p.client-desc', 'This is my plugin application 2')
+  ->element_exists_not('li.client .client-redirect-uri tt')
+  ->text_is('li.client .client-type tt', 'CONFIDENTIAL')
+  ;
 
 
 done_testing;