From 2843bd804a9d31a41d2980ed33c87e0888828570 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 --- seed/challenges/bootstrap.json | 1 + 1 file changed, 1 insertion(+) diff --git a/seed/challenges/bootstrap.json b/seed/challenges/bootstrap.json index fb4f864474b..35b7a023218 100644 --- a/seed/challenges/bootstrap.json +++ b/seed/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 165cb41080443f0f061185c6fb5a87f22c16bcd1 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 --- seed/challenges/bootstrap.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/bootstrap.json b/seed/challenges/bootstrap.json index 35b7a023218..f953d8e58a7 100644 --- a/seed/challenges/bootstrap.json +++ b/seed/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 be373787831a45bfce00b92ab70e35dc4f5cd676 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 --- seed/challenges/bootstrap.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/bootstrap.json b/seed/challenges/bootstrap.json index f953d8e58a7..bfc812b8973 100644 --- a/seed/challenges/bootstrap.json +++ b/seed/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": [ "",