Sha256: 92391c7aca1f6d26bc37113463e7fdf82677adf1ae5aa4b593324b2a5a0440de

Contents?: true

Size: 1.34 KB

Versions: 3

Compression:

Stored size: 1.34 KB

Contents

require 'test_helper'

class ViewExtensionsTest < ActionController::TestCase
  tests MusicianController

  class Cell < Cell::Concept
    def show
      "<b>#{model}</b>"
    end
  end

  class SongCell < ::Cell::ViewModel
    def show
      "<b>#{model}</b>"
    end
  end


  # #concept is available in controller views.
  test "concept(..).show" do
    get :view_with_concept_with_show
    assert_equal "&lt;b&gt;Up For Breakfast&lt;/b&gt;", @response.body # TODO: test options/with twin.
  end

  test "concept(..).call" do
    get :view_with_concept_with_call
    assert_equal "<b>A Tale That Wasn't Right</b>", @response.body # TODO: test options/with twin.
  end

  test "concept(..) without #call" do
    get :view_with_concept_without_call
    assert_equal "<b>A Tale That Wasn't Right</b>", @response.body
  end

  test "cell(..) with #call" do
    get :view_with_cell_with_call
    assert_equal "<b>A Tale That Wasn't Right</b>", @response.body
  end

  # Controller#concept
  test "Controller#concept(..).call" do
    get :action_with_concept_with_call
    assert_equal "<b>A Tale That Wasn't Right</b>", @response.body # TODO: test options/with twin.
  end

  # Controller#cell
  test "Controller#cell(..).call" do
    get :action_with_cell_with_call
    assert_equal "<b>A Tale That Wasn't Right</b>", @response.body # TODO: test options/with twin.
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cells-4.0.5 test/rails_extensions_test.rb
cells-4.0.4 test/rails_extensions_test.rb
cells-4.0.3 test/rails_extensions_test.rb