Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def export
- respond_to do |format|
- format.tdl do
- render :xml => @template.export_as_tdl
- return
- end
- format.any do
- render :json => @template.export_as_json
- end
- end
- end
- describe "export" do
- it "should call export_as_json" do
- @tpl.should_receive(:export_as_json)
- get :export, :id => TEMPLATE_ID
- end
- it "should call export_as_tdl" do
- @tpl.should_receive(:export_as_tdl)
- @request.env["HTTP_ACCEPT"] = "application/tdl-xml"
- get :export, :id => TEMPLATE_ID
- end
- end
Add Comment
Please, Sign In to add comment