require File.dirname(__FILE__) + '/../spec_helper'
describe "Forum Tags" do
dataset :forums
let(:page){ pages(:commentable) }
let(:reader){ readers(:normal) }
describe "r:forum:topic tags" do
let(:topic){ topics(:older) }
let(:sticky){ topics(:sticky) }
let(:on_date){ I18n.l(topic.created_at, :format => :standard) }
let(:sticky_date){ I18n.l(sticky.created_at, :format => :standard) }
subject { page }
it { should render(%{}).as(topic.name) }
it { should render(%{}).as(topic.posts.first.body_html) }
it { should render(%{}).as("Normal") }
it { should render(%{}).as(on_date) }
it { should render(%{}).as("/forum/forums/#{topic.forum.id}/topics/#{topic.id}") }
it { should render(%{}).as(%{reply from Normal}) }
it { should render(%{}).as("
original topic message
") }
it { should render(%{}).as(%{#{topic.name}}) }
it { should render(%{}).as(%{#{topic.name}
reply from Normal}) }
it { should render(%{}).as(%{#{sticky.name}
Started by Normal}) }
end
describe "r:forum:post tags" do
let(:post){ posts(:second) }
let(:comment){ posts(:comment) }
subject { page }
it { should render(%{}).as(post.topic.name) }
it { should render(%{}).as(comment.page.title) }
end
end