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_templates-0.11.19 test/components/forms/submit_test.rb
express_templates-0.11.18 test/components/forms/submit_test.rb
express_templates-0.11.17 test/components/forms/submit_test.rb
express_templates-0.11.16 test/components/forms/submit_test.rb
express_templates-0.11.16.rc1 test/components/forms/submit_test.rb
express_templates-0.11.15 test/components/forms/submit_test.rb
express_templates-0.11.14 test/components/forms/submit_test.rb
express_templates-0.11.13 test/components/forms/submit_test.rb
express_templates-0.11.11 test/components/forms/submit_test.rb
express_templates-0.11.10 test/components/forms/submit_test.rb
express_templates-0.11.9 test/components/forms/submit_test.rb
express_templates-0.11.8 test/components/forms/submit_test.rb
express_templates-0.11.7 test/components/forms/submit_test.rb
express_templates-0.11.6 test/components/forms/submit_test.rb
express_templates-0.11.5 test/components/forms/submit_test.rb
express_templates-0.11.4 test/components/forms/submit_test.rb
express_admin-1.7.5 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_admin-1.7.4 vendor/gems/express_templates/express_templates/test/components/forms/submit_test.rb
express_admin-1.7.3 vendor/gems/express_templates/test/components/forms/submit_test.rb
express_admin-1.7.2 vendor/gems/express_templates/test/components/forms/submit_test.rb