The code is now completely covered in specs
[lyrix.git] / spec / helpers / lyrics_helper_spec.rb
blobfe35202038f72a3414a77a75378a7b9de4806088
1 require File.dirname(__FILE__) + '/../spec_helper'
3 describe LyricsHelper do
4   before do
5     @song = Song.new
6     @song.lyrics = <<-LYRICS
7 This is a *test* of the lyrics
8 Hopefully this will get split up appropriately
10 This text should be on slide 2
11 As should this
13 Here comes slide three
14     LYRICS
15   end
16   
17   it "should add hr tags in between slides" do
18     text = slides_for_song(@song)
19     text.split("<hr />").size.should == 3
20   end
21   
22   it "should use Textile formatting in lyrics" do
23     text = slides_for_song(@song)
24     text.should include("<strong>")
25   end
26   
27   it "should create a properly-formatted lyrics slide" do
28     result = lyric_slide("first\ntest\ntest\ntest")
29     
30     result.split("<br />").size.should == 3
31     result.should include("<h1>first</h1>")
32     result.should include("<p>test<br />test<br />test</p>")
33   end
34 end