Commit 2f588addc43116429b67c54e04fd38600c206409

Authored by Leandro Santos
1 parent a7ded197

Fix ContactList unit test

Showing 1 changed file with 6 additions and 2 deletions   Show diff stats
test/unit/contact_list_test.rb
... ... @@ -7,7 +7,9 @@ class ContactListTest < ActiveSupport::TestCase
7 7 end
8 8  
9 9 should 'display list' do
10   - contact_list = ContactList.create(:list => ['email1@noosfero.org', 'email2@noosfero.org'])
  10 + contact_list = ContactList.create.tap do |c|
  11 + c.list = ['email1@noosfero.org', 'email2@noosfero.org']
  12 + end
11 13  
12 14 assert_equal ['email1@noosfero.org', 'email2@noosfero.org'], contact_list.list
13 15 end
... ... @@ -18,7 +20,9 @@ class ContactListTest < ActiveSupport::TestCase
18 20 end
19 21  
20 22 should 'return hash if contact list was fetched' do
21   - contact_list = ContactList.create(:fetched => true)
  23 + contact_list = ContactList.create.tap do |c|
  24 + c.fetched = true
  25 + end
22 26 assert_equal({"fetched" => true, "contact_list" => contact_list.id, "error" => contact_list.error_fetching}, contact_list.data)
23 27 end
24 28  
... ...