summaryrefslogtreecommitdiffstats
path: root/it/it-plugins/ui-extensions-plugin/src/main/resources/ruby-api-global-page.erb
diff options
context:
space:
mode:
Diffstat (limited to 'it/it-plugins/ui-extensions-plugin/src/main/resources/ruby-api-global-page.erb')
-rw-r--r--it/it-plugins/ui-extensions-plugin/src/main/resources/ruby-api-global-page.erb33
1 files changed, 33 insertions, 0 deletions
diff --git a/it/it-plugins/ui-extensions-plugin/src/main/resources/ruby-api-global-page.erb b/it/it-plugins/ui-extensions-plugin/src/main/resources/ruby-api-global-page.erb
new file mode 100644
index 00000000000..40aea8687f9
--- /dev/null
+++ b/it/it-plugins/ui-extensions-plugin/src/main/resources/ruby-api-global-page.erb
@@ -0,0 +1,33 @@
+<h1>Ruby API Global Page</h1>
+
+<% success=true %>
+
+<% if logged_in? %>
+ <h2>User Properties</h2>
+ <ul id="user_properties">
+ <%
+ current_user.set_property({:prop_key => 'foo', :text_value => 'bar'})
+ test=current_user.property_value('foo')=='bar'
+ success&=test
+ %>
+ <li>create: <%= 'OK' if test -%></li>
+
+ <%
+ current_user.delete_property('foo')
+ test=current_user.property('foo').nil?
+ success&=test
+ %>
+ <li>delete: <%= 'OK' if test -%></li>
+
+ <%
+ current_user.set_property({:prop_key => 'foo', :text_value => 'bar'})
+ current_user.set_property({:prop_key => 'foo', :text_value => 'newbar'})
+ test=current_user.property_value('foo')=='newbar'
+ success&=test
+ %>
+ <li>update: <%= 'OK' if test -%></li>
+ </ul>
+<% end %>
+
+<br/>
+<p>Result: <span id="ruby-api-result"><%= success ? 'OK' : 'FAIL' %></span></p>