Sha256: 67203ee765ad09ce12734209c3541fcbbd2569500b84d6ed4df70f4f2ca759a2

Contents?: true

Size: 729 Bytes

Versions: 6

Compression:

Stored size: 729 Bytes

Contents

require 'test_helper'

class PartiallyUsefulTest < ActionController::TestCase
  tests WelcomeController

  test "rendering the index template for html adds partial rendering comments to the source" do
    get :index

    assert_match "<!-- start rendering 'header' with locals '[]'-->", @response.body
    assert_match "<h1>Hellooooo</h1>", @response.body
  end

  test "calling the json endpoint does nothing" do
    get :index, format: :json

    assert_equal "{}", @response.body
  end

  test "calling the xml endpoint does not include any rendering comments" do
    get :index, format: :xml

    xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<welcome>SOME TEXT</welcome>"
    assert_equal xml, @response.body
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
partially_useful-6.0.0 test/partially_useful_test.rb
partially_useful-5.1.0 test/partially_useful_test.rb
partially_useful-5.0.0 test/partially_useful_test.rb
partially_useful-0.2.2 test/partially_useful_test.rb
partially_useful-0.2.1 test/partially_useful_test.rb
partially_useful-0.2.0 test/partially_useful_test.rb