mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-01-14 04:17:50 -05:00
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).
32 lines
816 B
Ruby
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
|