Sha256: 8c59c9aff0e644fef057b080972cd1d00881271a2c5f3ae2ac0999252f85b8ec

Contents?: true

Size: 561 Bytes

Versions: 10

Compression:

Stored size: 561 Bytes

Contents

require 'spec_helper'

if defined? ActiveRecord
  describe "Test helper in form blocks" 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
        helper.text_field(:product, :price).should =~ /value=\"#{product.price.to_s}\"/
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
money-rails-1.0.0 spec/helpers/form_helper_spec.rb
money-rails-0.12.0 spec/helpers/form_helper_spec.rb
money-rails-0.11.0 spec/helpers/form_helper_spec.rb
money-rails-0.10.0 spec/helpers/form_helper_spec.rb
money-rails-0.9.0 spec/helpers/form_helper_spec.rb
money-rails-0.8.1 spec/helpers/form_helper_spec.rb
money-rails-0.7.1 spec/helpers/form_helper_spec.rb
money-rails-0.7.0 spec/helpers/form_helper_spec.rb
money-rails-0.7.0.pre1 spec/helpers/form_helper_spec.rb
stocktrade-money-rails-0.6.0 spec/helpers/form_helper_spec.rb