Fix SpecFlow tests

--HG--
branch : dev
This commit is contained in:
Renaud Paquay
2010-12-11 14:39:37 -08:00
parent 94192a667b
commit 01fdf07b95
2 changed files with 77 additions and 76 deletions

View File

@@ -11,7 +11,7 @@ Scenario: Administrators can manage a Page
Scenario: Users can't create a Page if they don't have the PublishContent permission Scenario: Users can't create a Page if they don't have the PublishContent permission
Given I have installed Orchard Given I have installed Orchard
When I have a role "CustomRole" with permissions "EditContent, DeleteContent" When I have a role "CustomRole" with permissions "EditOthersContent, DeleteOthersContent"
And I have a user "user1" with roles "CustomRole" And I have a user "user1" with roles "CustomRole"
Then "user1" should not be able to "publish" a "Page" owned by "user1" Then "user1" should not be able to "publish" a "Page" owned by "user1"
And "user1" should be able to "edit" a "Page" owned by "user1" And "user1" should be able to "edit" a "Page" owned by "user1"
@@ -19,7 +19,7 @@ Scenario: Users can't create a Page if they don't have the PublishContent permis
Scenario: Users can create a Page of others if they have PublishContent permission Scenario: Users can create a Page of others if they have PublishContent permission
Given I have installed Orchard Given I have installed Orchard
When I have a role "CustomRole" with permissions "PublishContent" When I have a role "CustomRole" with permissions "PublishOthersContent"
And I have a user "user1" with roles "CustomRole" And I have a user "user1" with roles "CustomRole"
And I have a user "user2" with roles "Administrator" And I have a user "user2" with roles "Administrator"
Then "user1" should be able to "publish" a "Page" owned by "user2" Then "user1" should be able to "publish" a "Page" owned by "user2"
@@ -44,7 +44,7 @@ Scenario: Users can create and edit a Page even if they only have the PublishOwn
Scenario: Users can't edit a Page if they don't have the EditContent permission Scenario: Users can't edit a Page if they don't have the EditContent permission
Given I have installed Orchard Given I have installed Orchard
When I have a role "CustomRole" with permissions "DeleteContent" When I have a role "CustomRole" with permissions "DeleteOthersContent"
And I have a user "user1" with roles "CustomRole" And I have a user "user1" with roles "CustomRole"
Then "user1" should not be able to "publish" a "Page" owned by "user1" Then "user1" should not be able to "publish" a "Page" owned by "user1"
And "user1" should not be able to "edit" a "Page" owned by "user1" And "user1" should not be able to "edit" a "Page" owned by "user1"

View File

