FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fixing scala test · devhttps/frontend@5439352 · GitHub

Commit 5439352

Browse files
Darren Hurley
committed
fixing scala test
1 parent 224d320 commit 5439352

8 files changed

Lines changed: 19 additions & 23 deletions

File tree

‎article/test/ArticleFeatureTest.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ class ArticleFeatureTest extends FeatureSpec with GivenWhenThen with ShouldMatch
250250
import browser._
251251

252252
then("I should see navigation to related content")
253-
$("[itemprop=relatedLink]").size() should be > (5)
253+
$("[itemprop=relatedLink]").size() should be <= (5)
254254
}
255255
}
256256

‎core-navigation/test/RelatedFeatureTest.scala‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class RelatedFeatureTest extends FeatureSpec with GivenWhenThen with ShouldMatch
3434
import browser._
3535

3636
then("I should see the related links")
37-
$("li") should have length 10
37+
$("li") should have length 5
3838

3939
}
4040
}
@@ -62,11 +62,6 @@ class RelatedFeatureTest extends FeatureSpec with GivenWhenThen with ShouldMatch
6262
// FIXME - need consistent data, as image can go missing
6363
//article.findFirst("img").getAttribute("src").length should be > 0
6464

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-
7065
}
7166
}
7267

@@ -78,7 +73,7 @@ class RelatedFeatureTest extends FeatureSpec with GivenWhenThen with ShouldMatch
7873

7974
then("I see each trail block displays the published date of the corresponding article")
8075

81-
$(".relative-timestamp") should have length 10
76+
$(".relative-timestamp") should have length 5
8277

8378
}
8479
}

‎front/app/controllers/FrontController.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class FrontController extends Controller with Logging with Formats {
3636

3737
def isUp() = Action { Ok("Ok") }
3838

39-
def render(path: String, format: String) = Action { implicit request =>
39+
def render(path: String, format: String = "html") = Action { implicit request =>
4040
val edition = Edition(request, Configuration)
4141

4242
val page: Option[MetaData] = path match {

‎front/test/FrontFeatureTest.scala‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class FrontFeatureTest extends FeatureSpec with GivenWhenThen with ShouldMatcher
4141

4242
then("I should see the news trailblock")
4343
val news = $(".zone-news")
44-
news.find(".trail-headline") should have length (9)
44+
news.find(".trail-headline") should have length (4)
4545
}
4646
}
4747

@@ -257,16 +257,16 @@ class FrontFeatureTest extends FeatureSpec with GivenWhenThen with ShouldMatcher
257257
given("I visit the network front")
258258

259259
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)))
262262

263263
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)))
266266

267267
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)))
270270

271271
and("I should see 1 Culture story")
272272
Front.ukEditions("front").descriptions(3) should be(TrailblockDescription("culture", "Culture", 3, style = Some(Thumbnail)))

‎section/app/controllers/SectionController.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ object SectionController extends Controller with Logging with Paging with Format
1414

1515
val validFormats: Seq[String] = Seq("html", "json")
1616

17-
def render(path: String, format: String) = Action { implicit request =>
17+
def render(path: String, format: String = "html") = Action { implicit request =>
1818
val promiseOfSection = Akka.future(lookup(path))
1919
// make sure a valid format has been requested
2020
checkFormat(format).map { validFormat =>

‎tag/app/controllers/TagController.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ object TagController extends Controller with Logging with Formats {
1616

1717
val validFormats = Seq("html", "json")
1818

19-
def render(path: String, format: String) = Action { implicit request =>
19+
def render(path: String, format: String = "html") = Action { implicit request =>
2020
val promiseOfTag = Akka.future(lookup(path))
2121
Async {
2222
promiseOfTag.map(_.map { renderTag(_, format) } getOrElse { NotFound })

‎tag/app/views/tag.scala.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h2 class="type-2 article-zone b1">Latest</h2>
3333
}
3434

3535
<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)
3737
</div>
3838

3939
</section>

‎tag/conf/routes‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
# ~~~~
44

55
# For dev machines
6-
GET /assets/*file controllers.Assets.at(path="/public", file)
6+
GET /assets/*file controllers.Assets.at(path="/public", file)
77

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)

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL