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.4.10 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_admin-1.4.9 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_templates-0.9.8 test/components/forms/submit_test.rb
express_admin-1.4.8 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_templates-0.9.7 test/components/forms/submit_test.rb
express_admin-1.4.7 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_templates-0.9.6 test/components/forms/submit_test.rb
express_admin-1.4.6 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_templates-0.9.5 test/components/forms/submit_test.rb
express_admin-1.4.5 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_templates-0.9.4 test/components/forms/submit_test.rb