public
Description: The easy to use rails wiki
Homepage: http://signalwiki.com
Clone URL: git://github.com/queso/signal-wiki.git
signal-wiki / spec / helpers / pages_helper_spec.rb
100644 17 lines (13 sloc) 0.684 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require File.dirname(__FILE__) + '/../spec_helper'
 
describe PagesHelper do
  
  it "has the right amount of greediness on parsing wiki links" do
    self.stub!(:wiki_link).and_return "MONKEYS"
    wikified_body("hello[[there]]whats[[up]]").should == "<p>helloMONKEYSwhatsMONKEYS</p>"
    wikified_body("hello[[there|hai]]whats[[up|doc]]").should == "<p>helloMONKEYSwhatsMONKEYS</p>"
  end
  
  it "parses wiki links" do
    self.should_receive(:wiki_link).with("up", nil).and_return("MONKEYS")
    self.should_receive(:wiki_link).with("there", "hai").and_return("MONKEYS")
    wikified_body("hello[[there|hai]]whats[[up]]").should == "<p>helloMONKEYSwhatsMONKEYS</p>"
  end
  
end