Sha256: 30045d0947fd0c197a62d053fef32b423215daace617ca8a4b36d8ad8a699a84

Contents?: true

Size: 926 Bytes

Versions: 9

Compression:

Stored size: 926 Bytes

Contents

require 'test_helper'

class Stuff
  def self.columns
    []
  end
end

class SubmitTest < ActiveSupport::TestCase
  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

9 entries across 9 versions & 2 rubygems

Version Path
express_templates-0.9.3 test/components/forms/submit_test.rb
express_admin-1.4.4 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_admin-1.4.3 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_templates-0.9.1 test/components/forms/submit_test.rb
express_admin-1.4.2 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_templates-0.9.0 test/components/forms/submit_test.rb
express_admin-1.4.1 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_admin-1.4.0 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_templates-0.8.0 test/components/forms/submit_test.rb