Sha256: e89a9880069fdb63522ae867642109795f124e40c2f4461962d1ff2b134b7bc2

Contents?: true

Size: 1.48 KB

Versions: 17

Compression:

Stored size: 1.48 KB

Contents

require "test_helper"

class PartialOverridingTest < ActionDispatch::IntegrationTest
  def test_default_partial
    visit new_article_path
    assert page.has_content? "Title"
  end

  def test_override_partial
    add_template "app/views/articles/_form.html.erb", "foo"
    visit new_article_path
    assert page.has_content? "foo"
  end

  def test_override_resource_partial
    add_template "app/views/resource/_form.html.erb", "foo"
    visit new_article_path
    assert page.has_content? "foo"
  end

  def test_override_partial_and_resource_partial
    add_template "app/views/articles/_form.html.erb", "foo"
    add_template "app/views/resource/_form.html.erb", "bar"
    visit new_article_path
    assert page.has_content? "foo"
  end

  def test_default_partial_in_engine
    visit admin.new_article_path
    assert page.has_content? "Title"
  end

  def test_override_partial_in_engine
    add_template "admin/app/views/admin/articles/_form.html.erb", "foo"
    visit admin.new_article_path
    assert page.has_content? "foo"
  end

  def test_override_resource_partial_in_engine
    add_template "admin/app/views/admin/resource/_form.html.erb", "foo"
    visit admin.new_article_path
    assert page.has_content? "foo"
  end

  def test_override_partial_and_resource_partial_in_engine
    add_template "admin/app/views/admin/articles/_form.html.erb", "foo"
    add_template "admin/app/views/admin/resource/_form.html.erb", "bar"
    visit admin.new_article_path
    assert page.has_content? "foo"
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
godmin-2.3.0 test/integration/view_overriding/partial_overriding_test.rb
godmin-2.2.2 test/integration/view_overriding/partial_overriding_test.rb
godmin-2.2.1 test/integration/view_overriding/partial_overriding_test.rb
godmin-2.2.0 test/integration/view_overriding/partial_overriding_test.rb
godmin-2.1.0 test/integration/view_overriding/partial_overriding_test.rb
godmin-2.0.0 test/integration/view_overriding/partial_overriding_test.rb
godmin-1.5.0 test/integration/view_overriding/partial_overriding_test.rb
godmin-1.4.0 test/integration/view_overriding/partial_overriding_test.rb
godmin-1.3.1 test/integration/view_overriding/partial_overriding_test.rb
godmin-1.3.0 test/integration/view_overriding/partial_overriding_test.rb
godmin-1.2.0 test/integration/view_overriding/partial_overriding_test.rb
godmin-1.1.0 test/integration/partial_overriding_test.rb
godmin-1.0.0 test/integration/partial_overriding_test.rb
godmin-0.12.4 test/integration/partial_overriding_test.rb
godmin-0.12.3 test/integration/partial_overriding_test.rb
godmin-0.12.2 test/integration/partial_overriding_test.rb
godmin-0.12.1 test/integration/partial_overriding_test.rb