-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix: commands were lacking authorizers
- Loading branch information
1 parent
5713b6a
commit f8885a7
Showing
3 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net.Http; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Digitalis.Features; | ||
using Digitalis.Models; | ||
using FakeItEasy; | ||
using FluentAssertions; | ||
using Raven.Client.Documents.Session; | ||
using Specs.Infrastructure; | ||
using Xunit; | ||
|
||
namespace Specs.Features.CreateUser | ||
{ | ||
[Trait("Add New User", "Anon User")] | ||
public class AnonUser : Fixture | ||
{ | ||
private readonly HttpResponseMessage _response; | ||
private readonly Digitalis.Features.CreateUser.Command _newUser; | ||
|
||
public AnonUser() | ||
{ | ||
var client = Client(); | ||
|
||
_newUser = new Digitalis.Features.CreateUser.Command{Email = "[email protected]", Claims = new Dictionary<string, string>()}; | ||
|
||
_response = client.PostAsync("/user", | ||
Serialize(_newUser)).Result; | ||
|
||
WaitForIndexing(Store); | ||
WaitForUserToContinueTheTest(Store); | ||
} | ||
|
||
[Fact(DisplayName = "1. Status 401 is returned")] | ||
public void StatusReturned() | ||
{ | ||
_response.StatusCode.Should().Be(401); | ||
} | ||
} | ||
} |