Files
growstuff/spec/controllers/posts_controller_spec.rb
Skud 1ff2211c0f removed boring tests from controllers
the tests generated by 'rails g scaffold...' are boring and brittle.
they don't actually test anything other than the rails framework, and
they were causing us all kinds of trouble. we've started to blow them
away (and raised a PT chore to remove them from other controllers in due
course).
2013-07-08 13:09:37 +10:00

32 lines
816 B
Ruby

require 'spec_helper'
describe PostsController do
login_member
def valid_attributes
member = FactoryGirl.create(:member)
{ :author_id => member.id, :subject => "blah", :body => "blah blah" }
end
describe "GET RSS feed" do
it "returns an RSS feed" do
get :index, :format => "rss"
response.should be_success
response.should render_template("posts/index")
response.content_type.should eq("application/rss+xml")
end
end
describe "GET RSS feed for individual post" do
it "returns an RSS feed" do
post = Post.create! valid_attributes
get :show, { :format => "rss", :id => post.slug }
response.should be_success
response.should render_template("posts/show")
response.content_type.should eq("application/rss+xml")
end
end
end