Created
December 20, 2009 04:09
-
-
Save jonathanclarke/260349 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe UsersController do | |
describe "handling GET /users.xml" do | |
before(:each) do | |
@users = mock("Array of Users", :to_xml => "XML") | |
User.stub!(:find).and_return(@users) | |
end | |
def do_get | |
@request.env["HTTP_ACCEPT"] = "application/xml" | |
get :index | |
end | |
it "should render the found users as xml" do | |
@users.should_receive(:to_xml).and_return("XML") | |
do_get | |
response.body.should == "XML" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment