@@ -58,6 +58,31 @@ class GistFilterTestCase extends DrupalWebTestCase {
5858
5959 }
6060
61+ /**
62+ * Testing the embedded gist option with a file parameter.
63+ */
64+ function testEmbedStyleWithFile() {
65+
66+ // Turn on our input filter and set the option to embed.
67+ $edit = array(
68+ 'filters[gist_filter][status]' => 1,
69+ 'filters[gist_filter][settings][gist_filter_display_method]' => 'embed',
70+ );
71+ $this->drupalPost('admin/config/content/formats/plain_text', $edit, t('Save configuration'));
72+
73+ // Create a test node
74+ $langcode = LANGUAGE_NONE;
75+ $edit = array(
76+ "title" => $this->randomName(),
77+ "body[$langcode][0][value]" => 'Hello! [gist:865412:php_file.php]',
78+ );
79+ $result = $this->drupalPost('node/add/' . $this->contentType->type, $edit, t('Save'));
80+ $this->assertResponse(200);
81+ $this->assertRaw("Hello! ");
82+ $this->assertRaw('<script src="http://gist.github.com/865412.js?file=php_file.php"></script>');
83+
84+ }
85+
6186 /**
6287 * Testing the link option.
6388 */
@@ -82,4 +107,28 @@ class GistFilterTestCase extends DrupalWebTestCase {
82107
83108 }
84109
110+ /**
111+ * Testing the link option.
112+ */
113+ function testLinkStyleWithFile() {
114+
115+ // Turn on our input filter and set the option to link.
116+ $edit = array(
117+ 'filters[gist_filter][status]' => 1,
118+ 'filters[gist_filter][settings][gist_filter_display_method]' => 'link',
119+ );
120+ $this->drupalPost('admin/config/content/formats/plain_text', $edit, t('Save configuration'));
121+
122+ // Create a test node
123+ $langcode = LANGUAGE_NONE;
124+ $edit = array(
125+ "title" => $this->randomName(),
126+ "body[$langcode][0][value]" => 'Hello! [gist:865412:php_file.php]',
127+ );
128+ $result = $this->drupalPost('node/add/' . $this->contentType->type, $edit, t('Save'));
129+ $this->assertResponse(200);
130+ $this->assertRaw('Hello! <a href="http://gist.github.com/865412#file_php_file.php">http://gist.github.com/865412#file_php_file.php</a>');
131+
132+ }
133+
85134}
0 commit comments