text stringlengths 0 234 |
|---|
if Key = "" then |
return; |
end if; |
ASF.Tests.Do_Get (Request, Reply, "/auth/invitation.html?key=" & Key, "invitation-ok.html"); |
ASF.Tests.Assert_Contains (T, "Accept invitation", Reply, |
"Accept invitation page is invalid"); |
end Verify_Anonymous; |
-- ------------------------------ |
-- Test sending an invitation. |
-- ------------------------------ |
procedure Test_Invite_User (T : in out Test) is |
use type ADO.Identifier; |
use type AWA.Workspaces.Beans.Invitation_Bean_Access; |
Request : ASF.Requests.Mockup.Request; |
Reply : ASF.Responses.Mockup.Response; |
Invite : AWA.Workspaces.Beans.Invitation_Bean_Access; |
begin |
AWA.Tests.Helpers.Users.Login ("test-invite@test.com", Request); |
Request.Set_Parameter ("email", "invited-user@test.com"); |
Request.Set_Parameter ("message", "I invite you to this application"); |
Request.Set_Parameter ("send", "1"); |
Request.Set_Parameter ("invite", "1"); |
ASF.Tests.Do_Post (Request, Reply, "/workspaces/invite.html", "invite.html"); |
T.Assert (Reply.Get_Status = ASF.Responses.SC_MOVED_TEMPORARILY, |
"Invalid response after invitation creation"); |
-- Verify the invitation by looking at the inviteUser bean. |
Invite := Get_Invitation_Bean (Request, "inviteUser"); |
T.Assert (Invite /= null, "Null inviteUser bean"); |
T.Assert (Invite.Get_Id /= ADO.NO_IDENTIFIER, "The invite ID is invalid"); |
T.Assert (not Invite.Get_Access_Key.Is_Null, "The invite access key is null"); |
T.Assert (Invite.Get_Member.Is_Inserted, "The invitation has a workspace member"); |
T.Key := Invite.Get_Access_Key.Get_Access_Key; |
T.Verify_Anonymous (Invite.Get_Access_Key.Get_Access_Key); |
T.Member_ID := Invite.Get_Member.Get_Id; |
end Test_Invite_User; |
-- ------------------------------ |
-- Test deleting the member. |
-- ------------------------------ |
procedure Test_Delete_Member (T : in out Test) is |
Request : ASF.Requests.Mockup.Request; |
Reply : ASF.Responses.Mockup.Response; |
begin |
T.Test_Invite_User; |
AWA.Tests.Helpers.Users.Login ("test-invite@test.com", Request); |
declare |
Id : constant String := ADO.Identifier'Image (T.Member_Id); |
begin |
Request.Set_Parameter ("member-id", Id); |
Request.Set_Parameter ("delete", "1"); |
Request.Set_Parameter ("delete-member-form", "1"); |
ASF.Tests.Do_Post (Request, Reply, "/workspaces/forms/delete-member.html", |
"delete-member.html"); |
T.Assert (Reply.Get_Status = ASF.Responses.SC_OK, |
"Invalid response after delete member operation"); |
ASF.Tests.Assert_Contains (T, "deleteDialog_" & Id (Id'First + 1 .. Id'Last), Reply, |
"Delete member dialog operation response is invalid"); |
Function Definition: function Get is new AWA.Modules.Get (Counter_Module, Counter_Module_Access, NAME); |
Function Body: begin |
return Get; |
end Get_Counter_Module; |
-- ------------------------------ |
-- Increment the counter identified by <tt>Counter</tt> and associated with the |
-- database object <tt>Object</tt>. |
-- ------------------------------ |
procedure Increment (Plugin : in out Counter_Module; |
Counter : in Counter_Index_Type; |
Object : in ADO.Objects.Object_Ref'Class) is |
Key : constant ADO.Objects.Object_Key := Object.Get_Key; |
begin |
if Plugin.Counters.Need_Flush (Plugin.Counter_Limit, Plugin.Age_Limit) then |
Plugin.Flush; |
end if; |
Plugin.Counters.Increment (Counter, Key); |
end Increment; |
-- ------------------------------ |
-- Increment the counter identified by <tt>Counter</tt> and associated with the |
-- database object key <tt>Key</tt>. |
-- ------------------------------ |
procedure Increment (Plugin : in out Counter_Module; |
Counter : in Counter_Index_Type; |
Key : in ADO.Objects.Object_Key) is |
begin |
if Plugin.Counters.Need_Flush (Plugin.Counter_Limit, Plugin.Age_Limit) then |
Plugin.Flush; |
end if; |
Plugin.Counters.Increment (Counter, Key); |
end Increment; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.