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