vendredi 10 avril 2015

Testing DraperDecorator


Vote count:

0




I have a method decorator which rendering patrial. { def render_content(column) if object.present? content_tag(:div, class: column) do content_tag(:div, class: 'column_content') do render partial: 'column_content', locals: {brand: object.decorate} end end end end } Wen I call method in view it worked. But when a call this method in a rpsec file for testing I getting error { ActionView::MissingTemplate: Missing partial }. How I can get current context for to called a method.


{require 'rails_helper'


describe BrandDecorator do let(:brand) { FactoryGirl.build_stubbed(:brand).decorate }


describe "#render_content" do it "is a brand present" do expect(brand.render_content('left_column')).to be end end end}



asked 1 min ago







Testing DraperDecorator

Aucun commentaire:

Enregistrer un commentaire