Sha256: ed69737243209cc126b5bf9bf5a9eb56d5e8ee900ca1b39c4dcca31f9d55a9b1
Contents?: true
Size: 1.2 KB
Versions: 12
Compression:
Stored size: 1.2 KB
Contents
shared_examples_for "view helpers" do |subject| describe "#helpers" do it "returns the current view context" do Draper::ViewContext.stub current: :current_view_context expect(subject.helpers).to be :current_view_context end it "is aliased to #h" do Draper::ViewContext.stub current: :current_view_context expect(subject.h).to be :current_view_context end end describe "#localize" do it "delegates to #helpers" do subject.stub helpers: double subject.helpers.should_receive(:localize).with(:an_object, some: "parameter") subject.localize(:an_object, some: "parameter") end it "is aliased to #l" do subject.stub helpers: double subject.helpers.should_receive(:localize).with(:an_object, some: "parameter") subject.l(:an_object, some: "parameter") end end describe ".helpers" do it "returns the current view context" do Draper::ViewContext.stub current: :current_view_context expect(subject.class.helpers).to be :current_view_context end it "is aliased to .h" do Draper::ViewContext.stub current: :current_view_context expect(subject.class.h).to be :current_view_context end end end
Version data entries
12 entries across 12 versions & 4 rubygems