Sha256: 93fe7e7bf06915940dfc61eccd7ab5ee3a82f56a652583c2cc4d7935c6c0ec6f
Contents?: true
Size: 1.31 KB
Versions: 7
Compression:
Stored size: 1.31 KB
Contents
require 'spec_helper' describe "Configuration" do describe "#default_currency" do let(:existing_currency) { Money::Currency.new(:usd) } let(:new_currency) { Money::Currency.new(:inr) } it "has a default currency" do expect(EasyRailsMoney.default_currency).not_to be_nil end it "default currency is equal to money's default_currency" do expect(EasyRailsMoney.default_currency).to eq Money.default_currency end context "can set and read back the config" do before(:each) do Money.default_currency = existing_currency end it "sets default currency" do expect { EasyRailsMoney.default_currency = new_currency }. to change { Money.default_currency }. from(existing_currency). to(new_currency) end it "reads default currency" do expect { EasyRailsMoney.default_currency = new_currency }. to change { EasyRailsMoney.default_currency }. from(existing_currency). to(new_currency) end it "reads back a currency object even when a symbol is set" do expect { EasyRailsMoney.default_currency = new_currency.id }. to change { EasyRailsMoney.default_currency }. from(existing_currency). to(new_currency) end end end end
Version data entries
7 entries across 7 versions & 1 rubygems