@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by SpecFlow (http://www.specflow.org/). // This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.3.2.0 // SpecFlow Version:1.4.0.0
// Runtime Version:4.0.30319.1 // Runtime Version:4.0.30319.1
// //
// Changes to this file may cause incorrect behavior and will be lost if // Changes to this file may cause incorrect behavior and will be lost if
@@ -14,7 +14,7 @@ namespace Orchard.Specs
using TechTalk.SpecFlow; using TechTalk.SpecFlow;
[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.3.2.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.4.0.0")]
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.TestFixtureAttribute()]
[NUnit.Framework.DescriptionAttribute("Content rights management")] [NUnit.Framework.DescriptionAttribute("Content rights management")]
@@ -31,7 +31,7 @@ namespace Orchard.Specs
{ {
testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Content rights management", "In order to ensure security\r\nAs a root Orchard system operator\r\nI want only the a" + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Content rights management", "In order to ensure security\r\nAs a root Orchard system operator\r\nI want only the a" +
"llowed users to edit the content", ((string[])(null))); "llowed users to edit the content", GenerationTargetLanguage.CSharp, ((string[])(null)));
testRunner.OnFeatureStart(featureInfo); testRunner.OnFeatureStart(featureInfo);
} }
@@ -61,13 +61,13 @@ namespace Orchard.Specs
#line 6 #line 6
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 7 #line 7
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 8 #line 8
testRunner.When("I have a user \"user1\" with roles \"Administrator\""); testRunner.When("I have a user \"user1\" with roles \"Administrator\"");
#line 9 #line 9
testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user1\""); testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user1\"");
#line 10 #line 10
testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user1\""); testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user1\"");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }
@@ -80,17 +80,18 @@ testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user1
#line 12 #line 12
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 13 #line 13
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 14 #line 14
testRunner.When("I have a role \"CustomRole\" with permissions \"EditContent, DeleteContent\""); testRunner.When("I have a role \"CustomRole\" with permissions \"EditOthersContent, DeleteOthersConte" +
"nt\"");
#line 15 #line 15
testRunner.And("I have a user \"user1\" with roles \"CustomRole\""); testRunner.And("I have a user \"user1\" with roles \"CustomRole\"");
#line 16 #line 16
testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user1\""); testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user1\"");
#line 17 #line 17
testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user1\""); testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user1\"");
#line 18 #line 18
testRunner.And("\"user1\" should be able to \"delete\" a \"Page\" owned by \"user1\""); testRunner.And("\"user1\" should be able to \"delete\" a \"Page\" owned by \"user1\"");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }
@@ -103,19 +104,19 @@ testRunner.And("\"user1\" should be able to \"delete\" a \"Page\" owned by \"use
#line 20 #line 20
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 21 #line 21
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 22 #line 22
testRunner.When("I have a role \"CustomRole\" with permissions \"PublishContent\""); testRunner.When("I have a role \"CustomRole\" with permissions \"PublishOthersContent\"");
#line 23 #line 23
testRunner.And("I have a user \"user1\" with roles \"CustomRole\""); testRunner.And("I have a user \"user1\" with roles \"CustomRole\"");
#line 24 #line 24
testRunner.And("I have a user \"user2\" with roles \"Administrator\""); testRunner.And("I have a user \"user2\" with roles \"Administrator\"");
#line 25 #line 25
testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user2\""); testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user2\"");
#line 26 #line 26
testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user2\""); testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user2\"");
#line 27 #line 27
testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\""); testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\"");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }
@@ -128,17 +129,17 @@ testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \
#line 29 #line 29
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 30 #line 30
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 31 #line 31
testRunner.When("I have a role \"CustomRole\" with permissions \"Publish_Page\""); testRunner.When("I have a role \"CustomRole\" with permissions \"Publish_Page\"");
#line 32 #line 32
testRunner.And("I have a user \"user1\" with roles \"CustomRole\""); testRunner.And("I have a user \"user1\" with roles \"CustomRole\"");
#line 33 #line 33
testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user1\""); testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user1\"");
#line 34 #line 34
testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user1\""); testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user1\"");
#line 35 #line 35
testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user1\""); testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user1\"");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }
@@ -153,17 +154,17 @@ testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \
#line 37 #line 37
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 38 #line 38
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 39 #line 39
testRunner.When("I have a role \"CustomRole\" with permissions \"PublishOwnContent\""); testRunner.When("I have a role \"CustomRole\" with permissions \"PublishOwnContent\"");
#line 40 #line 40
testRunner.And("I have a user \"user1\" with roles \"CustomRole\""); testRunner.And("I have a user \"user1\" with roles \"CustomRole\"");
#line 41 #line 41
testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user1\""); testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user1\"");
#line 42 #line 42
testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user1\""); testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user1\"");
#line 43 #line 43
testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user1\""); testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user1\"");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }
@@ -176,17 +177,17 @@ testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \
#line 45 #line 45
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 46 #line 46
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 47 #line 47
testRunner.When("I have a role \"CustomRole\" with permissions \"DeleteContent\""); testRunner.When("I have a role \"CustomRole\" with permissions \"DeleteOthersContent\"");
#line 48 #line 48
testRunner.And("I have a user \"user1\" with roles \"CustomRole\""); testRunner.And("I have a user \"user1\" with roles \"CustomRole\"");
#line 49 #line 49
testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user1\""); testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user1\"");
#line 50 #line 50
testRunner.And("\"user1\" should not be able to \"edit\" a \"Page\" owned by \"user1\""); testRunner.And("\"user1\" should not be able to \"edit\" a \"Page\" owned by \"user1\"");
#line 51 #line 51
testRunner.And("\"user1\" should be able to \"delete\" a \"Page\" owned by \"user1\""); testRunner.And("\"user1\" should be able to \"delete\" a \"Page\" owned by \"user1\"");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }
@@ -199,19 +200,19 @@ testRunner.And("\"user1\" should be able to \"delete\" a \"Page\" owned by \"use
#line 53 #line 53
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 54 #line 54
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 55 #line 55
testRunner.When("I have a role \"CustomRole\" with permissions \"PublishOwnContent\""); testRunner.When("I have a role \"CustomRole\" with permissions \"PublishOwnContent\"");
#line 56 #line 56
testRunner.And("I have a user \"user1\" with roles \"CustomRole\""); testRunner.And("I have a user \"user1\" with roles \"CustomRole\"");
#line 57 #line 57
testRunner.And("I have a user \"user2\" with roles \"Administrator\""); testRunner.And("I have a user \"user2\" with roles \"Administrator\"");
#line 58 #line 58
testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user2\""); testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user2\"");
#line 59 #line 59
testRunner.And("\"user1\" should not be able to \"edit\" a \"Page\" owned by \"user2\""); testRunner.And("\"user1\" should not be able to \"edit\" a \"Page\" owned by \"user2\"");
#line 60 #line 60
testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\""); testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\"");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }
@@ -224,19 +225,19 @@ testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \
#line 62 #line 62
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 63 #line 63
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 64 #line 64
testRunner.When("I have a role \"CustomRole\" with permissions \"Publish_Page\""); testRunner.When("I have a role \"CustomRole\" with permissions \"Publish_Page\"");
#line 65 #line 65
testRunner.And("I have a user \"user1\" with roles \"CustomRole\""); testRunner.And("I have a user \"user1\" with roles \"CustomRole\"");
#line 66 #line 66
testRunner.And("I have a user \"user2\" with roles \"Administrator\""); testRunner.And("I have a user \"user2\" with roles \"Administrator\"");
#line 67 #line 67
testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user2\""); testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user2\"");
#line 68 #line 68
testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user2\""); testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user2\"");
#line 69 #line 69
testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\""); testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\"");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }
@@ -249,19 +250,19 @@ testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \
#line 71 #line 71
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 72 #line 72
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 73 #line 73
testRunner.When("I have a role \"CustomRole\" with permissions \"Publish_Page\""); testRunner.When("I have a role \"CustomRole\" with permissions \"Publish_Page\"");
#line 74 #line 74
testRunner.And("I have a user \"user1\" with roles \"CustomRole\""); testRunner.And("I have a user \"user1\" with roles \"CustomRole\"");
#line 75 #line 75
testRunner.And("I have a user \"user2\" with roles \"Administrator\""); testRunner.And("I have a user \"user2\" with roles \"Administrator\"");
#line 76 #line 76
testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user2\""); testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user2\"");
#line 77 #line 77
testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user2\""); testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user2\"");
#line 78 #line 78
testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\""); testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\"");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }
@@ -274,19 +275,19 @@ testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \
#line 80 #line 80
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 81 #line 81
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 82 #line 82
testRunner.When("I have a role \"CustomRole\" with permissions \"Delete_Page\""); testRunner.When("I have a role \"CustomRole\" with permissions \"Delete_Page\"");
#line 83 #line 83
testRunner.And("I have a user \"user1\" with roles \"CustomRole\""); testRunner.And("I have a user \"user1\" with roles \"CustomRole\"");
#line 84 #line 84
testRunner.And("I have a user \"user2\" with roles \"Administrator\""); testRunner.And("I have a user \"user2\" with roles \"Administrator\"");
#line 85 #line 85
testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user2\""); testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user2\"");
#line 86 #line 86
testRunner.And("\"user1\" should not be able to \"edit\" a \"Page\" owned by \"user2\""); testRunner.And("\"user1\" should not be able to \"edit\" a \"Page\" owned by \"user2\"");
#line 87 #line 87
testRunner.And("\"user1\" should be able to \"delete\" a \"Page\" owned by \"user2\""); testRunner.And("\"user1\" should be able to \"delete\" a \"Page\" owned by \"user2\"");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }
@@ -299,19 +300,19 @@ testRunner.And("\"user1\" should be able to \"delete\" a \"Page\" owned by \"use
#line 90 #line 90
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 91 #line 91
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 92 #line 92
testRunner.When("I have a role \"CustomRole\" with permissions \"DeleteOwn_Page\""); testRunner.When("I have a role \"CustomRole\" with permissions \"DeleteOwn_Page\"");
#line 93 #line 93
testRunner.And("I have a user \"user1\" with roles \"CustomRole\""); testRunner.And("I have a user \"user1\" with roles \"CustomRole\"");
#line 94 #line 94
testRunner.And("I have a user \"user2\" with roles \"Administrator\""); testRunner.And("I have a user \"user2\" with roles \"Administrator\"");
#line 95 #line 95
testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user2\""); testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user2\"");
#line 96 #line 96
testRunner.And("\"user1\" should not be able to \"edit\" a \"Page\" owned by \"user2\""); testRunner.And("\"user1\" should not be able to \"edit\" a \"Page\" owned by \"user2\"");
#line 97 #line 97
testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\""); testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\"");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }