mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +08:00
Merge
--HG-- branch : 1.x
This commit is contained in:
@@ -1,27 +1,28 @@
|
||||
Feature: Addition
|
||||
In order to prevent security model regressions
|
||||
As a user with specific permissions
|
||||
I should to be granted or denied access to various actions
|
||||
|
||||
@security
|
||||
Scenario: Login can be automated
|
||||
Given I have installed Orchard
|
||||
And I have a user "bob" with permissions "AccessFrontEnd"
|
||||
When I go to "users/account/logoff"
|
||||
Feature: Addition
|
||||
In order to prevent security model regressions
|
||||
As a user with specific permissions
|
||||
I should to be granted or denied access to various actions
|
||||
|
||||
@security
|
||||
Scenario: Login can be automated
|
||||
Given I have installed Orchard
|
||||
And I have a user "bob" with permissions "AccessFrontEnd"
|
||||
When I go to "users/account/logoff"
|
||||
And I go to "users/account/logon"
|
||||
And I fill in
|
||||
| name | value |
|
||||
| userNameOrEmail | bob |
|
||||
| password | qwerty123! |
|
||||
And I hit "Sign In"
|
||||
And I am redirected
|
||||
Then I should see "Welcome, <strong>bob</strong>!"
|
||||
|
||||
@security
|
||||
Scenario: Anonymous user can see the home page but not the dashboard
|
||||
Given I have installed Orchard
|
||||
And I have a user "bob" with permissions "AccessFrontEnd"
|
||||
When I sign in as "bob"
|
||||
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"
|
||||
|
||||
And I hit "Sign In"
|
||||
And I am redirected
|
||||
Then I should see "Welcome"
|
||||
And I should see "bob"
|
||||
|
||||
@security
|
||||
Scenario: Anonymous user can see the home page but not the dashboard
|
||||
Given I have installed Orchard
|
||||
And I have a user "bob" with permissions "AccessFrontEnd"
|
||||
When I sign in as "bob"
|
||||
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"
|
||||
|
||||
|
24
src/Orchard.Specs/PermissionModel.feature.cs
generated
24
src/Orchard.Specs/PermissionModel.feature.cs
generated
@@ -1,7 +1,7 @@
|
||||
// ------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 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
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
@@ -14,7 +14,7 @@ namespace Orchard.Specs
|
||||
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()]
|
||||
[NUnit.Framework.TestFixtureAttribute()]
|
||||
[NUnit.Framework.DescriptionAttribute("Addition")]
|
||||
@@ -30,8 +30,8 @@ namespace Orchard.Specs
|
||||
public virtual void FeatureSetup()
|
||||
{
|
||||
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" +
|
||||
"s\nI should to be granted or denied access to various actions", GenerationTargetLanguage.CSharp, ((string[])(null)));
|
||||
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" +
|
||||
"ns\r\nI should to be granted or denied access to various actions", GenerationTargetLanguage.CSharp, ((string[])(null)));
|
||||
testRunner.OnFeatureStart(featureInfo);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,9 @@ this.ScenarioSetup(scenarioInfo);
|
||||
#line 17
|
||||
testRunner.And("I am redirected");
|
||||
#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
|
||||
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[] {
|
||||
"security"});
|
||||
#line 21
|
||||
this.ScenarioSetup(scenarioInfo);
|
||||
#line 22
|
||||
testRunner.Given("I have installed Orchard");
|
||||
this.ScenarioSetup(scenarioInfo);
|
||||
#line 23
|
||||
testRunner.And("I have a user \"bob\" with permissions \"AccessFrontEnd\"");
|
||||
testRunner.Given("I have installed Orchard");
|
||||
#line 24
|
||||
testRunner.When("I sign in as \"bob\"");
|
||||
testRunner.And("I have a user \"bob\" with permissions \"AccessFrontEnd\"");
|
||||
#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
|
||||
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\"");
|
||||
#line hidden
|
||||
testRunner.CollectScenarioErrors();
|
||||
|
Reference in New Issue
Block a user