Sha256: 1be9eea3e516ed1e20a4a43846a7f663ef548a9ae33851ac80be379175983d53

Contents?: true

Size: 967 Bytes

Versions: 51

Compression:

Stored size: 967 Bytes

Contents

require 'test_helper'

class Stuff
  def self.columns
    []
  end
end

class SubmitTest < ActiveSupport::TestCase

  def assigns
    {resource: nil}
  end
  test "submit takes string param for value" do
    fragment = -> (ctx) {
      submit value: "Save it!"
    }
    assert_match '<div class="field-wrapper"><input type="submit" name="commit" value="Save it!" /></div>',
                 arbre(&fragment)
  end
  test "submit accepts a class option" do
    fragment = -> (ctx) {
      submit class: 'button'
    }
    assert_match '<div class="field-wrapper"><input type="submit" name="commit" value="Save" class="button" /></div>',
                 arbre(&fragment)
  end
  test "submit accepts a value and class option" do
    fragment = -> (ctx) {
      submit value: 'XYZ', class: 'button'
    }
    assert_match '<div class="field-wrapper"><input type="submit" name="commit" value="XYZ" class="button" /></div>',
                 arbre(&fragment)
  end

end

Version data entries

51 entries across 51 versions & 2 rubygems

Version Path
express_admin-1.7.1 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_admin-1.6.13 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_admin-1.6.12 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_admin-1.6.11 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_admin-1.6.10 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_admin-1.6.9 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_admin-1.6.8 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_admin-1.6.7 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_templates-0.11.3 test/components/forms/submit_test.rb
express_admin-1.6.4 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_templates-0.11.2 test/components/forms/submit_test.rb
express_admin-1.6.3 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_templates-0.11.1 test/components/forms/submit_test.rb
express_admin-1.6.2 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_admin-1.6.1 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_templates-0.11.0 test/components/forms/submit_test.rb
express_admin-1.6.0 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_templates-0.10.1 test/components/forms/submit_test.rb
express_admin-1.5.0 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_admin-1.4.11 vendor/gems/express_templates/test/components/forms/submit_test.rb