spec/view_context_spec.rb in draper-0.8.1 vs spec/view_context_spec.rb in draper-0.9.0
- old
+ new
@@ -20,6 +20,16 @@
it "raises an exception if the view_context is fetched without being set" do
Thread.current[:current_view_context] = nil
expect {app_controller.current_view_context}.should raise_exception(Exception)
end
+
+ it "sets view_context every time" do
+ app_controller_instance.stub(:view_context) { 'first' }
+ app_controller_instance.set_current_view_context
+ Thread.current[:current_view_context].should == 'first'
+
+ app_controller_instance.stub(:view_context) { 'second' }
+ app_controller_instance.set_current_view_context
+ Thread.current[:current_view_context].should == 'second'
+ end
end
\ No newline at end of file