mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Setup submit scenario works
Minimum modules are copied Form is submitted Redirect is verified (should have a step to follow redirect) Also changed .Named to .Keyed in a controller test --HG-- branch : dev
This commit is contained in:
@@ -61,19 +61,21 @@ namespace Orchard.Specs.Bindings {
|
|||||||
public void GivenIHaveACleanSiteWith(Table table) {
|
public void GivenIHaveACleanSiteWith(Table table) {
|
||||||
GivenIHaveACleanSite();
|
GivenIHaveACleanSite();
|
||||||
foreach (var row in table.Rows) {
|
foreach (var row in table.Rows) {
|
||||||
switch (row["extension"]) {
|
foreach (var name in row["names"].Split(',').Select(x => x.Trim())) {
|
||||||
case "core":
|
switch (row["extension"]) {
|
||||||
GivenIHaveCore(row["name"]);
|
case "core":
|
||||||
break;
|
GivenIHaveCore(name);
|
||||||
case "module":
|
break;
|
||||||
GivenIHaveModule(row["name"]);
|
case "module":
|
||||||
break;
|
GivenIHaveModule(name);
|
||||||
case "theme":
|
break;
|
||||||
GivenIHaveTheme(row["name"]);
|
case "theme":
|
||||||
break;
|
GivenIHaveTheme(name);
|
||||||
default:
|
break;
|
||||||
Assert.Fail("Unknown extension type {0}", row["extension"]);
|
default:
|
||||||
break;
|
Assert.Fail("Unknown extension type {0}", row["extension"]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -105,13 +107,12 @@ namespace Orchard.Specs.Bindings {
|
|||||||
[When(@"I fill in")]
|
[When(@"I fill in")]
|
||||||
public void WhenIFillIn(Table table) {
|
public void WhenIFillIn(Table table) {
|
||||||
var inputs = _doc.DocumentNode
|
var inputs = _doc.DocumentNode
|
||||||
.SelectNodes("//input");
|
.SelectNodes("//input") ?? Enumerable.Empty<HtmlNode>();
|
||||||
|
|
||||||
foreach (var row in table.Rows) {
|
foreach (var row in table.Rows) {
|
||||||
var r = row;
|
var r = row;
|
||||||
var input = inputs.Single(
|
var input = inputs.SingleOrDefault(x => x.GetAttributeValue("name", x.GetAttributeValue("id", "")) == r["name"]);
|
||||||
x => x.Attributes.Contains("name") &&
|
Assert.That(input, Is.Not.Null, "Unable to locate <input> name {0} in page html:\r\n\r\n{1}", r["name"], _details.ResponseText);
|
||||||
x.Attributes["name"].Value == r["name"]);
|
|
||||||
input.Attributes.Add("value", row["value"]);
|
input.Attributes.Add("value", row["value"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -144,10 +144,58 @@
|
|||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Orchard.Web\Core\Orchard.Core.csproj">
|
||||||
|
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
|
||||||
|
<Name>Orchard.Core</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Orchard.Web\Modules\Futures.Widgets\Futures.Widgets.csproj">
|
||||||
|
<Project>{E65E5633-C0FF-453C-A906-481C14F969D6}</Project>
|
||||||
|
<Name>Futures.Widgets</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Orchard.Web\Modules\Orchard.Blogs\Orchard.Blogs.csproj">
|
||||||
|
<Project>{63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867}</Project>
|
||||||
|
<Name>Orchard.Blogs</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Orchard.Web\Modules\Orchard.Comments\Orchard.Comments.csproj">
|
||||||
|
<Project>{14C049FD-B35B-415A-A824-87F26B26E7FD}</Project>
|
||||||
|
<Name>Orchard.Comments</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Orchard.Web\Modules\Orchard.DevTools\Orchard.DevTools.csproj">
|
||||||
|
<Project>{67C1D3AF-A0EC-46B2-BAE1-DF1DA8E0B890}</Project>
|
||||||
|
<Name>Orchard.DevTools</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Orchard.Web\Modules\Orchard.Media\Orchard.Media.csproj">
|
||||||
|
<Project>{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}</Project>
|
||||||
|
<Name>Orchard.Media</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Orchard.Web\Modules\Orchard.Pages\Orchard.Pages.csproj">
|
||||||
|
<Project>{4A9C04A6-0986-4A92-A610-5F59FF273FB9}</Project>
|
||||||
|
<Name>Orchard.Pages</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Orchard.Web\Modules\Orchard.Roles\Orchard.Roles.csproj">
|
||||||
|
<Project>{D10AD48F-407D-4DB5-A328-173EC7CB010F}</Project>
|
||||||
|
<Name>Orchard.Roles</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Orchard.Web\Modules\Orchard.Sandbox\Orchard.Sandbox.csproj">
|
||||||
|
<Project>{17C44253-65A2-4597-98C7-16EE576824B6}</Project>
|
||||||
|
<Name>Orchard.Sandbox</Name>
|
||||||
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\Orchard.Web\Modules\Orchard.Setup\Orchard.Setup.csproj">
|
<ProjectReference Include="..\Orchard.Web\Modules\Orchard.Setup\Orchard.Setup.csproj">
|
||||||
<Project>{8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4}</Project>
|
<Project>{8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4}</Project>
|
||||||
<Name>Orchard.Setup</Name>
|
<Name>Orchard.Setup</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Orchard.Web\Modules\Orchard.Tags\Orchard.Tags.csproj">
|
||||||
|
<Project>{5D0F00F0-26C9-4785-AD61-B85710C60EB0}</Project>
|
||||||
|
<Name>Orchard.Tags</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Orchard.Web\Modules\Orchard.Users\Orchard.Users.csproj">
|
||||||
|
<Project>{79AED36E-ABD0-4747-93D3-8722B042454B}</Project>
|
||||||
|
<Name>Orchard.Users</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Orchard.Web\Orchard.Web.csproj">
|
||||||
|
<Project>{50B779EA-EC00-4699-84C0-03B395C365D2}</Project>
|
||||||
|
<Name>Orchard.Web</Name>
|
||||||
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\Orchard\Orchard.Framework.csproj">
|
<ProjectReference Include="..\Orchard\Orchard.Framework.csproj">
|
||||||
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
|
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
|
||||||
<Name>Orchard.Framework</Name>
|
<Name>Orchard.Framework</Name>
|
||||||
|
@@ -32,16 +32,14 @@ Scenario: Some of the initial form values are required
|
|||||||
|
|
||||||
Scenario: Calling setup on a brand new install
|
Scenario: Calling setup on a brand new install
|
||||||
Given I have a clean site with
|
Given I have a clean site with
|
||||||
| extension | name |
|
| extension | names |
|
||||||
| module | Orchard.Setup |
|
| module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, TinyMce |
|
||||||
| core | Themes |
|
| core | Common, Dashboard, Feeds, HomePage, Navigation, Scheduling, Settings, Themes, XmlRpc |
|
||||||
| core | Settings |
|
| theme | SafeMode, Classic |
|
||||||
| theme | SafeMode |
|
|
||||||
And I am on "/Setup"
|
And I am on "/Setup"
|
||||||
When I fill in
|
When I fill in
|
||||||
| name | value |
|
| name | value |
|
||||||
| SiteName | My Site |
|
| SiteName | My Site |
|
||||||
| AdminPassword | 6655321 |
|
| AdminPassword | 6655321 |
|
||||||
And I hit "Finish Setup"
|
And I hit "Finish Setup"
|
||||||
Then I should see "Blah"
|
Then the status should be 302 Found
|
||||||
|
|
||||||
|
23
src/Orchard.Specs/Setup.feature.cs
generated
23
src/Orchard.Specs/Setup.feature.cs
generated
@@ -135,22 +135,21 @@ this.ScenarioSetup(scenarioInfo);
|
|||||||
#line hidden
|
#line hidden
|
||||||
TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
|
TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
|
||||||
"extension",
|
"extension",
|
||||||
"name"});
|
"names"});
|
||||||
table1.AddRow(new string[] {
|
table1.AddRow(new string[] {
|
||||||
"module",
|
"module",
|
||||||
"Orchard.Setup"});
|
"Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Tin" +
|
||||||
|
"yMce"});
|
||||||
table1.AddRow(new string[] {
|
table1.AddRow(new string[] {
|
||||||
"core",
|
"core",
|
||||||
"Themes"});
|
"Common, Dashboard, Feeds, HomePage, Navigation, Scheduling, Settings, Themes, Xml" +
|
||||||
table1.AddRow(new string[] {
|
"Rpc"});
|
||||||
"core",
|
|
||||||
"Settings"});
|
|
||||||
table1.AddRow(new string[] {
|
table1.AddRow(new string[] {
|
||||||
"theme",
|
"theme",
|
||||||
"SafeMode"});
|
"SafeMode, Classic"});
|
||||||
#line 34
|
#line 34
|
||||||
testRunner.Given("I have a clean site with", ((string)(null)), table1);
|
testRunner.Given("I have a clean site with", ((string)(null)), table1);
|
||||||
#line 40
|
#line 39
|
||||||
testRunner.And("I am on \"/Setup\"");
|
testRunner.And("I am on \"/Setup\"");
|
||||||
#line hidden
|
#line hidden
|
||||||
TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] {
|
TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] {
|
||||||
@@ -162,12 +161,12 @@ this.ScenarioSetup(scenarioInfo);
|
|||||||
table2.AddRow(new string[] {
|
table2.AddRow(new string[] {
|
||||||
"AdminPassword",
|
"AdminPassword",
|
||||||
"6655321"});
|
"6655321"});
|
||||||
#line 41
|
#line 40
|
||||||
testRunner.When("I fill in", ((string)(null)), table2);
|
testRunner.When("I fill in", ((string)(null)), table2);
|
||||||
#line 45
|
#line 44
|
||||||
testRunner.And("I hit \"Finish Setup\"");
|
testRunner.And("I hit \"Finish Setup\"");
|
||||||
#line 46
|
#line 45
|
||||||
testRunner.Then("I should see \"Blah\"");
|
testRunner.Then("the status should be 302 Found");
|
||||||
#line hidden
|
#line hidden
|
||||||
testRunner.CollectScenarioErrors();
|
testRunner.CollectScenarioErrors();
|
||||||
}
|
}
|
||||||
|
@@ -18,7 +18,7 @@ namespace Orchard.Tests.Mvc {
|
|||||||
public void Init() {
|
public void Init() {
|
||||||
var builder = new ContainerBuilder();
|
var builder = new ContainerBuilder();
|
||||||
builder.RegisterType<ReplacementFooController>()
|
builder.RegisterType<ReplacementFooController>()
|
||||||
.Named<IController>("controller.orchard.foo")
|
.Keyed<IController>("/foo")
|
||||||
.InstancePerDependency();
|
.InstancePerDependency();
|
||||||
|
|
||||||
var container = builder.Build();
|
var container = builder.Build();
|
||||||
|
@@ -34,5 +34,5 @@ using System.Runtime.InteropServices;
|
|||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
[assembly: AssemblyVersion("1.0.1.0")]
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
[assembly: AssemblyFileVersion("1.0.1.0")]
|
Reference in New Issue
Block a user