Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
Changes quotes in test.
Browse files Browse the repository at this point in the history
  • Loading branch information
joegatt committed Jun 26, 2013
1 parent d120053 commit 5125628
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ def citation_partial(partial, citation_style = Settings.styling.citation_style)
"citations/styles/#{ citation_style }/#{ partial }"
end

def bookify(text, books)
def bookify(text, books, citation_partial = 'inline')
books.each do |book|
text.gsub!(/(<figure>\s*<blockquote)>(.*?#{ book.tag }.*?<\/figure>)/m, "\\1 cite=\"#{ url_for book }\">\\2")
text.gsub!(/#{ book.tag }/, (render citation_partial('inline'), :book => book))
text.gsub!(/#{ book.tag }/, (render citation_partial(citation_partial), :book => book))
end
text
end
Expand Down
4 changes: 2 additions & 2 deletions spec/helpers/application_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
end
it 'converts quotes to block quote and includes attribution if present' do
format_blockquotes("Some text.\nquote:Long quote.-- Kittler 2001\nMore text.")
.should == "Some text.\n<figure class='citation'>\n<blockquote>Long quote.</blockquote>\n<figcaption>Kittler 2001</figcaption>\n</figure>\n\nMore text."
.should == "Some text.\n<figure class=\"citation\">\n<blockquote>Long quote.</blockquote>\n<figcaption>Kittler 2001</figcaption>\n</figure>\n\nMore text."
end
it 'converts quotes to block quote and includes attribution if present on next paragraph' do
format_blockquotes("Some text.\nquote:Long quote.\n-- Kittler 2001\nMore text.")
.should == "Some text.\n<figure class='citation'>\n<blockquote>Long quote.</blockquote>\n<figcaption>Kittler 2001</figcaption>\n</figure>\n\nMore text."
.should == "Some text.\n<figure class=\"citation\">\n<blockquote>Long quote.</blockquote>\n<figcaption>Kittler 2001</figcaption>\n</figure>\n\nMore text."
end
end

Expand Down

0 comments on commit 5125628

Please sign in to comment.