Sha256: 3c7663d37131ed6ba2904758d459f0ec50f787369005d2b0d9c018f6692832fd

Contents?: true

Size: 777 Bytes

Versions: 2

Compression:

Stored size: 777 Bytes

Contents

Feature: Specifying model accessor
  In order to access the underlying model in my presenter methods
  As a developer
  I want to specify an accessor I will use to access the undelying model

  @model @access
  Scenario: Specifiying accessor
    Given I have an ActiveModel based model
      """
      class MyActiveModel < ActiveModelExample
        attr_accessor :title
      end
      """
    When I define a Catwalk presenter class for my model
      """
      class MyModelPresenter
        include Catwalk::Presenter

        access_as :my_model
      end
      """
    When I set up my presenter for my model
      """
      @model = MyActiveModel.new
      @presenter = MyModelPresenter.new @model
      """
    Then my presenter should expose the model via "my_model"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
catwalk-0.0.3 features/specifying_model_accessor.feature
catwalk-0.0.2 features/specifying_model_accessor.feature