mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +08:00
Fix some specflow tests to not being ignored anymore
--HG-- branch : 1.x
This commit is contained in:
@@ -294,29 +294,22 @@ namespace Orchard.Specs.Bindings {
|
|||||||
Assert.That(Details.ResponseHeaders["Content-Type"], Is.StringMatching(contentType));
|
Assert.That(Details.ResponseHeaders["Content-Type"], Is.StringMatching(contentType));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Then(@"I should see ""([^""]*)""")]
|
[Then(@"I should see ""(.*)""")]
|
||||||
public void ThenIShouldSee(string text) {
|
public void ThenIShouldSee(string text) {
|
||||||
Assert.That(Details.ResponseText, Is.StringMatching(text));
|
Assert.That(Details.ResponseText, Is.StringMatching(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Then(@"I should not see ""([^""]*)""")]
|
[Then(@"I should not see ""(.*)""")]
|
||||||
public void ThenIShouldNotSee(string text) {
|
public void ThenIShouldNotSee(string text) {
|
||||||
Assert.That(Details.ResponseText, Is.Not.StringContaining(text));
|
Assert.That(Details.ResponseText, Is.Not.StringContaining(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Then(@"the title contains ""([^""]*)""")]
|
[Then(@"the title contains ""(.*)""")]
|
||||||
public void ThenTheTitleContainsText(string text) {
|
public void ThenTheTitleContainsText(string text) {
|
||||||
ScenarioContext.Current.Pending();
|
ScenarioContext.Current.Pending();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Then(@"I should be denied access when I go to ""(.*)""")]
|
||||||
[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) {
|
public void ThenIShouldBeDeniedAccessWhenIGoTo(string urlPath) {
|
||||||
WhenIGoTo(urlPath);
|
WhenIGoTo(urlPath);
|
||||||
WhenIAmRedirected();
|
WhenIAmRedirected();
|
||||||
|
@@ -23,6 +23,7 @@ Scenario: Anonymous user can see the home page but not the dashboard
|
|||||||
Given I have installed Orchard
|
Given I have installed Orchard
|
||||||
And I have a user "bob" with permissions "AccessFrontEnd"
|
And I have a user "bob" with permissions "AccessFrontEnd"
|
||||||
When I sign in as "bob"
|
When I sign in as "bob"
|
||||||
Then I should see "this is the homepage of your new site" when I go to "/"
|
And I go to "/"
|
||||||
|
Then I should see "this is the homepage of your new site"
|
||||||
And I should be denied access when I go to "admin"
|
And I should be denied access when I go to "admin"
|
||||||
|
|
||||||
|
4
src/Orchard.Specs/PermissionModel.feature.cs
generated
4
src/Orchard.Specs/PermissionModel.feature.cs
generated
@@ -110,8 +110,10 @@ this.ScenarioSetup(scenarioInfo);
|
|||||||
#line 25
|
#line 25
|
||||||
testRunner.When("I sign in as \"bob\"");
|
testRunner.When("I sign in as \"bob\"");
|
||||||
#line 26
|
#line 26
|
||||||
testRunner.Then("I should see \"this is the homepage of your new site\" when I go to \"/\"");
|
testRunner.And("I go to \"/\"");
|
||||||
#line 27
|
#line 27
|
||||||
|
testRunner.Then("I should see \"this is the homepage of your new site\"");
|
||||||
|
#line 28
|
||||||
testRunner.And("I should be denied access when I go to \"admin\"");
|
testRunner.And("I should be denied access when I go to \"admin\"");
|
||||||
#line hidden
|
#line hidden
|
||||||
testRunner.CollectScenarioErrors();
|
testRunner.CollectScenarioErrors();
|
||||||
|
Reference in New Issue
Block a user