]> source.dussan.org Git - sonarqube.git/commitdiff
Remove repository key from rendering of rule macro
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Mon, 17 Feb 2014 13:36:29 +0000 (14:36 +0100)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Mon, 17 Feb 2014 13:36:29 +0000 (14:36 +0100)
sonar-server/src/main/java/org/sonar/server/text/RuleMacro.java
sonar-server/src/test/java/org/sonar/server/text/MacroInterpreterTest.java

index e0209ef569969ac00568d08c0623f372dd2ce3ce..795a305defa33b3bc7c0dc6a994072bb96f5141d 100644 (file)
@@ -36,6 +36,6 @@ class RuleMacro implements Macro {
   }
 
   public String getReplacement() {
-    return "<a class='open-modal rule-modal' modal-width='800' href='" + contextPath + "/rules/show/$1:$2?modal=true&layout=false'>$1:$2</a>";
+    return "<a class='open-modal rule-modal' modal-width='800' href='" + contextPath + "/rules/show/$1:$2?modal=true&layout=false'>$2</a>";
   }
 }
index b23f84c0741d1fefadbef6431097cf9e8fd2fc8c..86c82fb0b43c550b435599e909d2f359368be79d 100644 (file)
@@ -53,7 +53,7 @@ public class MacroInterpreterTest {
     String ruleKey = "repo:key";
     String origin = "See {rule:" + ruleKey + "} for detail.";
     String result = interpreter.interpret(origin);
-    assertThat(result).isEqualTo("See <a class='open-modal rule-modal' modal-width='800' href='" + path + "/rules/show/" + ruleKey + "?modal=true&layout=false'>" + ruleKey + "</a> for detail.");
+    assertThat(result).isEqualTo("See <a class='open-modal rule-modal' modal-width='800' href='" + path + "/rules/show/" + ruleKey + "?modal=true&layout=false'>key</a> for detail.");
   }
 
   @Test
@@ -61,6 +61,6 @@ public class MacroInterpreterTest {
     String ruleKey = "my-repo1:my-key1";
     String origin = "See {rule:" + ruleKey + "} for detail.";
     String result = interpreter.interpret(origin);
-    assertThat(result).isEqualTo("See <a class='open-modal rule-modal' modal-width='800' href='" + path + "/rules/show/" + ruleKey + "?modal=true&layout=false'>" + ruleKey + "</a> for detail.");
+    assertThat(result).isEqualTo("See <a class='open-modal rule-modal' modal-width='800' href='" + path + "/rules/show/" + ruleKey + "?modal=true&layout=false'>my-key1</a> for detail.");
   }
 }