Sha256: 86a8ae0858495bdea653eb4c7fb94ea3011047e05266d1a480d609e3bceb6c2a

Contents?: true

Size: 1.49 KB

Versions: 17

Compression:

Stored size: 1.49 KB

Contents

require "test_helper"

class TemplateOverridingTest < ActionDispatch::IntegrationTest
  def test_default_template
    visit articles_path
    assert page.has_content? "Create Article"
  end

  def test_override_template
    add_template "app/views/articles/index.html.erb", "foo"
    visit articles_path
    assert page.has_content? "foo"
  end

  def test_override_resource_template
    add_template "app/views/resource/index.html.erb", "foo"
    visit articles_path
    assert page.has_content? "foo"
  end

  def test_override_template_and_resource_template
    add_template "app/views/articles/index.html.erb", "foo"
    add_template "app/views/resource/index.html.erb", "bar"
    visit articles_path
    assert page.has_content? "foo"
  end

  def test_default_template_in_engine
    visit admin.articles_path
    assert page.has_content? "Create Article"
  end

  def test_override_template_in_engine
    add_template "admin/app/views/admin/articles/index.html.erb", "foo"
    visit admin.articles_path
    assert page.has_content? "foo"
  end

  def test_override_resource_template_in_engine
    add_template "admin/app/views/admin/resource/index.html.erb", "foo"
    visit admin.articles_path
    assert page.has_content? "foo"
  end

  def test_override_template_and_resource_template_in_engine
    add_template "admin/app/views/admin/articles/index.html.erb", "foo"
    add_template "admin/app/views/admin/resource/index.html.erb", "bar"
    visit admin.articles_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/template_overriding_test.rb
godmin-2.2.2 test/integration/view_overriding/template_overriding_test.rb
godmin-2.2.1 test/integration/view_overriding/template_overriding_test.rb
godmin-2.2.0 test/integration/view_overriding/template_overriding_test.rb
godmin-2.1.0 test/integration/view_overriding/template_overriding_test.rb
godmin-2.0.0 test/integration/view_overriding/template_overriding_test.rb
godmin-1.5.0 test/integration/view_overriding/template_overriding_test.rb
godmin-1.4.0 test/integration/view_overriding/template_overriding_test.rb
godmin-1.3.1 test/integration/view_overriding/template_overriding_test.rb
godmin-1.3.0 test/integration/view_overriding/template_overriding_test.rb
godmin-1.2.0 test/integration/view_overriding/template_overriding_test.rb
godmin-1.1.0 test/integration/template_overriding_test.rb
godmin-1.0.0 test/integration/template_overriding_test.rb
godmin-0.12.4 test/integration/template_overriding_test.rb
godmin-0.12.3 test/integration/template_overriding_test.rb
godmin-0.12.2 test/integration/template_overriding_test.rb
godmin-0.12.1 test/integration/template_overriding_test.rb