--HG--
branch : 1.x
This commit is contained in:
Andre Rodrigues
2011-01-06 16:25:59 -08:00
2 changed files with 36 additions and 33 deletions

View File

@@ -1,27 +1,28 @@
Feature: Addition Feature: Addition
In order to prevent security model regressions In order to prevent security model regressions
As a user with specific permissions As a user with specific permissions
I should to be granted or denied access to various actions I should to be granted or denied access to various actions
@security @security
Scenario: Login can be automated Scenario: Login can be automated
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 go to "users/account/logoff" When I go to "users/account/logoff"
And I go to "users/account/logon" And I go to "users/account/logon"
And I fill in And I fill in
| name | value | | name | value |
| userNameOrEmail | bob | | userNameOrEmail | bob |
| password | qwerty123! | | password | qwerty123! |
And I hit "Sign In" And I hit "Sign In"
And I am redirected And I am redirected
Then I should see "Welcome, <strong>bob</strong>!" Then I should see "Welcome"
And I should see "bob"
@security
Scenario: Anonymous user can see the home page but not the dashboard @security
Given I have installed Orchard Scenario: Anonymous user can see the home page but not the dashboard
And I have a user "bob" with permissions "AccessFrontEnd" Given I have installed Orchard
When I sign in as "bob" And I have a user "bob" with permissions "AccessFrontEnd"
Then I should see "this is the homepage of your new site" when I go to "/" When I sign in as "bob"
And I should be denied access when I go to "admin" Then I should see "this is the homepage of your new site" when I go to "/"
And I should be denied access when I go to "admin"

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.4.0.0 // SpecFlow Version:1.5.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.4.0.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.5.0.0")]
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.TestFixtureAttribute()]
[NUnit.Framework.DescriptionAttribute("Addition")] [NUnit.Framework.DescriptionAttribute("Addition")]
@@ -30,8 +30,8 @@ namespace Orchard.Specs
public virtual void FeatureSetup() public virtual void FeatureSetup()
{ {
testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Addition", "In order to prevent security model regressions\nAs a user with specific permission" + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Addition", "In order to prevent security model regressions\r\nAs a user with specific permissio" +
"s\nI should to be granted or denied access to various actions", GenerationTargetLanguage.CSharp, ((string[])(null))); "ns\r\nI should to be granted or denied access to various actions", GenerationTargetLanguage.CSharp, ((string[])(null)));
testRunner.OnFeatureStart(featureInfo); testRunner.OnFeatureStart(featureInfo);
} }
@@ -87,7 +87,9 @@ this.ScenarioSetup(scenarioInfo);
#line 17 #line 17
testRunner.And("I am redirected"); testRunner.And("I am redirected");
#line 18 #line 18
testRunner.Then("I should see \"Welcome, <strong>bob</strong>!\""); testRunner.Then("I should see \"Welcome\"");
#line 19
testRunner.And("I should see \"bob\"");
#line hidden #line hidden
testRunner.CollectScenarioErrors(); testRunner.CollectScenarioErrors();
} }
@@ -99,17 +101,17 @@ this.ScenarioSetup(scenarioInfo);
{ {
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Anonymous user can see the home page but not the dashboard", new string[] { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Anonymous user can see the home page but not the dashboard", new string[] {
"security"}); "security"});
#line 21
this.ScenarioSetup(scenarioInfo);
#line 22 #line 22
testRunner.Given("I have installed Orchard"); this.ScenarioSetup(scenarioInfo);
#line 23 #line 23
testRunner.And("I have a user \"bob\" with permissions \"AccessFrontEnd\""); testRunner.Given("I have installed Orchard");
#line 24 #line 24
testRunner.When("I sign in as \"bob\""); testRunner.And("I have a user \"bob\" with permissions \"AccessFrontEnd\"");
#line 25 #line 25
testRunner.Then("I should see \"this is the homepage of your new site\" when I go to \"/\""); 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 \"/\"");
#line 27
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();