WhoisBody refactored to has_one

This commit is contained in:
Priit Tark 2015-04-22 16:41:52 +03:00
parent 82fd2db963
commit db81a9e7bc
6 changed files with 62 additions and 27 deletions

View file

@ -34,13 +34,9 @@ describe Domain do
@domain.versions.should == []
end
it 'should not have whois_body' do
it 'should not have whois body' do
@domain.whois_body.should == nil
end
it 'should not have whois json' do
@domain.whois_json.should == nil
end
end
context 'with valid attributes' do
@ -82,7 +78,7 @@ describe Domain do
end
it 'should have whois json by default' do
@domain.whois_json.present?.should == true
@domain.whois_body.whois_json.present?.should == true
end
it 'should have whois_body present by default' do
@ -113,7 +109,7 @@ describe Domain do
@domain.nameservers = [ns1, ns2]
@domain.update_whois_body
@domain.whois_body.should == <<-EOS
@domain.whois_body.whois_body.should == <<-EOS
Estonia .ee Top Level Domain WHOIS server
Domain: