diaspora/spec/helpers/posts_helper_spec.rb
Jonne Haß 8280556a47 Introduce message renderer
This new class replaces all existing server side message
rendering helpers and is the new global entry point for such
needs. All models with relevant fields now expose an instance
of MessageRenderer for those. MessageRenderer acts as
gateway between the existing processing solutions for markdown,
mentions and tags and provides a very flexible interface for
all output needs. This makes the API to obtain a message
in a certain format clear. As a result of centralizing the
processing a lot of duplication is eliminated. Centralizing
the message processing also makes it clear where to change
its behaviour, add new representations and what options
are already available.
2014-03-15 17:16:17 +01:00

38 lines
920 B
Ruby

# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
require 'spec_helper'
describe PostsHelper do
describe '#post_page_title' do
before do
@sm = FactoryGirl.create(:status_message)
end
context 'with posts with text' do
it "delegates to message.title" do
message = double
message.should_receive(:title)
post = double(message: message)
post_page_title(post)
end
end
end
describe '#post_iframe_url' do
before do
@post = FactoryGirl.create(:status_message)
end
it "returns an iframe tag" do
post_iframe_url(@post.id).should include "iframe"
end
it "returns an iframe containing the post" do
post_iframe_url(@post.id).should include "src='http://localhost:9887#{post_path(@post)}'"
end
end
end