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) {
|
||||
GivenIHaveACleanSite();
|
||||
foreach (var row in table.Rows) {
|
||||
switch (row["extension"]) {
|
||||
case "core":
|
||||
GivenIHaveCore(row["name"]);
|
||||
break;
|
||||
case "module":
|
||||
GivenIHaveModule(row["name"]);
|
||||
break;
|
||||
case "theme":
|
||||
GivenIHaveTheme(row["name"]);
|
||||
break;
|
||||
default:
|
||||
Assert.Fail("Unknown extension type {0}", row["extension"]);
|
||||
break;
|
||||
foreach (var name in row["names"].Split(',').Select(x => x.Trim())) {
|
||||
switch (row["extension"]) {
|
||||
case "core":
|
||||
GivenIHaveCore(name);
|
||||
break;
|
||||
case "module":
|
||||
GivenIHaveModule(name);
|
||||
break;
|
||||
case "theme":
|
||||
GivenIHaveTheme(name);
|
||||
break;
|
||||
default:
|
||||
Assert.Fail("Unknown extension type {0}", row["extension"]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -105,13 +107,12 @@ namespace Orchard.Specs.Bindings {
|
||||
[When(@"I fill in")]
|
||||
public void WhenIFillIn(Table table) {
|
||||
var inputs = _doc.DocumentNode
|
||||
.SelectNodes("//input");
|
||||
.SelectNodes("//input") ?? Enumerable.Empty<HtmlNode>();
|
||||
|
||||
foreach (var row in table.Rows) {
|
||||
var r = row;
|
||||
var input = inputs.Single(
|
||||
x => x.Attributes.Contains("name") &&
|
||||
x.Attributes["name"].Value == r["name"]);
|
||||
var input = inputs.SingleOrDefault(x => x.GetAttributeValue("name", x.GetAttributeValue("id", "")) == r["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);
|
||||
input.Attributes.Add("value", row["value"]);
|
||||
}
|
||||
}
|
||||
|
@@ -144,10 +144,58 @@
|
||||
</None>
|
||||
</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">
|
||||
<Project>{8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4}</Project>
|
||||
<Name>Orchard.Setup</Name>
|
||||
</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">
|
||||
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
|
||||
<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
|
||||
Given I have a clean site with
|
||||
| extension | name |
|
||||
| module | Orchard.Setup |
|
||||
| core | Themes |
|
||||
| core | Settings |
|
||||
| theme | SafeMode |
|
||||
| extension | names |
|
||||
| module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, TinyMce |
|
||||
| core | Common, Dashboard, Feeds, HomePage, Navigation, Scheduling, Settings, Themes, XmlRpc |
|
||||
| theme | SafeMode, Classic |
|
||||
And I am on "/Setup"
|
||||
When I fill in
|
||||
| name | value |
|
||||
| SiteName | My Site |
|
||||
| AdminPassword | 6655321 |
|
||||
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
|
||||
TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
"extension",
|
||||
"name"});
|
||||
"names"});
|
||||
table1.AddRow(new string[] {
|
||||
"module",
|
||||
"Orchard.Setup"});
|
||||
"Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Tin" +
|
||||
"yMce"});
|
||||
table1.AddRow(new string[] {
|
||||
"core",
|
||||
"Themes"});
|
||||
table1.AddRow(new string[] {
|
||||
"core",
|
||||
"Settings"});
|
||||
"Common, Dashboard, Feeds, HomePage, Navigation, Scheduling, Settings, Themes, Xml" +
|
||||
"Rpc"});
|
||||
table1.AddRow(new string[] {
|
||||
"theme",
|
||||
"SafeMode"});
|
||||
"SafeMode, Classic"});
|
||||
#line 34
|
||||
testRunner.Given("I have a clean site with", ((string)(null)), table1);
|
||||
#line 40
|
||||
#line 39
|
||||
testRunner.And("I am on \"/Setup\"");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
@@ -162,12 +161,12 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table2.AddRow(new string[] {
|
||||
"AdminPassword",
|
||||
"6655321"});
|
||||
#line 41
|
||||
#line 40
|
||||
testRunner.When("I fill in", ((string)(null)), table2);
|
||||
#line 45
|
||||
#line 44
|
||||
testRunner.And("I hit \"Finish Setup\"");
|
||||
#line 46
|
||||
testRunner.Then("I should see \"Blah\"");
|
||||
#line 45
|
||||
testRunner.Then("the status should be 302 Found");
|
||||
#line hidden
|
||||
testRunner.CollectScenarioErrors();
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ namespace Orchard.Tests.Mvc {
|
||||
public void Init() {
|
||||
var builder = new ContainerBuilder();
|
||||
builder.RegisterType<ReplacementFooController>()
|
||||
.Named<IController>("controller.orchard.foo")
|
||||
.Keyed<IController>("/foo")
|
||||
.InstancePerDependency();
|
||||
|
||||
var container = builder.Build();
|
||||
|
@@ -34,5 +34,5 @@ using System.Runtime.InteropServices;
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: AssemblyVersion("1.0.1.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.1.0")]
|
Reference in New Issue
Block a user