Sha256: b7f2f474bb8f13231870cdb5e11bb8bfa4cbede3c5edce76fefbcc66c616cbfb

Contents?: true

Size: 1.19 KB

Versions: 8

Compression:

Stored size: 1.19 KB

Contents

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

describe 'Forum-extended page' do
  dataset :forums
  
  before do
    login_as_reader(:normal)
  end
  
  describe "when pages are commentable" do
    before do
      Radiant::Config['forum.allow_page_comments?'] = true
    end
    
    it "should normally be commentable" do
      pages(:uncommented).locked?.should be_false
    end
  
    it "should be locked if marked not commentable" do
      pages(:uncommentable).locked?.should be_true
    end
  
    it "should be locked if marked comments_closed" do
      pages(:comments_closed).locked?.should be_true
    end
  
    it "should be locked if there is a commentable period and it has expired" do
      Radiant::Config['forum.commentable_period'] = 28
      page = pages(:commentable)
      page.send(:commentable_period).should == 28.days
      page.locked?.should be_false
      page.published_at = Time.now - 30.days
      page.locked?.should be_true
    end
  end
  
  describe "when pages are not commentable" do
    before do
      Radiant::Config['forum.allow_page_comments?'] = false
    end
    
    it "should not be commentable" do
      pages(:uncommented).locked?.should be_true
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
radiant-forum-extension-3.0.7 spec/lib/forum_page_spec.rb
radiant-forum-extension-3.0.6 spec/lib/forum_page_spec.rb
radiant-forum-extension-3.0.5 spec/lib/forum_page_spec.rb
radiant-forum-extension-3.0.4 spec/lib/forum_page_spec.rb
radiant-forum-extension-3.0.3 spec/lib/forum_page_spec.rb
radiant-forum-extension-3.0.2 spec/lib/forum_page_spec.rb
radiant-forum-extension-3.0.1 spec/lib/forum_page_spec.rb
radiant-forum-extension-3.0.0 spec/lib/forum_page_spec.rb