Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Autolink URLs.

  • Loading branch information...
commit eddf305e130840b30453d3ba19c6fe1f30606760 1 parent f71db17
@marnen authored
View
2  app/assets/javascripts/views/story_view.js
@@ -346,7 +346,7 @@ Fulcrum.StoryView = Fulcrum.FormView.extend({
var description = this.make('div');
$(description).addClass('description');
$(description).html(
- window.md.makeHtml(this.model.escape('description'))
+ window.md.makeHtml(this.model.get('description'))
);
$(div).append(description);
$(description).after(
View
32 spec/features/stories_spec.rb
@@ -118,6 +118,38 @@
end
end
+ describe 'formatting' do
+ before do
+ Capybara.ignore_hidden_elements = true
+ visit project_path project
+ end
+
+ describe 'description', js: true do
+ let(:title) { 'My story' }
+ let(:expand_story) { find('.story-title', text: 'My story').click }
+
+ before do
+ click_on 'Add story'
+ fill_in 'title', with: title
+ end
+
+ it 'shows *italics*' do
+ fill_in 'description', with: 'Text with *italics*.'
+ within('.story-controls') { click_on 'Save' }
+ expand_story
+ page.should have_css :em, text: 'italics'
+ end
+
+ it 'autolinks URLs' do
+ url = 'http://www.google.com'
+ fill_in 'description', with: "Text with a URL: #{url}"
+ within('.story-controls') { click_on 'Save' }
+ expand_story
+ page.should have_css "a[href='#{url}']", text: url
+ end
+ end
+ end
+
def story_selector(story)
"#story-#{story.id}"
end
Please sign in to comment.
Something went wrong with that request. Please try again.