Skip to content
Newer
Older
100644 38 lines (32 sloc) 992 Bytes
1395f79 + context helper method included in action view
Florian Hanke authored May 13, 2008
1 require File.join(File.dirname(__FILE__), 'spec_helper')
2
3 require 'context_helper'
4
5 describe 'ContextHelper' do
6
7 include ContextHelper
8
9 describe "#render_context" do
10 describe "no category given" do
11 it "should not do anything" do
12 render_context(nil).should == nil
13 end
14 end
15 describe "category given, but no type" do
16 before(:each) do
545f380 @floere + rewrite for rspec mocking
authored Jun 29, 2009
17 @context = stub :context
18 Context.should_receive(:new).once.and_return @context
1395f79 + context helper method included in action view
Florian Hanke authored May 13, 2008
19 end
20 it "should call the render method on the context" do
545f380 @floere + rewrite for rspec mocking
authored Jun 29, 2009
21 @context.should_receive(:render).once
22
23 render_context :title
1395f79 + context helper method included in action view
Florian Hanke authored May 13, 2008
24 end
25 end
26 describe "category and type given" do
27 before(:each) do
545f380 @floere + rewrite for rspec mocking
authored Jun 29, 2009
28 @context = stub :context
29 Context.should_receive(:new).once.and_return @context
1395f79 + context helper method included in action view
Florian Hanke authored May 13, 2008
30 end
31 it "should call the render method on the context" do
545f380 @floere + rewrite for rspec mocking
authored Jun 29, 2009
32 @context.should_receive(:render).once
33
34 render_context :title, :profile
1395f79 + context helper method included in action view
Florian Hanke authored May 13, 2008
35 end
36 end
37 end
38 end
Something went wrong with that request. Please try again.