Sha256: a53e6e03a33c9ab82bd42c3d1dc72716011c13f2b394441b207152c93a1827cf

Contents?: true

Size: 1.32 KB

Versions: 11

Compression:

Stored size: 1.32 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
    @response.body.must_equal "&lt;b&gt;Up For Breakfast&lt;/b&gt;" # TODO: test options/with twin.
  end

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

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

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

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

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

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
cells-4.0.2 test/rails_extensions_test.rb
cells-4.0.1 test/rails_extensions_test.rb
cells-4.0.0 test/rails_extensions_test.rb
cells-4.0.0.rc1 test/rails_extensions_test.rb
cells-4.0.0.beta6 test/rails_extensions_test.rb
cells-4.0.0.beta5 test/rails_extensions_test.rb
cells-4.0.0.beta4 test/rails_extensions_test.rb
cells-4.0.0.beta3 test/rails_extensions_test.rb
cells-4.0.0.beta2 test/rails_extensions_test.rb
cells-4.0.0.beta1 test/rails_extensions_test.rb
cells-jamie-4.0.0.alpha1 test/vm/rails_extensions_test.rb