mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-27 03:02:43 -04:00
render markdown in planting descriptions
This commit is contained in:
@@ -15,7 +15,8 @@
|
||||
= p.planted_at
|
||||
|
||||
%div
|
||||
= p.description != "" ? p.description : "No description given"
|
||||
:markdown
|
||||
#{ p.description != "" ? p.description : "No description given." }
|
||||
|
||||
%p
|
||||
= link_to 'More...', p
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
= @planting.quantity != 0 ? @planting.quantity : "not specified"
|
||||
%p
|
||||
%b Description:
|
||||
= @planting.description != "" ? @planting.description : "No description."
|
||||
:markdown
|
||||
#{ @planting.description != "" ? @planting.description : "No description." }
|
||||
|
||||
- if user_signed_in? && current_user == @planting.owner
|
||||
= link_to 'Edit', edit_planting_path(@planting), :class => 'btn'
|
||||
|
||||
@@ -26,7 +26,7 @@ describe "plantings/index" do
|
||||
:crop => @crop,
|
||||
:planted_at => '2008-01-05 12:34:56',
|
||||
:quantity => 3,
|
||||
:description => "MyText",
|
||||
:description => "MyText *ITALIC*",
|
||||
:created_at => Time.now
|
||||
),
|
||||
stub_model(Planting,
|
||||
@@ -57,4 +57,8 @@ describe "plantings/index" do
|
||||
rendered.should contain '2008-01-05 12:34:56'
|
||||
end
|
||||
|
||||
it "renders markdown in the description" do
|
||||
assert_select "em", "ITALIC"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -21,7 +21,7 @@ describe "plantings/show" do
|
||||
:garden => @garden,
|
||||
:crop => @crop,
|
||||
:quantity => 333,
|
||||
:description => "MyText"
|
||||
:description => "MyText *ITALIC*"
|
||||
))
|
||||
render
|
||||
end
|
||||
@@ -33,4 +33,8 @@ describe "plantings/show" do
|
||||
it "renders the description" do
|
||||
rendered.should match(/MyText/)
|
||||
end
|
||||
|
||||
it "renders markdown in the description" do
|
||||
assert_select "em", "ITALIC"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user