Commit 8a13f248c26f67e29f8b28a36c4b437479af3e73
1 parent
9cef4d2f
Exists in
master
and in
22 other branches
ActionItem1183: better tests
Showing
1 changed file
with
6 additions
and
4 deletions
Show diff stats
test/unit/profile_test.rb
@@ -1353,13 +1353,15 @@ class ProfileTest < Test::Unit::TestCase | @@ -1353,13 +1353,15 @@ class ProfileTest < Test::Unit::TestCase | ||
1353 | end | 1353 | end |
1354 | 1354 | ||
1355 | should 'profile be valid when image is empty' do | 1355 | should 'profile be valid when image is empty' do |
1356 | - profile = Profile.create!(:name => 'Profile for testing ', :identifier => 'profilefortesting', :image_builder => {:uploaded_data => ""}) | ||
1357 | - assert_valid profile | 1356 | + profile = Profile.new(:image_builder => {:uploaded_data => ""}) |
1357 | + profile.valid? | ||
1358 | + assert_nil profile.errors[:image] | ||
1358 | end | 1359 | end |
1359 | 1360 | ||
1360 | should 'profile be valid when has no image' do | 1361 | should 'profile be valid when has no image' do |
1361 | - profile = Profile.create!(:name => 'Profile for testing ', :identifier => 'profilefortesting') | ||
1362 | - assert_valid profile | 1362 | + profile = Profile.new |
1363 | + profile.valid? | ||
1364 | + assert_nil profile.errors[:image] | ||
1363 | end | 1365 | end |
1364 | 1366 | ||
1365 | should 'copy header and footer after create a person' do | 1367 | should 'copy header and footer after create a person' do |