bomberstudios / bliki

A small blog + wiki engine built on Sinatra + Stone

This URL has Read+Write access

bliki / test / test_plugins.rb
100644 15 lines (14 sloc) 0.616 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'test/helper'
 
class BlikiPluginsTest < Test::Unit::TestCase
  test "WikiWords plugin works" do
    new_page = Page.new(:title => "wikiword test one", :body => "WikiWord", :tags => "wiki")
    get_it '/wikiword-test-one'
    assert_match /<a href=\"(.+)\">WikiWord<\/a>/, body
  end
  test "WikiWords plugin does not break code blocks" do
    new_page = Page.new(:title => "wikiword test two", :body => "WikiWord\n f = FooBar.new", :tags => "wiki")
    get_it '/wikiword-test-two'
    assert_match(/<a href=\"(.+)\">WikiWord<\/a>/, body)
    assert_no_match(/<a href=\"(.+)\">FooBar<\/a>/, body)
  end
end