diff --git a/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs b/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs index e4e820952..5424a2e21 100644 --- a/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs +++ b/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs @@ -1,6 +1,4 @@ -using System.Diagnostics; -using System.Linq; -using System.Text; +using System.Linq; using Orchard.Environment.Configuration; using Orchard.Environment.Descriptor; using Orchard.Environment.Descriptor.Models; @@ -16,7 +14,7 @@ namespace Orchard.Specs.Bindings { var webApp = Binding(); webApp.GivenIHaveACleanSiteWith(TableData( - new { extension = "module", names = "Orchard.Setup, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Widgets, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce" }, + new { extension = "module", names = "Orchard.Setup, Orchard.Pages, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Widgets, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce" }, new { extension = "core", names = "Common, Dashboard, Feeds, HomePage, Navigation, Contents, Routable, Scheduling, Settings, Shapes, XmlRpc" }, new { extension = "theme", names = "SafeMode, TheAdmin, TheThemeMachine" })); @@ -34,9 +32,7 @@ namespace Orchard.Specs.Bindings { public void GivenIHaveInstalled(string name) { var webApp = Binding(); webApp.GivenIHaveModule(name); - webApp.Host.Execute(() => { - MvcApplication.ReloadExtensions(); - }); + webApp.Host.Execute(MvcApplication.ReloadExtensions); GivenIHaveEnabled(name); } diff --git a/src/Orchard.Specs/Orchard.Specs.csproj b/src/Orchard.Specs/Orchard.Specs.csproj index c23a7808d..72031e15c 100644 --- a/src/Orchard.Specs/Orchard.Specs.csproj +++ b/src/Orchard.Specs/Orchard.Specs.csproj @@ -154,6 +154,11 @@ True MultiTenancy.feature + + True + True + Pages.feature + WebHosting.feature @@ -220,6 +225,10 @@ SpecFlowSingleFileGenerator MultiTenancy.feature.cs + + SpecFlowSingleFileGenerator + Pages.feature.cs + SpecFlowSingleFileGenerator WebHosting.feature.cs diff --git a/src/Orchard.Specs/Pages.feature b/src/Orchard.Specs/Pages.feature new file mode 100644 index 000000000..d1699177c --- /dev/null +++ b/src/Orchard.Specs/Pages.feature @@ -0,0 +1,9 @@ +Feature: Content Page management + In order to add content pages to my site + As an author + I want to create, publish and edit pages + +Scenario: The "Page" content type is available to create from the admin menu + Given I have installed Orchard + When I go to "" + Then I should see "Page" \ No newline at end of file diff --git a/src/Orchard.Specs/Pages.feature.cs b/src/Orchard.Specs/Pages.feature.cs new file mode 100644 index 000000000..e90de1c38 --- /dev/null +++ b/src/Orchard.Specs/Pages.feature.cs @@ -0,0 +1,74 @@ +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.4.0.0 +// Runtime Version:4.0.30319.1 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.4.0.0")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Content Page management")] + public partial class ContentPageManagementFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "Pages.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Content Page management", "In order to add content pages to my site\r\nAs an author\r\nI want to create, publish" + + " and edit pages", GenerationTargetLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("The \"Page\" content type is available to create from the admin menu")] + public virtual void ThePageContentTypeIsAvailableToCreateFromTheAdminMenu() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("The \"Page\" content type is available to create from the admin menu", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("I have installed Orchard"); +#line 8 + testRunner.When("I go to \"\""); +#line 9 + testRunner.Then("I should see \"Page\""); +#line hidden + testRunner.CollectScenarioErrors(); + } + } +} +#endregion diff --git a/src/Orchard.Specs/Setup.feature b/src/Orchard.Specs/Setup.feature index 45d4aa23d..2566dbbf1 100644 --- a/src/Orchard.Specs/Setup.feature +++ b/src/Orchard.Specs/Setup.feature @@ -6,7 +6,7 @@ Feature: Setup Scenario: Root request shows setup form Given I have a clean site with | extension | names | - | module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.Themes, Orchard.jQuery, TinyMce | + | module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orchard.Themes, Orchard.jQuery, TinyMce | | core | Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.PublishLater, Scheduling, Settings, Shapes, XmlRpc | | theme | SafeMode | When I go to "/Default.aspx" @@ -17,7 +17,7 @@ Scenario: Root request shows setup form Scenario: Setup folder also shows setup form Given I have a clean site with | extension | names | - | module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.Themes, Orchard.jQuery, TinyMce | + | module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orchard.Themes, Orchard.jQuery, TinyMce | | core | Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.PublishLater, Scheduling, Settings, Shapes, XmlRpc | | theme | SafeMode | When I go to "/Setup" @@ -28,7 +28,7 @@ Scenario: Setup folder also shows setup form Scenario: Some of the initial form values are required Given I have a clean site with | extension | names | - | module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.Themes, Orchard.jQuery, TinyMce | + | module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orchard.Themes, Orchard.jQuery, TinyMce | | core | Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.PublishLater, Scheduling, Settings, Shapes, XmlRpc | | theme | SafeMode | When I go to "/Setup" @@ -39,7 +39,7 @@ 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 | names | - | module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.Themes, Orchard.Modules, Orchard.Widgets, Orchard.jQuery, TinyMce | + | module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orchard.Themes, Orchard.Modules, Orchard.Widgets, Orchard.jQuery, TinyMce | | core | Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.PublishLater, Scheduling, Settings, Shapes, XmlRpc | | theme | SafeMode, TheThemeMachine | And I am on "/Setup" diff --git a/src/Orchard.Specs/Setup.feature.cs b/src/Orchard.Specs/Setup.feature.cs index dbad29dc8..f665bd830 100644 --- a/src/Orchard.Specs/Setup.feature.cs +++ b/src/Orchard.Specs/Setup.feature.cs @@ -1,7 +1,7 @@ // ------------------------------------------------------------------------------ // // 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 // // 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.3.2.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.4.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Setup")] @@ -31,7 +31,7 @@ namespace Orchard.Specs { testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Setup", "In order to install orchard\r\nAs a new user\r\nI want to setup a new site from the d" + - "efault screen", ((string[])(null))); + "efault screen", GenerationTargetLanguage.CSharp, ((string[])(null))); testRunner.OnFeatureStart(featureInfo); } @@ -66,25 +66,25 @@ this.ScenarioSetup(scenarioInfo); "names"}); table1.AddRow(new string[] { "module", - "Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.Themes, Or" + - "chard.jQuery, TinyMce, Orchard.PublishLater"}); + "Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orc" + + "hard.Themes, Orchard.jQuery, TinyMce"}); table1.AddRow(new string[] { "core", - "Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable," + - " Scheduling, Settings, Shapes, XmlRpc"}); + "Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.Publi" + + "shLater, Scheduling, Settings, Shapes, XmlRpc"}); table1.AddRow(new string[] { "theme", "SafeMode"}); #line 7 -testRunner.Given("I have a clean site with", ((string)(null)), table1); + testRunner.Given("I have a clean site with", ((string)(null)), table1); #line 12 -testRunner.When("I go to \"/Default.aspx\""); + testRunner.When("I go to \"/Default.aspx\""); #line 13 -testRunner.Then("I should see \"Welcome to Orchard\""); + testRunner.Then("I should see \"Welcome to Orchard\""); #line 14 -testRunner.And("I should see \"Finish Setup\""); + testRunner.And("I should see \"Finish Setup\""); #line 15 -testRunner.And("the status should be 200 \"OK\""); + testRunner.And("the status should be 200 \"OK\""); #line hidden testRunner.CollectScenarioErrors(); } @@ -102,25 +102,25 @@ this.ScenarioSetup(scenarioInfo); "names"}); table2.AddRow(new string[] { "module", - "Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.Themes, Or" + - "chard.jQuery, TinyMce, Orchard.PublishLater"}); + "Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orc" + + "hard.Themes, Orchard.jQuery, TinyMce"}); table2.AddRow(new string[] { "core", - "Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable," + - " Scheduling, Settings, Shapes, XmlRpc"}); + "Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.Publi" + + "shLater, Scheduling, Settings, Shapes, XmlRpc"}); table2.AddRow(new string[] { "theme", "SafeMode"}); #line 18 -testRunner.Given("I have a clean site with", ((string)(null)), table2); + testRunner.Given("I have a clean site with", ((string)(null)), table2); #line 23 -testRunner.When("I go to \"/Setup\""); + testRunner.When("I go to \"/Setup\""); #line 24 -testRunner.Then("I should see \"Welcome to Orchard\""); + testRunner.Then("I should see \"Welcome to Orchard\""); #line 25 -testRunner.And("I should see \"Finish Setup\""); + testRunner.And("I should see \"Finish Setup\""); #line 26 -testRunner.And("the status should be 200 \"OK\""); + testRunner.And("the status should be 200 \"OK\""); #line hidden testRunner.CollectScenarioErrors(); } @@ -138,26 +138,26 @@ this.ScenarioSetup(scenarioInfo); "names"}); table3.AddRow(new string[] { "module", - "Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.Themes, Or" + - "chard.jQuery, TinyMce, Orchard.PublishLater"}); + "Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orc" + + "hard.Themes, Orchard.jQuery, TinyMce"}); table3.AddRow(new string[] { "core", - "Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable," + - " Scheduling, Settings, Shapes, XmlRpc"}); + "Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.Publi" + + "shLater, Scheduling, Settings, Shapes, XmlRpc"}); table3.AddRow(new string[] { "theme", "SafeMode"}); #line 29 -testRunner.Given("I have a clean site with", ((string)(null)), table3); + testRunner.Given("I have a clean site with", ((string)(null)), table3); #line 34 -testRunner.When("I go to \"/Setup\""); + testRunner.When("I go to \"/Setup\""); #line 35 -testRunner.And("I hit \"Finish Setup\""); + testRunner.And("I hit \"Finish Setup\""); #line 36 -testRunner.Then("I should see \"\""); #line 37 -testRunner.And("I should see \"\""); #line hidden testRunner.CollectScenarioErrors(); @@ -176,19 +176,19 @@ this.ScenarioSetup(scenarioInfo); "names"}); table4.AddRow(new string[] { "module", - "Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.Themes, Or" + - "chard.Modules, Orchard.Widgets, Orchard.jQuery, TinyMce, Orchard.PublishLater"}); + "Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orc" + + "hard.Themes, Orchard.Modules, Orchard.Widgets, Orchard.jQuery, TinyMce"}); table4.AddRow(new string[] { "core", - "Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable," + - " Scheduling, Settings, Shapes, XmlRpc"}); + "Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.Publi" + + "shLater, Scheduling, Settings, Shapes, XmlRpc"}); table4.AddRow(new string[] { "theme", "SafeMode, TheThemeMachine"}); #line 40 -testRunner.Given("I have a clean site with", ((string)(null)), table4); + testRunner.Given("I have a clean site with", ((string)(null)), table4); #line 45 -testRunner.And("I am on \"/Setup\""); + testRunner.And("I am on \"/Setup\""); #line hidden TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] { "name", @@ -203,15 +203,15 @@ testRunner.And("I am on \"/Setup\""); "ConfirmPassword", "6655321"}); #line 46 -testRunner.When("I fill in", ((string)(null)), table5); + testRunner.When("I fill in", ((string)(null)), table5); #line 51 -testRunner.And("I hit \"Finish Setup\""); + testRunner.And("I hit \"Finish Setup\""); #line 52 -testRunner.And("I go to \"/Default.aspx\""); + testRunner.And("I go to \"/Default.aspx\""); #line 53 -testRunner.Then("I should see \"My Site\""); + testRunner.Then("I should see \"My Site\""); #line 54 -testRunner.And("I should see \"Welcome, admin!\""); + testRunner.And("I should see \"Welcome, admin!\""); #line hidden testRunner.CollectScenarioErrors(); }