Adding SpecFlow bindings for integration testing user's permissions

Enables automated testing of urls and redirects with querystring
Adds bindings for:
-Creating account with a fixed set of permissions
-Login of a user
-Success criteria for seeing text on a page
-Success criteria for being denied access to a page

--HG--
branch : dev
extra : rebase_source : 66e7b33cf7a596050d27eda6351605ed86420af2
This commit is contained in:
Louis DeJardin
2010-12-14 17:50:47 -08:00
parent c56c5b7777
commit 06868e412a
8 changed files with 259 additions and 42 deletions

View File

@@ -294,20 +294,34 @@ namespace Orchard.Specs.Bindings {
Assert.That(Details.ResponseHeaders["Content-Type"], Is.StringMatching(contentType));
}
[Then(@"I should see ""(.*)""")]
[Then(@"I should see ""([^""]*)""")]
public void ThenIShouldSee(string text) {
Assert.That(Details.ResponseText, Is.StringMatching(text));
}
[Then(@"I should not see ""(.*)""")]
[Then(@"I should not see ""([^""]*)""")]
public void ThenIShouldNotSee(string text) {
Assert.That(Details.ResponseText, Is.Not.StringContaining(text));
}
[Then(@"the title contains ""(.*)""")]
[Then(@"the title contains ""([^""]*)""")]
public void ThenTheTitleContainsText(string text) {
ScenarioContext.Current.Pending();
}
[Then(@"I should see ""([^""]*)"" when I go to ""([^""]*)""")]
public void ThenIShouldSeeWhenIGoTo(string text, string urlPath) {
WhenIGoTo(urlPath);
ThenIShouldSee(text);
}
[Then(@"I should be denied access when I go to ""([^""]*)""")]
public void ThenIShouldBeDeniedAccessWhenIGoTo(string urlPath) {
WhenIGoTo(urlPath);
WhenIAmRedirected();
ThenIShouldSee("Access Denied");
}
}
public class Form {