Adding an error message when there is no default pattern

--HG--
branch : autoroute
This commit is contained in:
Sebastien Ros
2012-02-07 17:34:49 -08:00
parent b923915332
commit f5f2df8100
4 changed files with 79 additions and 198 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
5e57314d12cb06337920ca140f80477a6e3f6d92 src/Orchard.Web/Modules/Orchard.Autoroute 01c7e9e92b1243e26e2284aa1deb8772021c2e7b src/Orchard.Web/Modules/Orchard.Autoroute
c54cb640d6bc14c51b9fb9bd78231bb0facec067 src/Orchard.Web/Modules/Orchard.Forms c54cb640d6bc14c51b9fb9bd78231bb0facec067 src/Orchard.Web/Modules/Orchard.Forms
204bdef384f41bb5e463bed6b98a056945a7d839 src/Orchard.Web/Modules/Orchard.Rules 204bdef384f41bb5e463bed6b98a056945a7d839 src/Orchard.Web/Modules/Orchard.Rules
ce578373f907c0a55fd91229a344f0755f290174 src/Orchard.Web/Modules/Orchard.TaskLease ce578373f907c0a55fd91229a344f0755f290174 src/Orchard.Web/Modules/Orchard.TaskLease
-34
View File
@@ -74,39 +74,6 @@ Scenario: I can create a new blog with multiple blog posts each with the same ti
Then I should see "<h1[^>]*>.*?My Post.*?</h1>" Then I should see "<h1[^>]*>.*?My Post.*?</h1>"
And I should see "Are you still there?" And I should see "Are you still there?"
Scenario: I can create a new blog and blog post and when I change the slug of the blog the path of the blog post is updated
Given I have installed Orchard
When I go to "admin/blogs/create"
And I fill in
| name | value |
| Title.Title | My Blog |
And I hit "Save"
And I go to "my-blog"
Then I should see "<h1[^>]*>.*?My Blog.*?</h1>"
When I go to "admin/blogs"
And I follow "My Blog"
And I follow "New Post" where class name has "primaryAction"
And I fill in
| name | value |
| Title.Title | My Post |
| Body.Text | Hi there. |
And I hit "Publish Now"
And I go to "my-blog/my-post"
Then I should see "<h1[^>]*>.*?My Post.*?</h1>"
And I should see "Hi there."
When I go to "admin/blogs"
And I follow "My Blog"
And I follow "Blog Properties"
And I fill in
| name | value |
| Autoroute.CurrentUrl | my-other-blog |
And I hit "Save"
And I go to "my-other-blog"
Then I should see "<h1[^>]*>.*?My Blog.*?</h1>"
When I go to "my-other-blog/my-post"
Then I should see "<h1[^>]*>.*?My Post.*?</h1>"
And I should see "Hi there."
Scenario: When viewing a blog the user agent is given an RSS feed of the blog's posts Scenario: When viewing a blog the user agent is given an RSS feed of the blog's posts
Given I have installed Orchard Given I have installed Orchard
When I go to "admin/blogs/create" When I go to "admin/blogs/create"
@@ -126,7 +93,6 @@ Scenario: When viewing a blog the user agent is given an RSS feed of the blog's
And I go to "my-blog/my-post" And I go to "my-blog/my-post"
Then I should see "<link rel="alternate" type="application/rss\+xml" title="My Blog" href="/rss\?containerid=\d+" />" Then I should see "<link rel="alternate" type="application/rss\+xml" title="My Blog" href="/rss\?containerid=\d+" />"
Scenario: Enabling remote blog publishing inserts the appropriate metaweblogapi markup into the blog's page Scenario: Enabling remote blog publishing inserts the appropriate metaweblogapi markup into the blog's page
Given I have installed Orchard Given I have installed Orchard
And I have enabled "XmlRpc" And I have enabled "XmlRpc"
+77 -162
View File
@@ -254,12 +254,10 @@ this.ScenarioSetup(scenarioInfo);
} }
[NUnit.Framework.TestAttribute()] [NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("I can create a new blog and blog post and when I change the slug of the blog the " + [NUnit.Framework.DescriptionAttribute("When viewing a blog the user agent is given an RSS feed of the blog\'s posts")]
"path of the blog post is updated")] public virtual void WhenViewingABlogTheUserAgentIsGivenAnRSSFeedOfTheBlogSPosts()
public virtual void ICanCreateANewBlogAndBlogPostAndWhenIChangeTheSlugOfTheBlogThePathOfTheBlogPostIsUpdated()
{ {
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create a new blog and blog post and when I change the slug of the blog the " + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("When viewing a blog the user agent is given an RSS feed of the blog\'s posts", ((string[])(null)));
"path of the blog post is updated", ((string[])(null)));
#line 77 #line 77
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 78 #line 78
@@ -278,14 +276,10 @@ this.ScenarioSetup(scenarioInfo);
#line 83 #line 83
testRunner.And("I hit \"Save\""); testRunner.And("I hit \"Save\"");
#line 84 #line 84
testRunner.And("I go to \"my-blog\""); testRunner.And("I go to \"admin/blogs\"");
#line 85 #line 85
testRunner.Then("I should see \"<h1[^>]*>.*?My Blog.*?</h1>\"");
#line 86
testRunner.When("I go to \"admin/blogs\"");
#line 87
testRunner.And("I follow \"My Blog\""); testRunner.And("I follow \"My Blog\"");
#line 88 #line 86
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\""); testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"");
#line hidden #line hidden
TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] { TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] {
@@ -297,94 +291,15 @@ this.ScenarioSetup(scenarioInfo);
table8.AddRow(new string[] { table8.AddRow(new string[] {
"Body.Text", "Body.Text",
"Hi there."}); "Hi there."});
#line 89 #line 87
testRunner.And("I fill in", ((string)(null)), table8); testRunner.And("I fill in", ((string)(null)), table8);
#line 93 #line 91
testRunner.And("I hit \"Publish Now\""); testRunner.And("I hit \"Publish Now\"");
#line 94 #line 92
testRunner.And("I go to \"my-blog/my-post\"");
#line 95
testRunner.Then("I should see \"<h1[^>]*>.*?My Post.*?</h1>\"");
#line 96
testRunner.And("I should see \"Hi there.\"");
#line 97
testRunner.When("I go to \"admin/blogs\"");
#line 98
testRunner.And("I follow \"My Blog\"");
#line 99
testRunner.And("I follow \"Blog Properties\"");
#line hidden
TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table9.AddRow(new string[] {
"Autoroute.CurrentUrl",
"my-other-blog"});
#line 100
testRunner.And("I fill in", ((string)(null)), table9);
#line 103
testRunner.And("I hit \"Save\"");
#line 104
testRunner.And("I go to \"my-other-blog\"");
#line 105
testRunner.Then("I should see \"<h1[^>]*>.*?My Blog.*?</h1>\"");
#line 106
testRunner.When("I go to \"my-other-blog/my-post\"");
#line 107
testRunner.Then("I should see \"<h1[^>]*>.*?My Post.*?</h1>\"");
#line 108
testRunner.And("I should see \"Hi there.\"");
#line hidden
this.ScenarioCleanup();
}
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("When viewing a blog the user agent is given an RSS feed of the blog\'s posts")]
public virtual void WhenViewingABlogTheUserAgentIsGivenAnRSSFeedOfTheBlogSPosts()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("When viewing a blog the user agent is given an RSS feed of the blog\'s posts", ((string[])(null)));
#line 110
this.ScenarioSetup(scenarioInfo);
#line 111
testRunner.Given("I have installed Orchard");
#line 112
testRunner.When("I go to \"admin/blogs/create\"");
#line hidden
TechTalk.SpecFlow.Table table10 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table10.AddRow(new string[] {
"Title.Title",
"My Blog"});
#line 113
testRunner.And("I fill in", ((string)(null)), table10);
#line 116
testRunner.And("I hit \"Save\"");
#line 117
testRunner.And("I go to \"admin/blogs\"");
#line 118
testRunner.And("I follow \"My Blog\"");
#line 119
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"");
#line hidden
TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table11.AddRow(new string[] {
"Title.Title",
"My Post"});
table11.AddRow(new string[] {
"Body.Text",
"Hi there."});
#line 120
testRunner.And("I fill in", ((string)(null)), table11);
#line 124
testRunner.And("I hit \"Publish Now\"");
#line 125
testRunner.And("I am redirected"); testRunner.And("I am redirected");
#line 126 #line 93
testRunner.And("I go to \"my-blog/my-post\""); testRunner.And("I go to \"my-blog/my-post\"");
#line 127 #line 94
testRunner.Then("I should see \"<link rel=\"alternate\" type=\"application/rss\\+xml\" title=\"My Blog\" h" + testRunner.Then("I should see \"<link rel=\"alternate\" type=\"application/rss\\+xml\" title=\"My Blog\" h" +
"ref=\"/rss\\?containerid=\\d+\" />\""); "ref=\"/rss\\?containerid=\\d+\" />\"");
#line hidden #line hidden
@@ -398,40 +313,40 @@ this.ScenarioSetup(scenarioInfo);
{ {
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Enabling remote blog publishing inserts the appropriate metaweblogapi markup into" + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Enabling remote blog publishing inserts the appropriate metaweblogapi markup into" +
" the blog\'s page", ((string[])(null))); " the blog\'s page", ((string[])(null)));
#line 130 #line 96
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 131 #line 97
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 132 #line 98
testRunner.And("I have enabled \"XmlRpc\""); testRunner.And("I have enabled \"XmlRpc\"");
#line 133 #line 99
testRunner.And("I have enabled \"Orchard.Blogs.RemotePublishing\""); testRunner.And("I have enabled \"Orchard.Blogs.RemotePublishing\"");
#line 134 #line 100
testRunner.When("I go to \"admin/blogs/create\""); testRunner.When("I go to \"admin/blogs/create\"");
#line hidden #line hidden
TechTalk.SpecFlow.Table table12 = new TechTalk.SpecFlow.Table(new string[] { TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] {
"name", "name",
"value"}); "value"});
table12.AddRow(new string[] { table9.AddRow(new string[] {
"Title.Title", "Title.Title",
"My Blog"}); "My Blog"});
#line 135 #line 101
testRunner.And("I fill in", ((string)(null)), table12); testRunner.And("I fill in", ((string)(null)), table9);
#line 138 #line 104
testRunner.And("I hit \"Save\""); testRunner.And("I hit \"Save\"");
#line 139 #line 105
testRunner.And("I go to \"my-blog\""); testRunner.And("I go to \"my-blog\"");
#line 140 #line 106
testRunner.Then("I should see \"<link href=\"[^\"]*/XmlRpc/LiveWriter/Manifest\" rel=\"wlwmanifest\" typ" + testRunner.Then("I should see \"<link href=\"[^\"]*/XmlRpc/LiveWriter/Manifest\" rel=\"wlwmanifest\" typ" +
"e=\"application/wlwmanifest\\+xml\" />\""); "e=\"application/wlwmanifest\\+xml\" />\"");
#line 141 #line 107
testRunner.When("I go to \"/XmlRpc/LiveWriter/Manifest\""); testRunner.When("I go to \"/XmlRpc/LiveWriter/Manifest\"");
#line 142 #line 108
testRunner.Then("the content type should be \"\\btext/xml\\b\""); testRunner.Then("the content type should be \"\\btext/xml\\b\"");
#line 143 #line 109
testRunner.And("I should see \"<manifest xmlns=\"http\\://schemas\\.microsoft\\.com/wlw/manifest/weblo" + testRunner.And("I should see \"<manifest xmlns=\"http\\://schemas\\.microsoft\\.com/wlw/manifest/weblo" +
"g\">\""); "g\">\"");
#line 144 #line 110
testRunner.And("I should see \"<clientType>Metaweblog</clientType>\""); testRunner.And("I should see \"<clientType>Metaweblog</clientType>\"");
#line hidden #line hidden
this.ScenarioCleanup(); this.ScenarioCleanup();
@@ -444,32 +359,32 @@ this.ScenarioSetup(scenarioInfo);
{ {
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("The virtual path of my installation when not at the root is reflected in the URL " + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("The virtual path of my installation when not at the root is reflected in the URL " +
"example for the slug field when creating a blog or blog post", ((string[])(null))); "example for the slug field when creating a blog or blog post", ((string[])(null)));
#line 146 #line 112
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 147 #line 113
testRunner.Given("I have installed Orchard at \"/OrchardLocal\""); testRunner.Given("I have installed Orchard at \"/OrchardLocal\"");
#line 148 #line 114
testRunner.When("I go to \"admin/blogs/create\""); testRunner.When("I go to \"admin/blogs/create\"");
#line 149 #line 115
testRunner.Then("I should see \"<span>http\\://localhost/OrchardLocal/</span>\""); testRunner.Then("I should see \"<span>http\\://localhost/OrchardLocal/</span>\"");
#line hidden #line hidden
TechTalk.SpecFlow.Table table13 = new TechTalk.SpecFlow.Table(new string[] { TechTalk.SpecFlow.Table table10 = new TechTalk.SpecFlow.Table(new string[] {
"name", "name",
"value"}); "value"});
table13.AddRow(new string[] { table10.AddRow(new string[] {
"Title.Title", "Title.Title",
"My Blog"}); "My Blog"});
#line 150 #line 116
testRunner.When("I fill in", ((string)(null)), table13); testRunner.When("I fill in", ((string)(null)), table10);
#line 153 #line 119
testRunner.And("I hit \"Save\""); testRunner.And("I hit \"Save\"");
#line 154 #line 120
testRunner.And("I go to \"admin/blogs\""); testRunner.And("I go to \"admin/blogs\"");
#line 155 #line 121
testRunner.And("I follow \"My Blog\""); testRunner.And("I follow \"My Blog\"");
#line 156 #line 122
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\""); testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"");
#line 157 #line 123
testRunner.Then("I should see \"<span>http\\://localhost/OrchardLocal/my-blog/</span>\""); testRunner.Then("I should see \"<span>http\\://localhost/OrchardLocal/my-blog/</span>\"");
#line hidden #line hidden
this.ScenarioCleanup(); this.ScenarioCleanup();
@@ -482,32 +397,32 @@ this.ScenarioSetup(scenarioInfo);
{ {
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("The virtual path of my installation when at the root is reflected in the URL exam" + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("The virtual path of my installation when at the root is reflected in the URL exam" +
"ple for the slug field when creating a blog or blog post", ((string[])(null))); "ple for the slug field when creating a blog or blog post", ((string[])(null)));
#line 159 #line 125
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 160 #line 126
testRunner.Given("I have installed Orchard at \"/\""); testRunner.Given("I have installed Orchard at \"/\"");
#line 161 #line 127
testRunner.When("I go to \"admin/blogs/create\""); testRunner.When("I go to \"admin/blogs/create\"");
#line 162 #line 128
testRunner.Then("I should see \"<span>http\\://localhost/</span>\""); testRunner.Then("I should see \"<span>http\\://localhost/</span>\"");
#line hidden #line hidden
TechTalk.SpecFlow.Table table14 = new TechTalk.SpecFlow.Table(new string[] { TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] {
"name", "name",
"value"}); "value"});
table14.AddRow(new string[] { table11.AddRow(new string[] {
"Title.Title", "Title.Title",
"My Blog"}); "My Blog"});
#line 163 #line 129
testRunner.When("I fill in", ((string)(null)), table14); testRunner.When("I fill in", ((string)(null)), table11);
#line 166 #line 132
testRunner.And("I hit \"Save\""); testRunner.And("I hit \"Save\"");
#line 167 #line 133
testRunner.And("I go to \"admin/blogs\""); testRunner.And("I go to \"admin/blogs\"");
#line 168 #line 134
testRunner.And("I follow \"My Blog\""); testRunner.And("I follow \"My Blog\"");
#line 169 #line 135
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\""); testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"");
#line 170 #line 136
testRunner.Then("I should see \"<span>http\\://localhost/my-blog/</span>\""); testRunner.Then("I should see \"<span>http\\://localhost/my-blog/</span>\"");
#line hidden #line hidden
this.ScenarioCleanup(); this.ScenarioCleanup();
@@ -520,59 +435,59 @@ this.ScenarioSetup(scenarioInfo);
{ {
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I set my blog to be the content for the home page and the posts for the blog be r" + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I set my blog to be the content for the home page and the posts for the blog be r" +
"ooted to the app", ((string[])(null))); "ooted to the app", ((string[])(null)));
#line 172 #line 138
this.ScenarioSetup(scenarioInfo); this.ScenarioSetup(scenarioInfo);
#line 173 #line 139
testRunner.Given("I have installed Orchard"); testRunner.Given("I have installed Orchard");
#line 174 #line 140
testRunner.When("I go to \"admin/blogs/create\""); testRunner.When("I go to \"admin/blogs/create\"");
#line hidden #line hidden
TechTalk.SpecFlow.Table table15 = new TechTalk.SpecFlow.Table(new string[] { TechTalk.SpecFlow.Table table12 = new TechTalk.SpecFlow.Table(new string[] {
"name", "name",
"value"}); "value"});
table15.AddRow(new string[] { table12.AddRow(new string[] {
"Title.Title", "Title.Title",
"My Blog"}); "My Blog"});
table15.AddRow(new string[] { table12.AddRow(new string[] {
"Autoroute.PromoteToHomePage", "Autoroute.PromoteToHomePage",
"true"}); "true"});
#line 175 #line 141
testRunner.And("I fill in", ((string)(null)), table15); testRunner.And("I fill in", ((string)(null)), table12);
#line 179 #line 145
testRunner.And("I hit \"Save\""); testRunner.And("I hit \"Save\"");
#line 180 #line 146
testRunner.And("I go to \"admin/blogs\""); testRunner.And("I go to \"admin/blogs\"");
#line 181 #line 147
testRunner.And("I follow \"My Blog\""); testRunner.And("I follow \"My Blog\"");
#line 182 #line 148
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\""); testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"");
#line hidden #line hidden
TechTalk.SpecFlow.Table table16 = new TechTalk.SpecFlow.Table(new string[] { TechTalk.SpecFlow.Table table13 = new TechTalk.SpecFlow.Table(new string[] {
"name", "name",
"value"}); "value"});
table16.AddRow(new string[] { table13.AddRow(new string[] {
"Title.Title", "Title.Title",
"My Post"}); "My Post"});
table16.AddRow(new string[] { table13.AddRow(new string[] {
"Body.Text", "Body.Text",
"Hi there."}); "Hi there."});
#line 183 #line 149
testRunner.And("I fill in", ((string)(null)), table16); testRunner.And("I fill in", ((string)(null)), table13);
#line 187 #line 153
testRunner.And("I hit \"Publish Now\""); testRunner.And("I hit \"Publish Now\"");
#line 188 #line 154
testRunner.And("I am redirected"); testRunner.And("I am redirected");
#line 189 #line 155
testRunner.And("I go to \"/\""); testRunner.And("I go to \"/\"");
#line 190 #line 156
testRunner.Then("I should see \"<h1>My Blog</h1>\""); testRunner.Then("I should see \"<h1>My Blog</h1>\"");
#line 191 #line 157
testRunner.When("I go to \"/my-blog\""); testRunner.When("I go to \"/my-blog\"");
#line 192 #line 158
testRunner.Then("the status should be 404 \"Not Found\""); testRunner.Then("the status should be 404 \"Not Found\"");
#line 193 #line 159
testRunner.When("I go to \"/my-post\""); testRunner.When("I go to \"/my-post\"");
#line 194 #line 160
testRunner.Then("I should see \"<h1>My Post</h1>\""); testRunner.Then("I should see \"<h1>My Post</h1>\"");
#line hidden #line hidden
this.ScenarioCleanup(); this.ScenarioCleanup();
@@ -1,6 +1,6 @@
<ul class="pageStatus"> <ul class="pageStatus">
<li> <li>
@Display.CommentSummaryLinks(item: Model.ContentPart.ContentItem, count: Model.CommentCount, pendingCount: ((Func<int>)Model.PendingCount)())) @Display.CommentSummaryLinks(item: Model.ContentPart.ContentItem, count: Model.CommentCount, pendingCount: ((Func<int>)Model.PendingCount)())
@T(" | ")&nbsp; @T(" | ")&nbsp;
</li> </li>
</ul> </ul>