| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 224d320 commit 5439352
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -250,7 +250,7 @@ class ArticleFeatureTest extends FeatureSpec with GivenWhenThen with ShouldMatch | |||
| 250 | 250 | import browser._ | |
| 251 | 251 | ||
| 252 | 252 | then("I should see navigation to related content") | |
| 253 | - $("[itemprop=relatedLink]").size() should be > (5) | ||
| 253 | + $("[itemprop=relatedLink]").size() should be <= (5) | ||
| 254 | 254 | } | |
| 255 | 255 | } | |
| 256 | 256 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,7 +34,7 @@ class RelatedFeatureTest extends FeatureSpec with GivenWhenThen with ShouldMatch | |||
| 34 | 34 | import browser._ | |
| 35 | 35 | ||
| 36 | 36 | then("I should see the related links") | |
| 37 | - $("li") should have length 10 | ||
| 37 | + $("li") should have length 5 | ||
| 38 | 38 | ||
| 39 | 39 | } | |
| 40 | 40 | } | |
@@ -62,11 +62,6 @@ class RelatedFeatureTest extends FeatureSpec with GivenWhenThen with ShouldMatch | |||
| 62 | 62 | // FIXME - need consistent data, as image can go missing | |
| 63 | 63 | //article.findFirst("img").getAttribute("src").length should be > 0 | |
| 64 | 64 | ||
| 65 | - and("I should see no images beyond first three trails") | ||
| 66 | - | ||
| 67 | - val trailWithImage = find("li", 7) | ||
| 68 | - trailWithImage.find("img") should have length 0 | ||
| 69 | - | ||
| 70 | 65 | } | |
| 71 | 66 | } | |
| 72 | 67 | ||
@@ -78,7 +73,7 @@ class RelatedFeatureTest extends FeatureSpec with GivenWhenThen with ShouldMatch | |||
| 78 | 73 | ||
| 79 | 74 | then("I see each trail block displays the published date of the corresponding article") | |
| 80 | 75 | ||
| 81 | - $(".relative-timestamp") should have length 10 | ||
| 76 | + $(".relative-timestamp") should have length 5 | ||
| 82 | 77 | ||
| 83 | 78 | } | |
| 84 | 79 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,7 +36,7 @@ class FrontController extends Controller with Logging with Formats { | |||
| 36 | 36 | ||
| 37 | 37 | def isUp() = Action { Ok("Ok") } | |
| 38 | 38 | ||
| 39 | - def render(path: String, format: String) = Action { implicit request => | ||
| 39 | + def render(path: String, format: String = "html") = Action { implicit request => | ||
| 40 | 40 | val edition = Edition(request, Configuration) | |
| 41 | 41 | ||
| 42 | 42 | val page: Option[MetaData] = path match { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,7 +41,7 @@ class FrontFeatureTest extends FeatureSpec with GivenWhenThen with ShouldMatcher | |||
| 41 | 41 | ||
| 42 | 42 | then("I should see the news trailblock") | |
| 43 | 43 | val news = $(".zone-news") | |
| 44 | - news.find(".trail-headline") should have length (9) | ||
| 44 | + news.find(".trail-headline") should have length (4) | ||
| 45 | 45 | } | |
| 46 | 46 | } | |
| 47 | 47 | ||
@@ -257,16 +257,16 @@ class FrontFeatureTest extends FeatureSpec with GivenWhenThen with ShouldMatcher | |||
| 257 | 257 | given("I visit the network front") | |
| 258 | 258 | ||
| 259 | 259 | then("I should see 10 (5 of whch are hidden) Top stories") | |
| 260 | - Front.ukEditions("front").descriptions(0) should be(TrailblockDescription("", "News", 5, 2, style = Some(Featured))) | ||
| 261 | - Front.usEditions("front").descriptions(0) should be(TrailblockDescription("", "News", 5, 2, style = Some(Featured))) | ||
| 260 | + Front.ukEditions("front").descriptions(0) should be(TrailblockDescription("", "News", 5, style = Some(Featured))) | ||
| 261 | + Front.usEditions("front").descriptions(0) should be(TrailblockDescription("", "News", 5, style = Some(Featured))) | ||
| 262 | 262 | ||
| 263 | 263 | and("I should see 10 (5 of which are hidden) Sport (Sports in US) stories") | |
| 264 | - Front.ukEditions("front").descriptions(1) should be(TrailblockDescription("sport", "Sport", 5, 1, style = Some(Featured))) | ||
| 265 | - Front.usEditions("front").descriptions(1) should be(TrailblockDescription("sport", "Sports", 5, 1, style = Some(Featured))) | ||
| 264 | + Front.ukEditions("front").descriptions(1) should be(TrailblockDescription("sport", "Sport", 5, style = Some(Featured))) | ||
| 265 | + Front.usEditions("front").descriptions(1) should be(TrailblockDescription("sport", "Sports", 5, style = Some(Featured))) | ||
| 266 | 266 | ||
| 267 | 267 | and("I should see 6 (3 of which are hidden) Comment is Free stories") | |
| 268 | - Front.ukEditions("front").descriptions(2) should be(TrailblockDescription("commentisfree", "Comment is free", 3, 0, style = Some(Featured))) | ||
| 269 | - Front.usEditions("front").descriptions(2) should be(TrailblockDescription("commentisfree", "Comment is free", 3, 0, style = Some(Featured))) | ||
| 268 | + Front.ukEditions("front").descriptions(2) should be(TrailblockDescription("commentisfree", "Comment is free", 3, style = Some(Featured))) | ||
| 269 | + Front.usEditions("front").descriptions(2) should be(TrailblockDescription("commentisfree", "Comment is free", 3, style = Some(Featured))) | ||
| 270 | 270 | ||
| 271 | 271 | and("I should see 1 Culture story") | |
| 272 | 272 | Front.ukEditions("front").descriptions(3) should be(TrailblockDescription("culture", "Culture", 3, style = Some(Thumbnail))) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,7 +14,7 @@ object SectionController extends Controller with Logging with Paging with Format | |||
| 14 | 14 | ||
| 15 | 15 | val validFormats: Seq[String] = Seq("html", "json") | |
| 16 | 16 | ||
| 17 | - def render(path: String, format: String) = Action { implicit request => | ||
| 17 | + def render(path: String, format: String = "html") = Action { implicit request => | ||
| 18 | 18 | val promiseOfSection = Akka.future(lookup(path)) | |
| 19 | 19 | // make sure a valid format has been requested | |
| 20 | 20 | checkFormat(format).map { validFormat => | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,7 @@ object TagController extends Controller with Logging with Formats { | |||
| 16 | 16 | ||
| 17 | 17 | val validFormats = Seq("html", "json") | |
| 18 | 18 | ||
| 19 | - def render(path: String, format: String) = Action { implicit request => | ||
| 19 | + def render(path: String, format: String = "html") = Action { implicit request => | ||
| 20 | 20 | val promiseOfTag = Akka.future(lookup(path)) | |
| 21 | 21 | Async { | |
| 22 | 22 | promiseOfTag.map(_.map { renderTag(_, format) } getOrElse { NotFound }) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,7 +33,7 @@ <h2 class="type-2 article-zone b1">Latest</h2> | |||
| 33 | 33 | } | |
| 34 | 34 | ||
| 35 | 35 | <div class="trailblock" data-count="@trails.length" data-link-name="Tag:block:@tag.section"> | |
| 36 | - @fragments.trailblocks.section(trails) | ||
| 36 | + @fragments.trailblocks.section(trails, trails.size) | ||
| 37 | 37 | </div> | |
| 38 | 38 | ||
| 39 | 39 | </section> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,8 +3,9 @@ | |||
| 3 | 3 | # ~~~~ | |
| 4 | 4 | ||
| 5 | 5 | # For dev machines | |
| 6 | - GET /assets/*file controllers.Assets.at(path="/public", file) | ||
| 6 | + GET /assets/*file controllers.Assets.at(path="/public", file) | ||
| 7 | 7 | ||
| 8 | - | ||
| 9 | - GET /*path controllers.TagController.render(path, format = "html") | ||
| 10 | - GET /*path.:format controllers.TagController.render(path, format) | ||
| 8 | + GET /$path<[\w\d-]*/[\w\d-]*> controllers.TagController.render(path, format = "html") | ||
| 9 | + GET /$path<[\w\d-]*/[\w\d-]*>.:format controllers.TagController.render(path, format) | ||
| 10 | + GET /$path<[\w\d-]*/[\w\d-]*/[\w\d-]*> controllers.TagController.render(path, format = "html") | ||
| 11 | + GET /$path<[\w\d-]*/[\w\d-]*/[\w\d-]*>.:format controllers.TagController.render(path, format) | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments