Sha256: e1d8cbb33f474a0d5619a3387acff431427c950e1f4928c815e9f4812e90ce26
Contents?: true
Size: 1.05 KB
Versions: 6
Compression:
Stored size: 1.05 KB
Contents
require 'spec_helper' describe Seymour::Renderable do class RenderableActivity include Seymour::Renderable end describe "render" do let(:response) { mock(ActionDispatch::Response, :body => 'Lots of activity going on') } let(:activity) { RenderableActivity.new } before(:each) do ok_rack_response = lambda { |env| ['200', {}, response ] } Seymour::RenderController.stub!(:action).and_return ok_rack_response end it "should render activity partial via render controller" do response = activity.render("seymour/render", "activity", "seymour.activity" => activity) response.should == 'Lots of activity going on' end it "should raise RenderError if response not OK" do bad_rack_response = lambda { |env| ['500', {}, response ] } Seymour::RenderController.stub!(:action).and_return bad_rack_response calling_render = lambda { activity.render("seymour/render", "activity", "seymour.activity" => activity) } calling_render.should raise_error(Seymour::RenderError) end end end
Version data entries
6 entries across 6 versions & 1 rubygems