Sha256: e559431b2bf180731cb63c7cba3a313720c3a68f1b22ed990b203dde0e884b18
Contents?: true
Size: 1.05 KB
Versions: 1
Compression:
Stored size: 1.05 KB
Contents
require File.join(File.dirname(__FILE__), '../../spec_helper') describe ViewModels::Helpers::Mapping::Collection do include ViewModels::Helpers::Mapping before(:each) do @collection = stub :collection @context = stub :context @collection_view_model = ViewModels::Helpers::Mapping::Collection.new @collection, @context end describe "render_partial" do it "should call instance eval on the context" do @context.should_receive(:instance_eval).once @collection_view_model.send :render_partial, :some_name, :some_params end it "should render the partial in the 'context' context" do @context.should_receive(:render).once @collection_view_model.send :render_partial, :some_name, :some_params end it "should call render partial on context with the passed through parameters" do @context.should_receive(:render).once.with('view_models/collection/_some_name', :locals => { :a => :b }) @collection_view_model.send :render_partial, :some_name, { :a => :b } end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
view_models-2.0.1 | spec/padrino/lib/helpers/collection_spec.rb |