Sha256: 6c2b6b5c387fc1fa26568ad9be8705d439657e41a8cfc11f15e47668c8f0a6d6

Contents?: true

Size: 1.05 KB

Versions: 26

Compression:

Stored size: 1.05 KB

Contents

require File.dirname(__FILE__) + "/../spec_helper"

if defined? Site
  describe 'Forum site' do
    dataset :forums, :forum_sites
    # Radiant::Config['reader.layout'] = 'Reader'
    
    it "should have a forums association" do
      Site.reflect_on_association(:forums).should_not be_nil
    end

    it "should have a topics association" do
      Site.reflect_on_association(:topics).should_not be_nil
    end

    it "should have a posts association" do
      Site.reflect_on_association(:posts).should_not be_nil
    end

    it "should have a forum_layout association" do
      Site.reflect_on_association(:forum_layout).should_not be_nil
    end
    
    it "should return reader layout by default" do
      site = sites(:test)
      site.reader_layout = layouts(:reader)
      site.layout_for(:forum).should == 'Reader'
    end

    it "should return forum layout name if specified" do
      site = sites(:test)
      site.reader_layout = layouts(:reader)
      site.forum_layout = layouts(:forum)
      site.layout_for(:forum).should == 'Forum'
    end
  end

end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
radiant-forum-extension-2.0.5 spec/lib/forum_site_spec.rb
radiant-forum-extension-2.0.4 spec/lib/forum_site_spec.rb
radiant-forum-extension-2.0.3 spec/lib/forum_site_spec.rb
radiant-forum-extension-2.0.2 spec/lib/forum_site_spec.rb
radiant-forum-extension-2.0.1 spec/lib/forum_site_spec.rb
radiant-forum-extension-2.0.0 spec/lib/forum_site_spec.rb