From 551e55b1fa5da2ec3ec53808fd761215bfe46fad Mon Sep 17 00:00:00 2001 From: Pavel Tsurbeleu Date: Tue, 15 Sep 2015 00:52:15 -0700 Subject: [PATCH 1/3] add an assertion to ensure well-formed img elements in waypoint-make-images-mobile-responsive challenge, closes #1021 --- challenges/bootstrap.json | 1 + 1 file changed, 1 insertion(+) diff --git a/challenges/bootstrap.json b/challenges/bootstrap.json index fb4f864474..35b7a02321 100644 --- a/challenges/bootstrap.json +++ b/challenges/bootstrap.json @@ -97,6 +97,7 @@ ], "tests": [ "assert($(\"img\").length > 1, 'You should have a total of two images.')", + "assert(editor.match(//g).length === 2 && editor.match(/img element has a closing angle bracket.')", "assert($(\"img\").hasClass(\"img-responsive\"), 'Your new image should have the class img-responsive.')", "assert(new RegExp(\"http://bit.ly/fcc-running-cats\", \"gi\").test($(\"img.img-responsive\").attr(\"src\")), 'Add a second image with the src of http://bit.ly/fcc-running-cats.')" ], From 7006b1207c3b736f99f711a76b9ecf36da2294f5 Mon Sep 17 00:00:00 2001 From: Pavel Tsurbeleu Date: Wed, 16 Sep 2015 18:04:37 -0700 Subject: [PATCH 2/3] fix count img elements assertion in waypoint-make-images-mobile-responsive challenge to be strict --- challenges/bootstrap.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/bootstrap.json b/challenges/bootstrap.json index 35b7a02321..f953d8e58a 100644 --- a/challenges/bootstrap.json +++ b/challenges/bootstrap.json @@ -96,7 +96,7 @@ "Fortunately, with Bootstrap, all we need to do is add the img-responsive class to your image. Do this, and the image should perfectly fit the width of your page." ], "tests": [ - "assert($(\"img\").length > 1, 'You should have a total of two images.')", + "assert($(\"img\").length === 2, 'You should have a total of two images.')", "assert(editor.match(//g).length === 2 && editor.match(/img element has a closing angle bracket.')", "assert($(\"img\").hasClass(\"img-responsive\"), 'Your new image should have the class img-responsive.')", "assert(new RegExp(\"http://bit.ly/fcc-running-cats\", \"gi\").test($(\"img.img-responsive\").attr(\"src\")), 'Add a second image with the src of http://bit.ly/fcc-running-cats.')" From 723a8ffb76355992918fac018bdda752003a8c13 Mon Sep 17 00:00:00 2001 From: Pavel Tsurbeleu Date: Wed, 16 Sep 2015 18:10:16 -0700 Subject: [PATCH 3/3] fix wording of src attribute assertion's message to be consistent with other messages in waypoint-make-images-mobile-responsive challenge --- challenges/bootstrap.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/bootstrap.json b/challenges/bootstrap.json index f953d8e58a..bfc812b897 100644 --- a/challenges/bootstrap.json +++ b/challenges/bootstrap.json @@ -99,7 +99,7 @@ "assert($(\"img\").length === 2, 'You should have a total of two images.')", "assert(editor.match(//g).length === 2 && editor.match(/img element has a closing angle bracket.')", "assert($(\"img\").hasClass(\"img-responsive\"), 'Your new image should have the class img-responsive.')", - "assert(new RegExp(\"http://bit.ly/fcc-running-cats\", \"gi\").test($(\"img.img-responsive\").attr(\"src\")), 'Add a second image with the src of http://bit.ly/fcc-running-cats.')" + "assert(new RegExp(\"http://bit.ly/fcc-running-cats\", \"gi\").test($(\"img.img-responsive\").attr(\"src\")), 'Your new image should have a src attribute of http://bit.ly/fcc-running-cats.')" ], "challengeSeed": [ "",