Commit 78acd19cb49ab61a191ff3470fdc6d74fb0f023e
1 parent
6259ccff
Exists in
master
and in
27 other branches
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 | 109 | should 'display image if article is an image' do |
110 | 110 | profile = create_user('testuser').person |
111 | 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 | 114 | block.article = image |
115 | 115 | block.save! |
... | ... | @@ -123,7 +123,7 @@ class ArticleBlockTest < ActiveSupport::TestCase |
123 | 123 | profile = create_user('testuser').person |
124 | 124 | block = ArticleBlock.new |
125 | 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 | 127 | block.article = image |
128 | 128 | block.save! |
129 | 129 | |
... | ... | @@ -135,7 +135,7 @@ class ArticleBlockTest < ActiveSupport::TestCase |
135 | 135 | should 'display link to archive if article is an archive' do |
136 | 136 | profile = create_user('testuser').person |
137 | 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 | 140 | block.article = file |
141 | 141 | block.save! | ... | ... |