Sha256: 52c45d957fbc0a4369846da39795f5d72559d733e755f1375a39d6bfaf77a975

Contents?: true

Size: 993 Bytes

Versions: 2

Compression:

Stored size: 993 Bytes

Contents

require 'spec_helper'
class DummyModelPresenter < BasePresenter
  presents :dummy

  def get_object
    dummy
  end

  def get_template
    @template
  end

  def self.get_object
    @@object
  end

  def self.get_template
    @@template
  end
end

describe ApplicationHelper do

  let(:dummy_model) { DummyModel.new }

  describe "for DummyModel object" do
    it "should initialize presenter with properly template" do
      helper.present(dummy_model).get_template.should be_an(ActionView::Base)
    end

    it "should initialize presenter with properly object model" do
      helper.present(dummy_model).get_object.should eq dummy_model
    end
  end

  describe "for DummyModel class" do
    it "should initialize presenter with properly template" do
      helper.present(DummyModel).get_template.should be_an(ActionView::Base)
    end

    it "should initialize presenter with properly object model" do
      helper.present(DummyModel).get_object.should eq DummyModel
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
base_presenter-0.0.9 spec/helpers/application_helper_spec.rb
base_presenter-0.0.8 spec/helpers/application_helper_spec.rb