4648
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
using System;
|
||||
using Xunit;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using FluentAssertions;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace raven_integration
|
||||
{
|
||||
@@ -18,7 +14,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async Task ServerShouldNotAllowUnauthenticatedAccess()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("widget/list");
|
||||
ApiResponse a = await Util.GetAsync("project/list");
|
||||
Util.ValidateHTTPStatusCode(a, 401);
|
||||
}
|
||||
|
||||
@@ -28,7 +24,7 @@ namespace raven_integration
|
||||
[Fact]
|
||||
public async Task ServerShouldNotAllowReadUnauthorizedAccess()
|
||||
{
|
||||
ApiResponse a = await Util.GetAsync("widget/listwidgets", await Util.GetTokenAsync( "OpsAdmin"));
|
||||
ApiResponse a = await Util.GetAsync("project/listprojects", await Util.GetTokenAsync( "OpsAdmin"));
|
||||
//2004 unauthorized
|
||||
Util.ValidateErrorCodeResponse(a, 2004, 403);
|
||||
}
|
||||
@@ -43,14 +39,14 @@ namespace raven_integration
|
||||
{
|
||||
//CREATE
|
||||
dynamic d = new JObject();
|
||||
d.name = Util.Uniquify("ServerShouldNotAllowCreateUnauthorizedAccess TEST WIDGET");
|
||||
d.name = Util.Uniquify("ServerShouldNotAllowCreateUnauthorizedAccess TEST PROJECT");
|
||||
d.created = DateTime.Now.ToString();
|
||||
d.dollarAmount = 1.11m;
|
||||
d.active = true;
|
||||
d.usertype = 1;
|
||||
|
||||
//BizAdminRestricted user should not be able to create a widget, only read them
|
||||
ApiResponse a = await Util.PostAsync("widget", await Util.GetTokenAsync( "BizAdminRestricted"), d.ToString());
|
||||
//BizAdminRestricted user should not be able to create a project, only read them
|
||||
ApiResponse a = await Util.PostAsync("project", await Util.GetTokenAsync( "BizAdminRestricted"), d.ToString());
|
||||
|
||||
//2004 unauthorized
|
||||
Util.ValidateErrorCodeResponse(a, 2004, 403);
|
||||
|
||||
Reference in New Issue
Block a user