Sha256: 849bc27567487092228a1b441d5559f0eb8ad8f49c9ea6c2122102a161fca0ba

Contents?: true

Size: 569 Bytes

Versions: 9

Compression:

Stored size: 569 Bytes

Contents

require 'spec_helper'

if defined? ActiveRecord
  describe "Test helper in form blocks", type: :helper do

    let :product do
      Product.create(price_cents: 3000, discount: 150,
                     bonus_cents: 200, optional_price: 100,
                     sale_price_amount: 1200)
    end

    context "textfield" do
      it "uses the current value of money field in textfield" do
        helper.instance_variable_set :@product, product
        expect(helper.text_field(:product, :price)).to match(/value=\"#{product.price.to_s}\"/)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
money-rails-1.15.0 spec/helpers/form_helper_spec.rb
money-rails-1.14.0 spec/helpers/form_helper_spec.rb
money-rails-1.13.4 spec/helpers/form_helper_spec.rb
money-rails-1.13.3 spec/helpers/form_helper_spec.rb
money-rails-1.13.2 spec/helpers/form_helper_spec.rb
money-rails-1.13.1 spec/helpers/form_helper_spec.rb
money-rails-1.13.0 spec/helpers/form_helper_spec.rb
money-rails-1.12.0 spec/helpers/form_helper_spec.rb
money-rails-1.11.0 spec/helpers/form_helper_spec.rb