Commit 78acd19cb49ab61a191ff3470fdc6d74fb0f023e

Authored by Rodrigo Souto
1 parent 6259ccff

rails3: avoiding mass-assignment on article_block tests

Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
test/unit/article_block_test.rb
@@ -109,7 +109,7 @@ class ArticleBlockTest < ActiveSupport::TestCase @@ -109,7 +109,7 @@ class ArticleBlockTest < ActiveSupport::TestCase
109 should 'display image if article is an image' do 109 should 'display image if article is an image' do
110 profile = create_user('testuser').person 110 profile = create_user('testuser').person
111 block = ArticleBlock.new 111 block = ArticleBlock.new
112 - image = UploadedFile.create!(:profile => profile, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')) 112 + image = create(UploadedFile, :profile => profile, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'))
113 113
114 block.article = image 114 block.article = image
115 block.save! 115 block.save!
@@ -123,7 +123,7 @@ class ArticleBlockTest < ActiveSupport::TestCase @@ -123,7 +123,7 @@ class ArticleBlockTest < ActiveSupport::TestCase
123 profile = create_user('testuser').person 123 profile = create_user('testuser').person
124 block = ArticleBlock.new 124 block = ArticleBlock.new
125 gallery = fast_create(Gallery, :profile_id => profile.id) 125 gallery = fast_create(Gallery, :profile_id => profile.id)
126 - image = UploadedFile.create!(:profile => profile, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :parent => gallery) 126 + image = create(UploadedFile, :profile => profile, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :parent => gallery)
127 block.article = image 127 block.article = image
128 block.save! 128 block.save!
129 129
@@ -135,7 +135,7 @@ class ArticleBlockTest < ActiveSupport::TestCase @@ -135,7 +135,7 @@ class ArticleBlockTest < ActiveSupport::TestCase
135 should 'display link to archive if article is an archive' do 135 should 'display link to archive if article is an archive' do
136 profile = create_user('testuser').person 136 profile = create_user('testuser').person
137 block = ArticleBlock.new 137 block = ArticleBlock.new
138 - file = UploadedFile.create!(:profile => profile, :uploaded_data => fixture_file_upload('/files/test.txt', 'text/plain')) 138 + file = create(UploadedFile, :profile => profile, :uploaded_data => fixture_file_upload('/files/test.txt', 'text/plain'))
139 139
140 block.article = file 140 block.article = file
141 block.save! 141 block.save!