Commit 970e8f5056a2aa618720a51cca6816546bf0d6cf
1 parent
d8c29128
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
add unit tests
Showing
1 changed file
with
13 additions
and
0 deletions
Show diff stats
test/unit/article_test.rb
... | ... | @@ -720,6 +720,19 @@ class ArticleTest < ActiveSupport::TestCase |
720 | 720 | assert_equal true, a.can_display_hits? |
721 | 721 | end |
722 | 722 | |
723 | + should 'have visibility_mode setting with default 0' do | |
724 | + a = fast_create(Article, :name => 'Test article', :profile_id => profile.id) | |
725 | + assert_respond_to a, :visibility_mode | |
726 | + assert_equal 0, a.visibility_mode | |
727 | + end | |
728 | + | |
729 | + should 'set visibility_mode setting value to 1' do | |
730 | + a = fast_create(Article, :name => 'Test article', :profile_id => profile.id) | |
731 | + a.visibility_mode = 1 | |
732 | + a.save && a.reload | |
733 | + assert_equal 1, a.visibility_mode | |
734 | + end | |
735 | + | |
723 | 736 | should 'return a view url when image' do |
724 | 737 | image = create(UploadedFile, :profile => profile, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')) |
725 | 738 | ... | ... |