mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 23:24:48 +02:00
Merge branch 'master' into registry-790
This commit is contained in:
commit
c48cdf68b6
16 changed files with 918 additions and 56 deletions
|
@ -1,39 +0,0 @@
|
|||
require 'rails_helper'
|
||||
|
||||
describe Deposit do
|
||||
context 'with invalid attribute' do
|
||||
before :all do
|
||||
@deposit = Deposit.new
|
||||
end
|
||||
|
||||
it 'should not be valid' do
|
||||
@deposit.valid?
|
||||
@deposit.errors.full_messages.should match_array([
|
||||
"Registrar is missing"
|
||||
])
|
||||
end
|
||||
|
||||
it 'should have 0 amount' do
|
||||
@deposit.amount.should == 0
|
||||
end
|
||||
|
||||
it 'should not be presisted' do
|
||||
@deposit.persisted?.should == false
|
||||
end
|
||||
|
||||
it 'should replace comma with point for 0' do
|
||||
@deposit.amount = '0,0'
|
||||
@deposit.amount.should == 0.0
|
||||
end
|
||||
|
||||
it 'should replace comma with points' do
|
||||
@deposit.amount = '10,11'
|
||||
@deposit.amount.should == 10.11
|
||||
end
|
||||
|
||||
it 'should work with float as well' do
|
||||
@deposit.amount = 0.123
|
||||
@deposit.amount.should == 0.123
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue