Repository URL to install this package:
Version:
0.1.0 ▾
|
class SomeArticleClass; end
require 'action_controller'
require 'neoteric-archiver/archiver_controller'
class SomeController < ActionController::Base
include Neoteric::ArchiverController
archiving SomeArticleClass
end
module Neoteric
describe ArchiverController do
let(:controller) { SomeController.new }
describe "GET archive" do
let(:published_posts) { stub }
before :each do
controller.stub(:params) do
{ :month => 8, :year => 2010 }
end
end
it "grabs posts by month and year" do
controller.stub(:render)
SomeArticleClass.should_receive(:published)
.and_return(published_posts)
published_posts.should_receive(:by_month)
.with(2010, 8)
controller.send(:archive)
end
it "renders index" do
SomeArticleClass.stub_chain(:published, :by_month)
controller.should_receive(:render)
.with(:template => 'some_article_classes/index')
controller.send(:archive)
end
end
end
end