Sha256: 5bd502add9eedde9be64e428da7ca2e94cd710fae451808594b5b1caff10953a

Contents?: true

Size: 1.04 KB

Versions: 5

Compression:

Stored size: 1.04 KB

Contents

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

describe TopicsController do
  dataset :forums

  before do
    Page.current_site = sites(:test) if defined? Site
    controller.stub!(:request).and_return(request)
    Radiant::Config['forum.public?'] = true
  end

  describe "on get to index" do
    describe "with html format" do
      before do
        get :index
      end
    
      it "should render the topic list" do
        response.should be_success
        response.should render_template("index")
      end
    end
  end
    
  describe "on get to show" do
    before do
      @topic = topics(:older)
      get :show, :id => topic_id(:older), :forum_id => forum_id(:public)
    end
    
    it "should render the show template" do
      response.should be_success
      response.should render_template("show")
    end
  end

  [:new, :edit, :update, :create, :destroy].each do |action|
    it "should fail #{action} requests" do
      lambda { get action, :id => forum_id(:public) }.should raise_error ActionController::RoutingError
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
radiant-forum-extension-2.1.6 spec/controllers/topics_controller_spec.rb
radiant-forum-extension-2.1.4 spec/controllers/topics_controller_spec.rb
radiant-forum-extension-2.1.3 spec/controllers/topics_controller_spec.rb
radiant-forum-extension-2.1.2 spec/controllers/topics_controller_spec.rb
radiant-forum-extension-2.1.1 spec/controllers/topics_controller_spec.rb