spec/models/account_domain_spec.rb in iugusdk-1.0.0.alpha.5 vs spec/models/account_domain_spec.rb in iugusdk-1.0.0.alpha.7

- old
+ new

@@ -46,12 +46,12 @@ end end it 'should set the first verified domain as primary if the primary domain is destroyed' do @account = Fabricate(:account) - @account.account_domains << @domain1 = AccountDomain.create(:url => "url1.test.test") - @account.account_domains << @domain2 = AccountDomain.create(:url => "url2.test.test") + @account.account_domains << @domain1 = AccountDomain.create(:url => "url1.test.net") + @account.account_domains << @domain2 = AccountDomain.create(:url => "url2.test.net") @domain1.update_attribute(:verified, true) @domain2.update_attribute(:verified, true) @domain1.set_primary @domain1.destroy @domain2.reload @@ -59,20 +59,20 @@ end context "calculate_token" do it 'should return url token' do @account_domain = Fabricate(:account_domain) do - url "www.normal.host" + url "www.normal.net" end @account_domain.calculate_token.class.should == String end end context "verify" do it 'should return true for valid url' do @account_domain = Fabricate(:account_domain) do - url "www.test.net" + url "test.com" end @account_domain.verify @account_domain.verified.should be_true end @@ -84,25 +84,25 @@ @account_domain.verified.should be_false end it 'should unverify other domains with equal url' do @account_domain1 = Fabricate(:account_domain) do - url "www.test.net" + url "www.test.com" end @account_domain1.update_attribute(:verified, true) @account_domain2 = Fabricate(:account_domain) do - url "www.test.net" + url "www.test.com" end @account_domain2.verify @account_domain1.reload @account_domain1.verified.should be_false end it 'should set primary as true if its the first domain of the account' do @account = Fabricate(:account) - @account.account_domains << @domain = Fabricate(:account_domain) { url 'www.test.net' } + @account.account_domains << @domain = Fabricate(:account_domain) { url 'www.test.com' } @domain.verify @domain.reload @domain.primary.should be_true end