Commit c25b36bbf8f3f0a4012a0cccaad20f7b269aca87
1 parent
f6dc326c
Exists in
master
and in
29 other branches
using a better semantic to test false results
ruby-minitest offers "refuse" as a syntatic sugar to "assert not"
Showing
152 changed files
with
746 additions
and
746 deletions
Show diff stats
plugins/breadcrumbs/test/functional/profile_design_controller_test.rb
| ... | ... | @@ -37,8 +37,8 @@ class ProfileDesignControllerTest < ActionController::TestCase |
| 37 | 37 | post :save, :id => @block.id, :profile => @profile.identifier, :block => {:title => 'breadcrumbs', :show_cms_action => false, :show_profile => false} |
| 38 | 38 | @block.reload |
| 39 | 39 | assert_equal 'breadcrumbs', @block.title |
| 40 | - assert !@block.show_profile | |
| 41 | - assert !@block.show_cms_action | |
| 40 | + refute @block.show_profile | |
| 41 | + refute @block.show_cms_action | |
| 42 | 42 | end |
| 43 | 43 | |
| 44 | 44 | should 'be able save breadcrumbs block with show_section_name option' do | ... | ... |
plugins/breadcrumbs/test/unit/breadcrumbs_plugin_test.rb
| ... | ... | @@ -7,11 +7,11 @@ class BreadcrumbsPluginTest < ActiveSupport::TestCase |
| 7 | 7 | end |
| 8 | 8 | |
| 9 | 9 | should 'has a name' do |
| 10 | - assert !BreadcrumbsPlugin.plugin_name.blank? | |
| 10 | + refute BreadcrumbsPlugin.plugin_name.blank? | |
| 11 | 11 | end |
| 12 | 12 | |
| 13 | 13 | should 'has a description' do |
| 14 | - assert !BreadcrumbsPlugin.plugin_description.blank? | |
| 14 | + refute BreadcrumbsPlugin.plugin_description.blank? | |
| 15 | 15 | end |
| 16 | 16 | |
| 17 | 17 | should 'add a block' do | ... | ... |
plugins/breadcrumbs/test/unit/content_breadcrumbs_block_test.rb
plugins/bsc/test/functional/bsc_plugin_admin_controller_test.rb
plugins/bsc/test/unit/bsc_plugin/bsc_test.rb
| ... | ... | @@ -41,7 +41,7 @@ class BscPlugin::BscTest < ActiveSupport::TestCase |
| 41 | 41 | bsc.enterprise_requests.stubs(:pending).returns([task]) |
| 42 | 42 | |
| 43 | 43 | assert bsc.already_requested?(e1) |
| 44 | - assert !bsc.already_requested?(e2) | |
| 44 | + refute bsc.already_requested?(e2) | |
| 45 | 45 | end |
| 46 | 46 | |
| 47 | 47 | should 'return associated enterprises products' do |
| ... | ... | @@ -68,7 +68,7 @@ class BscPlugin::BscTest < ActiveSupport::TestCase |
| 68 | 68 | end |
| 69 | 69 | |
| 70 | 70 | should 'not be able to create product' do |
| 71 | - assert !bsc.create_product? | |
| 71 | + refute bsc.create_product? | |
| 72 | 72 | end |
| 73 | 73 | |
| 74 | 74 | should 'have many contracts' do | ... | ... |
plugins/bsc/test/unit/bsc_plugin/contract_test.rb
| ... | ... | @@ -14,7 +14,7 @@ class BscPlugin::ContractTest < ActiveSupport::TestCase |
| 14 | 14 | |
| 15 | 15 | contract.bsc = BscPlugin::Bsc.new |
| 16 | 16 | contract.valid? |
| 17 | - assert !contract.errors.invalid?(:bsc) | |
| 17 | + refute contract.errors.invalid?(:bsc) | |
| 18 | 18 | end |
| 19 | 19 | |
| 20 | 20 | should 'associate contract with products through sales' do | ... | ... |
plugins/bsc/test/unit/bsc_plugin/sale_test.rb
| ... | ... | @@ -18,8 +18,8 @@ class BscPlugin::SaleTest < ActiveSupport::TestCase |
| 18 | 18 | sale.product = product |
| 19 | 19 | sale.contract = contract |
| 20 | 20 | |
| 21 | - assert !sale.errors.invalid?(product) | |
| 22 | - assert !sale.errors.invalid?(contract) | |
| 21 | + refute sale.errors.invalid?(product) | |
| 22 | + refute sale.errors.invalid?(contract) | |
| 23 | 23 | end |
| 24 | 24 | |
| 25 | 25 | should 'validate uniqueness of product and contract composed' do |
| ... | ... | @@ -43,7 +43,7 @@ class BscPlugin::SaleTest < ActiveSupport::TestCase |
| 43 | 43 | |
| 44 | 44 | sale.quantity = 3 |
| 45 | 45 | sale.valid? |
| 46 | - assert !sale.errors.invalid?(:quantity) | |
| 46 | + refute sale.errors.invalid?(:quantity) | |
| 47 | 47 | end |
| 48 | 48 | |
| 49 | 49 | should 'set default price as product price if no price indicated' do | ... | ... |
plugins/comment_group/test/unit/article_test.rb
| ... | ... | @@ -19,7 +19,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 19 | 19 | should 'do not allow a exclusion of a group comment macro if this group has comments' do |
| 20 | 20 | article.body = "<div class=\"macro\" data-macro-group_id=2></div>" |
| 21 | 21 | comment1 = fast_create(Comment, :group_id => 1, :source_id => article.id) |
| 22 | - assert !article.save | |
| 22 | + refute article.save | |
| 23 | 23 | assert_equal ['Not empty group comment cannot be removed'], article.errors[:base] |
| 24 | 24 | end |
| 25 | 25 | ... | ... |
plugins/comment_group/test/unit/comment_group_plugin_test.rb
plugins/community_track/test/functional/community_track_plugin_public_controller_test.rb
| ... | ... | @@ -52,7 +52,7 @@ class CommunityTrackPluginPublicControllerTest < ActionController::TestCase |
| 52 | 52 | should 'do not show more link in all tracks if there is no more tracks to show' do |
| 53 | 53 | CommunityTrackPlugin::Track.destroy_all |
| 54 | 54 | get :all_tracks, :id => @block.id |
| 55 | - assert !assigns['show_more'] | |
| 55 | + refute assigns['show_more'] | |
| 56 | 56 | assert_no_match /track_list_more_#{@block.id}/, @response.body |
| 57 | 57 | end |
| 58 | 58 | ... | ... |
plugins/community_track/test/unit/article_test.rb
| ... | ... | @@ -18,7 +18,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 18 | 18 | should 'do nothing if parent is not a step' do |
| 19 | 19 | folder = fast_create(Folder, :profile_id => @profile.id) |
| 20 | 20 | article = Article.create!(:parent => folder, :profile => @profile, :accept_comments => false, :name => "article") |
| 21 | - assert !article.accept_comments | |
| 21 | + refute article.accept_comments | |
| 22 | 22 | end |
| 23 | 23 | |
| 24 | 24 | end | ... | ... |
plugins/community_track/test/unit/community_track_plugin/step_test.rb
| ... | ... | @@ -24,20 +24,20 @@ class StepTest < ActiveSupport::TestCase |
| 24 | 24 | should 'set accept_comments to false on create' do |
| 25 | 25 | today = Date.today |
| 26 | 26 | step = CommunityTrackPlugin::Step.create(:name => 'Step', :body => 'body', :profile => @profile, :parent => @track, :start_date => today, :end_date => today, :published => true) |
| 27 | - assert !step.accept_comments | |
| 27 | + refute step.accept_comments | |
| 28 | 28 | end |
| 29 | 29 | |
| 30 | 30 | should 'do not allow step creation with a parent that is not a track' do |
| 31 | 31 | today = Date.today |
| 32 | 32 | blog = fast_create(Blog) |
| 33 | 33 | step = CommunityTrackPlugin::Step.new(:name => 'Step', :body => 'body', :profile => @profile, :parent => blog, :start_date => today, :end_date => today, :published => true) |
| 34 | - assert !step.save | |
| 34 | + refute step.save | |
| 35 | 35 | end |
| 36 | 36 | |
| 37 | 37 | should 'do not allow step creation without a parent' do |
| 38 | 38 | today = Date.today |
| 39 | 39 | step = CommunityTrackPlugin::Step.new(:name => 'Step', :body => 'body', :profile => @profile, :parent => nil, :start_date => today, :end_date => today, :published => true) |
| 40 | - assert !step.save | |
| 40 | + refute step.save | |
| 41 | 41 | end |
| 42 | 42 | |
| 43 | 43 | should 'create step if end date is equal to start date' do |
| ... | ... | @@ -55,7 +55,7 @@ class StepTest < ActiveSupport::TestCase |
| 55 | 55 | should 'do not create step if end date is before start date' do |
| 56 | 56 | @step.start_date = Date.today |
| 57 | 57 | @step.end_date = Date.today - 1.day |
| 58 | - assert !@step.save | |
| 58 | + refute @step.save | |
| 59 | 59 | end |
| 60 | 60 | |
| 61 | 61 | should 'do not validate date period if start date is nil' do |
| ... | ... | @@ -146,7 +146,7 @@ class StepTest < ActiveSupport::TestCase |
| 146 | 146 | end |
| 147 | 147 | |
| 148 | 148 | should 'set position on save' do |
| 149 | - assert !@step.position | |
| 149 | + refute @step.position | |
| 150 | 150 | @step.save! |
| 151 | 151 | assert_equal 1, @step.position |
| 152 | 152 | step2 = CommunityTrackPlugin::Step.new(:name => 'Step2', :body => 'body', :profile => @profile, :parent => @track, :published => false, :end_date => Date.today, :start_date => Date.today) |
| ... | ... | @@ -157,7 +157,7 @@ class StepTest < ActiveSupport::TestCase |
| 157 | 157 | should 'accept comments if step is active' do |
| 158 | 158 | @step.start_date = Date.today |
| 159 | 159 | @step.save! |
| 160 | - assert !@step.accept_comments | |
| 160 | + refute @step.accept_comments | |
| 161 | 161 | @step.toggle_activation |
| 162 | 162 | @step.reload |
| 163 | 163 | assert @step.accept_comments |
| ... | ... | @@ -167,10 +167,10 @@ class StepTest < ActiveSupport::TestCase |
| 167 | 167 | @step.start_date = Date.today + 2.days |
| 168 | 168 | @step.end_date = Date.today + 3.days |
| 169 | 169 | @step.save! |
| 170 | - assert !@step.published | |
| 170 | + refute @step.published | |
| 171 | 171 | @step.toggle_activation |
| 172 | 172 | @step.reload |
| 173 | - assert !@step.published | |
| 173 | + refute @step.published | |
| 174 | 174 | end |
| 175 | 175 | |
| 176 | 176 | should 'do not accept comments if step is not active anymore' do |
| ... | ... | @@ -185,7 +185,7 @@ class StepTest < ActiveSupport::TestCase |
| 185 | 185 | @step.save! |
| 186 | 186 | @step.toggle_activation |
| 187 | 187 | @step.reload |
| 188 | - assert !@step.accept_comments | |
| 188 | + refute @step.accept_comments | |
| 189 | 189 | end |
| 190 | 190 | |
| 191 | 191 | should 'set position to zero if step is hidden' do |
| ... | ... | @@ -228,10 +228,10 @@ class StepTest < ActiveSupport::TestCase |
| 228 | 228 | @step.start_date = Date.today |
| 229 | 229 | @step.hidden = true |
| 230 | 230 | @step.save! |
| 231 | - assert !@step.published | |
| 231 | + refute @step.published | |
| 232 | 232 | @step.toggle_activation |
| 233 | 233 | @step.reload |
| 234 | - assert !@step.published | |
| 234 | + refute @step.published | |
| 235 | 235 | end |
| 236 | 236 | |
| 237 | 237 | should 'return enabled tools for a step' do |
| ... | ... | @@ -268,9 +268,9 @@ class StepTest < ActiveSupport::TestCase |
| 268 | 268 | should 'enable comments on children when step is activated' do |
| 269 | 269 | @step.start_date = Date.today |
| 270 | 270 | @step.save! |
| 271 | - assert !@step.accept_comments | |
| 271 | + refute @step.accept_comments | |
| 272 | 272 | article = fast_create(Article, :parent_id => @step.id, :profile_id => @step.profile.id, :accept_comments => false) |
| 273 | - assert !article.accept_comments | |
| 273 | + refute article.accept_comments | |
| 274 | 274 | @step.toggle_activation |
| 275 | 275 | assert article.reload.accept_comments |
| 276 | 276 | end |
| ... | ... | @@ -279,7 +279,7 @@ class StepTest < ActiveSupport::TestCase |
| 279 | 279 | @step.start_date = Date.today |
| 280 | 280 | @step.start_date = Date.today |
| 281 | 281 | @step.save! |
| 282 | - assert !@step.accept_comments | |
| 282 | + refute @step.accept_comments | |
| 283 | 283 | @step.toggle_activation |
| 284 | 284 | article = Article.create!(:parent => @step, :profile => @step.profile, :accept_comments => false, :name => "article") |
| 285 | 285 | assert article.reload.accept_comments | ... | ... |
plugins/community_track/test/unit/community_track_plugin/track_list_block_test.rb
| ... | ... | @@ -20,7 +20,7 @@ class TrackListBlockTest < ActiveSupport::TestCase |
| 20 | 20 | end |
| 21 | 21 | |
| 22 | 22 | should 'load more at another page default to false' do |
| 23 | - assert !@block.more_another_page | |
| 23 | + refute @block.more_another_page | |
| 24 | 24 | end |
| 25 | 25 | |
| 26 | 26 | should 'list articles only of track type' do |
| ... | ... | @@ -41,7 +41,7 @@ class TrackListBlockTest < ActiveSupport::TestCase |
| 41 | 41 | |
| 42 | 42 | should 'do not return more link if there is no more tracks to show' do |
| 43 | 43 | (@block.limit-1).times { |i| create_track("track#{i}", profile) } |
| 44 | - assert !@block.footer | |
| 44 | + refute @block.footer | |
| 45 | 45 | end |
| 46 | 46 | |
| 47 | 47 | should 'count all tracks' do |
| ... | ... | @@ -58,7 +58,7 @@ class TrackListBlockTest < ActiveSupport::TestCase |
| 58 | 58 | @block.owner.articles.destroy_all |
| 59 | 59 | (@block.limit+1).times { |i| create_track("track#{i}", profile) } |
| 60 | 60 | assert @block.has_page?(2) |
| 61 | - assert !@block.has_page?(3) | |
| 61 | + refute @block.has_page?(3) | |
| 62 | 62 | end |
| 63 | 63 | |
| 64 | 64 | should 'filter tracks by category' do |
| ... | ... | @@ -95,8 +95,8 @@ class TrackListBlockTest < ActiveSupport::TestCase |
| 95 | 95 | |
| 96 | 96 | should 'define expiration condition' do |
| 97 | 97 | condition = CommunityTrackPlugin::TrackListBlock.expire_on |
| 98 | - assert !condition[:profile].empty? | |
| 99 | - assert !condition[:environment].empty? | |
| 98 | + refute condition[:profile].empty? | |
| 99 | + refute condition[:environment].empty? | |
| 100 | 100 | end |
| 101 | 101 | |
| 102 | 102 | should 'return track list block categories' do | ... | ... |
plugins/community_track/test/unit/community_track_plugin_test.rb
| ... | ... | @@ -74,8 +74,8 @@ class CommunityTrackPluginTest < ActiveSupport::TestCase |
| 74 | 74 | end |
| 75 | 75 | |
| 76 | 76 | should 'return false at content_remove_new if page is not a track' do |
| 77 | - assert !@plugin.content_remove_new(CommunityTrackPlugin::Step.new) | |
| 78 | - assert !@plugin.content_remove_new(Article.new) | |
| 77 | + refute @plugin.content_remove_new(CommunityTrackPlugin::Step.new) | |
| 78 | + refute @plugin.content_remove_new(Article.new) | |
| 79 | 79 | end |
| 80 | 80 | |
| 81 | 81 | end | ... | ... |
plugins/container_block/test/unit/container_block_plugin/container_block_test.rb
| ... | ... | @@ -8,11 +8,11 @@ class ContainerBlockPlugin::ContainerBlockTest < ActiveSupport::TestCase |
| 8 | 8 | end |
| 9 | 9 | |
| 10 | 10 | should 'describe yourself' do |
| 11 | - assert !ContainerBlockPlugin::ContainerBlock.description.blank? | |
| 11 | + refute ContainerBlockPlugin::ContainerBlock.description.blank? | |
| 12 | 12 | end |
| 13 | 13 | |
| 14 | 14 | should 'has a help' do |
| 15 | - assert !@block.help.blank? | |
| 15 | + refute @block.help.blank? | |
| 16 | 16 | end |
| 17 | 17 | |
| 18 | 18 | should 'create a box on save' do |
| ... | ... | @@ -84,7 +84,7 @@ class ContainerBlockPlugin::ContainerBlockTest < ActiveSupport::TestCase |
| 84 | 84 | @block.save! |
| 85 | 85 | child = Block.create!(:box_id => @block.container_box.id) |
| 86 | 86 | @block.destroy |
| 87 | - assert !Block.exists?(child.id) | |
| 87 | + refute Block.exists?(child.id) | |
| 88 | 88 | end |
| 89 | 89 | |
| 90 | 90 | should 'destroy box when container is removed' do | ... | ... |
plugins/container_block/test/unit/container_block_plugin_test.rb
| ... | ... | @@ -7,11 +7,11 @@ class ContainerBlockPluginTest < ActiveSupport::TestCase |
| 7 | 7 | end |
| 8 | 8 | |
| 9 | 9 | should 'has a name' do |
| 10 | - assert !ContainerBlockPlugin.plugin_name.blank? | |
| 10 | + refute ContainerBlockPlugin.plugin_name.blank? | |
| 11 | 11 | end |
| 12 | 12 | |
| 13 | 13 | should 'has a description' do |
| 14 | - assert !ContainerBlockPlugin.plugin_description.blank? | |
| 14 | + refute ContainerBlockPlugin.plugin_description.blank? | |
| 15 | 15 | end |
| 16 | 16 | |
| 17 | 17 | should 'add a block' do | ... | ... |
plugins/context_content/test/functional/profile_design_controller_test.rb
| ... | ... | @@ -47,7 +47,7 @@ class ProfileDesignControllerTest < ActionController::TestCase |
| 47 | 47 | post :save, :id => @block.id, :block => {:title => 'context', :show_image => '0', :show_name => '0', :show_parent_content => '0', :types => ['TinyMceArticle', '', nil, 'Folder'] }, :profile => @profile.identifier |
| 48 | 48 | @block.reload |
| 49 | 49 | assert_equal 'context', @block.title |
| 50 | - assert !@block.show_image && !@block.show_name && !@block.show_parent_content | |
| 50 | + refute @block.show_image && !@block.show_name && !@block.show_parent_content | |
| 51 | 51 | assert_equal ['TinyMceArticle', 'Folder'], @block.types |
| 52 | 52 | end |
| 53 | 53 | ... | ... |
plugins/context_content/test/unit/context_content_block_test.rb
plugins/custom_forms/test/functional/custom_forms_plugin_myprofile_controller_test.rb
| ... | ... | @@ -34,7 +34,7 @@ class CustomFormsPluginMyprofileControllerTest < ActionController::TestCase |
| 34 | 34 | form = CustomFormsPlugin::Form.create!(:profile => profile, :name => 'Free Software') |
| 35 | 35 | assert CustomFormsPlugin::Form.exists?(form.id) |
| 36 | 36 | post :remove, :profile => profile.identifier, :id => form.id |
| 37 | - assert !CustomFormsPlugin::Form.exists?(form.id) | |
| 37 | + refute CustomFormsPlugin::Form.exists?(form.id) | |
| 38 | 38 | end |
| 39 | 39 | |
| 40 | 40 | should 'create a form' do | ... | ... |
plugins/custom_forms/test/functional/custom_forms_plugin_profile_controller_test.rb
| ... | ... | @@ -25,7 +25,7 @@ class CustomFormsPluginProfileControllerTest < ActionController::TestCase |
| 25 | 25 | assert_difference 'CustomFormsPlugin::Submission.count', 1 do |
| 26 | 26 | post :show, :profile => profile.identifier, :id => form.id, :submission => {field1.id.to_s => 'Noosfero', field2.id.to_s => 'GPL'} |
| 27 | 27 | end |
| 28 | - assert !session[:notice].include?('not saved') | |
| 28 | + refute session[:notice].include?('not saved') | |
| 29 | 29 | assert_redirected_to :action => 'show' |
| 30 | 30 | end |
| 31 | 31 | ... | ... |
plugins/custom_forms/test/unit/custom_forms_plugin/answer_test.rb
| ... | ... | @@ -10,7 +10,7 @@ class CustomFormsPlugin::AnswerTest < ActiveSupport::TestCase |
| 10 | 10 | field = CustomFormsPlugin::Field.create!(:name => 'License', :form => form) |
| 11 | 11 | answer.field = field |
| 12 | 12 | answer.valid? |
| 13 | - assert !answer.errors.include?(:field) | |
| 13 | + refute answer.errors.include?(:field) | |
| 14 | 14 | end |
| 15 | 15 | |
| 16 | 16 | should 'belong to a submission' do |
| ... | ... | @@ -31,7 +31,7 @@ class CustomFormsPlugin::AnswerTest < ActiveSupport::TestCase |
| 31 | 31 | |
| 32 | 32 | answer.value = "GPL" |
| 33 | 33 | answer.valid? |
| 34 | - assert !answer.errors.include?(:value) | |
| 34 | + refute answer.errors.include?(:value) | |
| 35 | 35 | end |
| 36 | 36 | |
| 37 | 37 | should 'make string representation show answers' do | ... | ... |
plugins/custom_forms/test/unit/custom_forms_plugin/field_test.rb
| ... | ... | @@ -9,7 +9,7 @@ class CustomFormsPlugin::FieldTest < ActiveSupport::TestCase |
| 9 | 9 | |
| 10 | 10 | should 'set mandatory field as false by default' do |
| 11 | 11 | field = CustomFormsPlugin::Field.new |
| 12 | - assert !field.mandatory | |
| 12 | + refute field.mandatory | |
| 13 | 13 | end |
| 14 | 14 | |
| 15 | 15 | should 'have answers' do |
| ... | ... | @@ -47,7 +47,7 @@ class CustomFormsPlugin::FieldTest < ActiveSupport::TestCase |
| 47 | 47 | |
| 48 | 48 | should 'have alternative if type is SelectField' do |
| 49 | 49 | select = CustomFormsPlugin::Field.new(:name => 'select_field001', :type => 'CustomFormsPlugin::SelectField') |
| 50 | - assert !select.save | |
| 50 | + refute select.save | |
| 51 | 51 | |
| 52 | 52 | select.alternatives << CustomFormsPlugin::Alternative.new(:label => 'option') |
| 53 | 53 | assert select.save | ... | ... |
plugins/custom_forms/test/unit/custom_forms_plugin/form_test.rb
| ... | ... | @@ -10,8 +10,8 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase |
| 10 | 10 | form.profile = fast_create(Profile) |
| 11 | 11 | form.name = 'Free Software' |
| 12 | 12 | form.valid? |
| 13 | - assert !form.errors.include?(:profile) | |
| 14 | - assert !form.errors.include?(:name) | |
| 13 | + refute form.errors.include?(:profile) | |
| 14 | + refute form.errors.include?(:name) | |
| 15 | 15 | end |
| 16 | 16 | |
| 17 | 17 | should 'have many fields including fields subclasses' do |
| ... | ... | @@ -50,7 +50,7 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase |
| 50 | 50 | |
| 51 | 51 | form.profile = another_profile |
| 52 | 52 | form.valid? |
| 53 | - assert !form.errors.include?(:slug) | |
| 53 | + refute form.errors.include?(:slug) | |
| 54 | 54 | end |
| 55 | 55 | |
| 56 | 56 | should 'validate the difference between ending and beginning is positive' do |
| ... | ... | @@ -60,55 +60,55 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase |
| 60 | 60 | form.begining = Time.now |
| 61 | 61 | form.ending = Time.now + 1.day |
| 62 | 62 | assert form.valid? |
| 63 | - assert !form.errors.include?(:base) | |
| 63 | + refute form.errors.include?(:base) | |
| 64 | 64 | |
| 65 | 65 | form.ending = Time.now - 2.day |
| 66 | - assert !form.valid? | |
| 66 | + refute form.valid? | |
| 67 | 67 | assert form.errors.include?(:base) |
| 68 | 68 | end |
| 69 | 69 | |
| 70 | 70 | should 'define form expiration' do |
| 71 | 71 | form = CustomFormsPlugin::Form.new |
| 72 | - assert !form.expired? | |
| 72 | + refute form.expired? | |
| 73 | 73 | |
| 74 | 74 | form.begining = Time.now + 1.day |
| 75 | 75 | assert form.expired? |
| 76 | 76 | |
| 77 | 77 | form.begining = Time.now - 1.day |
| 78 | - assert !form.expired? | |
| 78 | + refute form.expired? | |
| 79 | 79 | |
| 80 | 80 | form.begining = nil |
| 81 | 81 | form.ending = Time.now + 1.day |
| 82 | - assert !form.expired? | |
| 82 | + refute form.expired? | |
| 83 | 83 | |
| 84 | 84 | form.ending = Time.now - 1.day |
| 85 | 85 | assert form.expired? |
| 86 | 86 | |
| 87 | 87 | form.begining = Time.now - 1.day |
| 88 | 88 | form.ending = Time.now + 1.day |
| 89 | - assert !form.expired? | |
| 89 | + refute form.expired? | |
| 90 | 90 | end |
| 91 | 91 | |
| 92 | 92 | should 'define if form will still open' do |
| 93 | 93 | form = CustomFormsPlugin::Form.new |
| 94 | - assert !form.will_open? | |
| 94 | + refute form.will_open? | |
| 95 | 95 | |
| 96 | 96 | form.begining = Time.now + 1.day |
| 97 | 97 | assert form.will_open? |
| 98 | 98 | |
| 99 | 99 | form.begining = Time.now - 1.day |
| 100 | - assert !form.will_open? | |
| 100 | + refute form.will_open? | |
| 101 | 101 | |
| 102 | 102 | form.begining = Time.now - 2.day |
| 103 | 103 | form.ending = Time.now - 1.day |
| 104 | 104 | assert form.expired? |
| 105 | - assert !form.will_open? | |
| 105 | + refute form.will_open? | |
| 106 | 106 | end |
| 107 | 107 | |
| 108 | 108 | should 'validates format of access' do |
| 109 | 109 | form = CustomFormsPlugin::Form.new |
| 110 | 110 | form.valid? |
| 111 | - assert !form.errors.include?(:access) | |
| 111 | + refute form.errors.include?(:access) | |
| 112 | 112 | |
| 113 | 113 | form.access = 'bli' |
| 114 | 114 | form.valid? |
| ... | ... | @@ -116,11 +116,11 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase |
| 116 | 116 | |
| 117 | 117 | form.access = 'logged' |
| 118 | 118 | form.valid? |
| 119 | - assert !form.errors.include?(:access) | |
| 119 | + refute form.errors.include?(:access) | |
| 120 | 120 | |
| 121 | 121 | form.access = 'associated' |
| 122 | 122 | form.valid? |
| 123 | - assert !form.errors.include?(:access) | |
| 123 | + refute form.errors.include?(:access) | |
| 124 | 124 | |
| 125 | 125 | form.access = {:bli => 1} |
| 126 | 126 | form.valid? |
| ... | ... | @@ -133,13 +133,13 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase |
| 133 | 133 | p1 = fast_create(Profile) |
| 134 | 134 | form.access = p1.id |
| 135 | 135 | form.valid? |
| 136 | - assert !form.errors.include?(:access) | |
| 136 | + refute form.errors.include?(:access) | |
| 137 | 137 | |
| 138 | 138 | p2 = fast_create(Profile) |
| 139 | 139 | p3 = fast_create(Profile) |
| 140 | 140 | form.access = [p1,p2,p3].map(&:id) |
| 141 | 141 | form.valid? |
| 142 | - assert !form.errors.include?(:access) | |
| 142 | + refute form.errors.include?(:access) | |
| 143 | 143 | end |
| 144 | 144 | |
| 145 | 145 | should 'defines who is able to access the form' do |
| ... | ... | @@ -148,25 +148,25 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase |
| 148 | 148 | assert form.accessible_to(nil) |
| 149 | 149 | |
| 150 | 150 | form.access = 'logged' |
| 151 | - assert !form.accessible_to(nil) | |
| 151 | + refute form.accessible_to(nil) | |
| 152 | 152 | person = fast_create(Person) |
| 153 | 153 | assert form.accessible_to(person) |
| 154 | 154 | |
| 155 | 155 | form.access = 'associated' |
| 156 | - assert !form.accessible_to(person) | |
| 156 | + refute form.accessible_to(person) | |
| 157 | 157 | owner.add_member(person) |
| 158 | 158 | assert form.accessible_to(person) |
| 159 | 159 | |
| 160 | 160 | p1 = fast_create(Profile) |
| 161 | 161 | form.access = p1.id |
| 162 | - assert !form.accessible_to(person) | |
| 162 | + refute form.accessible_to(person) | |
| 163 | 163 | assert form.accessible_to(p1) |
| 164 | 164 | |
| 165 | 165 | p2 = fast_create(Profile) |
| 166 | 166 | form.access = [person.id, p1.id] |
| 167 | 167 | assert form.accessible_to(person) |
| 168 | 168 | assert form.accessible_to(p1) |
| 169 | - assert !form.accessible_to(p2) | |
| 169 | + refute form.accessible_to(p2) | |
| 170 | 170 | form.access << p2.id |
| 171 | 171 | assert form.accessible_to(p2) |
| 172 | 172 | ... | ... |
plugins/custom_forms/test/unit/custom_forms_plugin/membership_survey_test.rb
| ... | ... | @@ -8,7 +8,7 @@ class CustomFormsPlugin::MembershipSurveyTest < ActiveSupport::TestCase |
| 8 | 8 | |
| 9 | 9 | task.form_id = 1 |
| 10 | 10 | task.valid? |
| 11 | - assert !task.errors.include?(:form_id) | |
| 11 | + refute task.errors.include?(:form_id) | |
| 12 | 12 | end |
| 13 | 13 | |
| 14 | 14 | should 'create submission with answers on perform' do | ... | ... |
plugins/custom_forms/test/unit/custom_forms_plugin/select_field_test.rb
| ... | ... | @@ -3,7 +3,7 @@ require File.dirname(__FILE__) + '/../../../../../test/test_helper' |
| 3 | 3 | class CustomFormsPlugin::SelectFieldTest < ActiveSupport::TestCase |
| 4 | 4 | should 'have alternative' do |
| 5 | 5 | select = CustomFormsPlugin::SelectField.new(:name => 'select_field001' ) |
| 6 | - assert !select.save | |
| 6 | + refute select.save | |
| 7 | 7 | |
| 8 | 8 | select.alternatives << CustomFormsPlugin::Alternative.new(:label => 'option') |
| 9 | 9 | assert select.save | ... | ... |
plugins/custom_forms/test/unit/custom_forms_plugin/submission_test.rb
| ... | ... | @@ -14,7 +14,7 @@ class CustomFormsPlugin::SubmissionTest < ActiveSupport::TestCase |
| 14 | 14 | form = CustomFormsPlugin::Form.create!(:name => 'Free Software', :profile => profile) |
| 15 | 15 | submission.form = form |
| 16 | 16 | submission.valid? |
| 17 | - assert !submission.errors.include?(:form) | |
| 17 | + refute submission.errors.include?(:form) | |
| 18 | 18 | end |
| 19 | 19 | |
| 20 | 20 | should 'belong to a profile' do |
| ... | ... | @@ -32,8 +32,8 @@ class CustomFormsPlugin::SubmissionTest < ActiveSupport::TestCase |
| 32 | 32 | submission.author_name = 'Jack Sparrow' |
| 33 | 33 | submission.author_email = 'jack@black-pearl.com' |
| 34 | 34 | submission.valid? |
| 35 | - assert !submission.errors.include?(:author_name) | |
| 36 | - assert !submission.errors.include?(:author_email) | |
| 35 | + refute submission.errors.include?(:author_name) | |
| 36 | + refute submission.errors.include?(:author_email) | |
| 37 | 37 | end |
| 38 | 38 | |
| 39 | 39 | should 'have answers' do | ... | ... |
plugins/custom_forms/test/unit/ext/role_assingment_test.rb
| ... | ... | @@ -67,6 +67,6 @@ class RoleAssignmentsTest < ActiveSupport::TestCase |
| 67 | 67 | assert_difference 'CustomFormsPlugin::AdmissionSurvey.count', 2 do |
| 68 | 68 | organization.add_member(person) |
| 69 | 69 | end |
| 70 | - assert !organization.members.include?(person) | |
| 70 | + refute organization.members.include?(person) | |
| 71 | 71 | end |
| 72 | 72 | end | ... | ... |
plugins/event/test/unit/event_block_test.rb
| ... | ... | @@ -169,11 +169,11 @@ class EventBlockTest < ActiveSupport::TestCase |
| 169 | 169 | @block.all_env_events = true |
| 170 | 170 | |
| 171 | 171 | # Do not list event from private profile for non logged visitor |
| 172 | - assert ! @block.events.include?(ev) | |
| 172 | + refute @block.events.include?(ev) | |
| 173 | 173 | assert_equal 4, @block.events.length |
| 174 | 174 | |
| 175 | 175 | # Do not list event from private profile for non unprivileged user |
| 176 | - assert ! @block.events.include?(ev) | |
| 176 | + refute @block.events.include?(ev) | |
| 177 | 177 | assert_equal 4, @block.events(@p1).length |
| 178 | 178 | |
| 179 | 179 | # Must to list event from private profile for a friend | ... | ... |
plugins/lattes_curriculum/test/unit/academic_info_test.rb
| ... | ... | @@ -8,7 +8,7 @@ class AcademicInfoTest < ActiveSupport::TestCase |
| 8 | 8 | |
| 9 | 9 | should 'not ve invalid lattes url' do |
| 10 | 10 | @academic_info.lattes_url = "http://softwarelivre.org/" |
| 11 | - assert !@academic_info.save | |
| 11 | + refute @academic_info.save | |
| 12 | 12 | end |
| 13 | 13 | |
| 14 | 14 | should 'accept blank lattes url' do | ... | ... |
plugins/ldap/test/unit/ext/environment_test.rb
| ... | ... | @@ -130,7 +130,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 130 | 130 | should 'ldap_plugin_onthefly_register return false if ldap onthefly_register variable is defined as false' do |
| 131 | 131 | value = '0' |
| 132 | 132 | @enviroment.ldap_plugin_onthefly_register= value |
| 133 | - assert !@enviroment.ldap_plugin_onthefly_register | |
| 133 | + refute @enviroment.ldap_plugin_onthefly_register | |
| 134 | 134 | end |
| 135 | 135 | |
| 136 | 136 | should 'ldap_plugin_filter= define the ldap filter' do |
| ... | ... | @@ -160,7 +160,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 160 | 160 | should 'tls return false if ldap tls variable is defined as false' do |
| 161 | 161 | value = '0' |
| 162 | 162 | @enviroment.ldap_plugin_tls= value |
| 163 | - assert !@enviroment.ldap_plugin_tls | |
| 163 | + refute @enviroment.ldap_plugin_tls | |
| 164 | 164 | end |
| 165 | 165 | |
| 166 | 166 | should 'validates presence of host' do |
| ... | ... | @@ -171,12 +171,12 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 171 | 171 | |
| 172 | 172 | @enviroment.ldap_plugin_host= "http://somehost.com" |
| 173 | 173 | @enviroment.valid? |
| 174 | - assert !@enviroment.errors.include?(:ldap_plugin_host) | |
| 174 | + refute @enviroment.errors.include?(:ldap_plugin_host) | |
| 175 | 175 | end |
| 176 | 176 | |
| 177 | 177 | should 'validates presence of host only if some ldap configuration is defined' do |
| 178 | 178 | @enviroment.valid? |
| 179 | - assert !@enviroment.errors.include?(:ldap_plugin_host) | |
| 179 | + refute @enviroment.errors.include?(:ldap_plugin_host) | |
| 180 | 180 | |
| 181 | 181 | @enviroment.ldap_plugin= {:port => 3000} |
| 182 | 182 | @enviroment.valid? | ... | ... |
plugins/ldap/test/unit/ldap_authentication_test.rb
| ... | ... | @@ -96,7 +96,7 @@ class LdapAuthenticationTest < ActiveSupport::TestCase |
| 96 | 96 | |
| 97 | 97 | should "onthefly_register be false as default" do |
| 98 | 98 | ldap = LdapAuthentication.new |
| 99 | - assert !ldap.onthefly_register | |
| 99 | + refute ldap.onthefly_register | |
| 100 | 100 | end |
| 101 | 101 | |
| 102 | 102 | should "create with onthefly_register passed as parameter" do |
| ... | ... | @@ -118,7 +118,7 @@ class LdapAuthenticationTest < ActiveSupport::TestCase |
| 118 | 118 | |
| 119 | 119 | should "tls be false as default" do |
| 120 | 120 | ldap = LdapAuthentication.new |
| 121 | - assert !ldap.tls | |
| 121 | + refute ldap.tls | |
| 122 | 122 | end |
| 123 | 123 | |
| 124 | 124 | should "create with tls passed as parameter" do |
| ... | ... | @@ -134,7 +134,7 @@ class LdapAuthenticationTest < ActiveSupport::TestCase |
| 134 | 134 | |
| 135 | 135 | should "onthefly_register? return false if onthefly_register is false" do |
| 136 | 136 | ldap = LdapAuthentication.new('onthefly_register' => false) |
| 137 | - assert !ldap.onthefly_register? | |
| 137 | + refute ldap.onthefly_register? | |
| 138 | 138 | end |
| 139 | 139 | |
| 140 | 140 | if ldap_configured? | ... | ... |
plugins/ldap/test/unit/ldap_plugin_test.rb
| ... | ... | @@ -4,12 +4,12 @@ class LdapPluginTest < ActiveSupport::TestCase |
| 4 | 4 | |
| 5 | 5 | should "not allow user registration" do |
| 6 | 6 | plugin = LdapPlugin.new |
| 7 | - assert !plugin.allow_user_registration | |
| 7 | + refute plugin.allow_user_registration | |
| 8 | 8 | end |
| 9 | 9 | |
| 10 | 10 | should "not allow password recovery" do |
| 11 | 11 | plugin = LdapPlugin.new |
| 12 | - assert !plugin.allow_password_recovery | |
| 12 | + refute plugin.allow_password_recovery | |
| 13 | 13 | end |
| 14 | 14 | |
| 15 | 15 | end | ... | ... |
plugins/mark_comment_as_read/test/unit/mark_comment_as_read_plugin/comment_test.rb
| ... | ... | @@ -9,7 +9,7 @@ class MarkCommentAsReadPlugin::CommentTest < ActiveSupport::TestCase |
| 9 | 9 | end |
| 10 | 10 | |
| 11 | 11 | should 'mark comment as read' do |
| 12 | - assert !@comment.marked_as_read?(@person) | |
| 12 | + refute @comment.marked_as_read?(@person) | |
| 13 | 13 | @comment.mark_as_read(@person) |
| 14 | 14 | assert @comment.marked_as_read?(@person) |
| 15 | 15 | end |
| ... | ... | @@ -25,7 +25,7 @@ class MarkCommentAsReadPlugin::CommentTest < ActiveSupport::TestCase |
| 25 | 25 | @comment.mark_as_read(@person) |
| 26 | 26 | assert @comment.marked_as_read?(@person) |
| 27 | 27 | @comment.mark_as_not_read(@person) |
| 28 | - assert !@comment.marked_as_read?(@person) | |
| 28 | + refute @comment.marked_as_read?(@person) | |
| 29 | 29 | end |
| 30 | 30 | |
| 31 | 31 | should 'return comments marked as read for a user' do | ... | ... |
plugins/mark_comment_as_read/test/unit/mark_comment_as_read_test.rb
| ... | ... | @@ -26,7 +26,7 @@ class MarkCommentAsReadPluginTest < ActiveSupport::TestCase |
| 26 | 26 | self.stubs(:user).returns(nil) |
| 27 | 27 | action = @plugin.comment_actions(@comment) |
| 28 | 28 | link = self.instance_eval(&action) |
| 29 | - assert !link | |
| 29 | + refute link | |
| 30 | 30 | end |
| 31 | 31 | |
| 32 | 32 | should 'return actions when comment is not read' do |
| ... | ... | @@ -46,7 +46,7 @@ class MarkCommentAsReadPluginTest < ActiveSupport::TestCase |
| 46 | 46 | self.stubs(:user).returns(nil) |
| 47 | 47 | action = @plugin.check_comment_actions(@comment) |
| 48 | 48 | id = self.instance_eval(&action) |
| 49 | - assert !id | |
| 49 | + refute id | |
| 50 | 50 | end |
| 51 | 51 | |
| 52 | 52 | should 'return id of mark as not read link when comment is read' do |
| ... | ... | @@ -70,14 +70,14 @@ class MarkCommentAsReadPluginTest < ActiveSupport::TestCase |
| 70 | 70 | |
| 71 | 71 | should 'do not return extra content if comment is not marked as read' do |
| 72 | 72 | content = @plugin.article_extra_contents(@article) |
| 73 | - assert !self.instance_eval(&content) | |
| 73 | + refute self.instance_eval(&content) | |
| 74 | 74 | end |
| 75 | 75 | |
| 76 | 76 | should 'do not return extra content if user is not logged in' do |
| 77 | 77 | @comment.mark_as_read(@person) |
| 78 | 78 | self.stubs(:user).returns(nil) |
| 79 | 79 | content = @plugin.article_extra_contents(@article) |
| 80 | - assert !self.instance_eval(&content) | |
| 80 | + refute self.instance_eval(&content) | |
| 81 | 81 | end |
| 82 | 82 | |
| 83 | 83 | def link_to_function(content, url, options = {}) | ... | ... |
plugins/oauth_client/test/unit/user_test.rb
| ... | ... | @@ -24,12 +24,12 @@ class UserTest < ActiveSupport::TestCase |
| 24 | 24 | |
| 25 | 25 | should 'not activate user when created without oauth' do |
| 26 | 26 | user = fast_create(User) |
| 27 | - assert !user.activated? | |
| 27 | + refute user.activated? | |
| 28 | 28 | end |
| 29 | 29 | |
| 30 | 30 | should 'not make activation code when created with oauth' do |
| 31 | 31 | user = User.create!(:email => 'testoauth@example.com', :login => 'testoauth', :oauth_providers => [provider]) |
| 32 | - assert !user.activation_code | |
| 32 | + refute user.activation_code | |
| 33 | 33 | end |
| 34 | 34 | |
| 35 | 35 | should 'make activation code when created without oauth' do | ... | ... |
plugins/people_block/test/unit/people_block_plugin_test.rb
| ... | ... | @@ -15,7 +15,7 @@ class PeopleBlockPluginTest < ActiveSupport::TestCase |
| 15 | 15 | end |
| 16 | 16 | |
| 17 | 17 | should "return false for class method has_admin_url?" do |
| 18 | - assert !PeopleBlockPlugin.has_admin_url? | |
| 18 | + refute PeopleBlockPlugin.has_admin_url? | |
| 19 | 19 | end |
| 20 | 20 | |
| 21 | 21 | should "return false for class method stylesheet?" do | ... | ... |
plugins/recent_content/test/unit/recent_content_block_test.rb
| ... | ... | @@ -15,7 +15,7 @@ class RecentContentBlockTest < ActiveSupport::TestCase |
| 15 | 15 | |
| 16 | 16 | should 'blog_picture be false by default' do |
| 17 | 17 | block = RecentContentBlock.new |
| 18 | - assert !block.show_blog_picture | |
| 18 | + refute block.show_blog_picture | |
| 19 | 19 | end |
| 20 | 20 | |
| 21 | 21 | should 'blog_picture is being stored and restored from database as true' do |
| ... | ... | @@ -33,7 +33,7 @@ class RecentContentBlockTest < ActiveSupport::TestCase |
| 33 | 33 | block.save |
| 34 | 34 | block.reload |
| 35 | 35 | |
| 36 | - assert !block.show_blog_picture | |
| 36 | + refute block.show_blog_picture | |
| 37 | 37 | end |
| 38 | 38 | |
| 39 | 39 | should 'root be nil for new blocks' do | ... | ... |
plugins/require_auth_to_comment/test/unit/require_auth_to_comment_plugin_test.rb
| ... | ... | @@ -19,7 +19,7 @@ class RequireAuthToCommentPluginTest < ActiveSupport::TestCase |
| 19 | 19 | should 'allow comments from authenticated users' do |
| 20 | 20 | plugin.context = logged_in(true) |
| 21 | 21 | plugin.filter_comment(comment) |
| 22 | - assert !comment.rejected? | |
| 22 | + refute comment.rejected? | |
| 23 | 23 | end |
| 24 | 24 | |
| 25 | 25 | should 'allow comments from unauthenticated users if allowed by profile' do |
| ... | ... | @@ -27,7 +27,7 @@ class RequireAuthToCommentPluginTest < ActiveSupport::TestCase |
| 27 | 27 | plugin.context.profile.allow_unauthenticated_comments = true |
| 28 | 28 | |
| 29 | 29 | plugin.filter_comment(comment) |
| 30 | - assert !comment.rejected? | |
| 30 | + refute comment.rejected? | |
| 31 | 31 | end |
| 32 | 32 | |
| 33 | 33 | should 'the default require type setting be hide_button' do |
| ... | ... | @@ -38,7 +38,7 @@ class RequireAuthToCommentPluginTest < ActiveSupport::TestCase |
| 38 | 38 | context = mock(); |
| 39 | 39 | context.expects(:environment).returns(environment) |
| 40 | 40 | plugin.expects(:context).returns(context) |
| 41 | - assert !plugin.display_login_popup? | |
| 41 | + refute plugin.display_login_popup? | |
| 42 | 42 | end |
| 43 | 43 | |
| 44 | 44 | should 'display_login_popup? be true if require_type is defined as display_login_popup' do |
| ... | ... | @@ -51,7 +51,7 @@ class RequireAuthToCommentPluginTest < ActiveSupport::TestCase |
| 51 | 51 | |
| 52 | 52 | should 'not display stylesheet if login popup is active' do |
| 53 | 53 | plugin.expects(:display_login_popup?).returns(true) |
| 54 | - assert !plugin.stylesheet? | |
| 54 | + refute plugin.stylesheet? | |
| 55 | 55 | end |
| 56 | 56 | |
| 57 | 57 | should 'display stylesheet if login popup is inactive' do | ... | ... |
plugins/send_email/test/unit/send_email_plugin_mail_test.rb
| ... | ... | @@ -14,17 +14,17 @@ class SendEmailPluginMailTest < ActiveSupport::TestCase |
| 14 | 14 | |
| 15 | 15 | should 'requires to field' do |
| 16 | 16 | mail = SendEmailPlugin::Mail.new(:subject => 'Hi', :message => 'Hi john', :environment => @environment) |
| 17 | - assert !mail.valid? | |
| 17 | + refute mail.valid? | |
| 18 | 18 | end |
| 19 | 19 | |
| 20 | 20 | should 'require message field' do |
| 21 | 21 | mail = SendEmailPlugin::Mail.new(:subject => 'Hi', :to => 'john@example.com', :environment => @environment) |
| 22 | - assert !mail.valid? | |
| 22 | + refute mail.valid? | |
| 23 | 23 | end |
| 24 | 24 | |
| 25 | 25 | should 'require environment field' do |
| 26 | 26 | mail = SendEmailPlugin::Mail.new(:subject => 'Hi', :to => 'john@example.com', :message => 'Hi john') |
| 27 | - assert !mail.valid? | |
| 27 | + refute mail.valid? | |
| 28 | 28 | end |
| 29 | 29 | |
| 30 | 30 | should 'have a default subject' do |
| ... | ... | @@ -34,18 +34,18 @@ class SendEmailPluginMailTest < ActiveSupport::TestCase |
| 34 | 34 | |
| 35 | 35 | should 'not accept invalid email address' do |
| 36 | 36 | mail = SendEmailPlugin::Mail.new(:subject => 'Hi', :message => 'Hi john', :to => 'invalid-mail-address', :environment => @environment) |
| 37 | - assert !mail.valid? | |
| 37 | + refute mail.valid? | |
| 38 | 38 | end |
| 39 | 39 | |
| 40 | 40 | should 'not accept email that is not in allowed address list' do |
| 41 | 41 | mail = SendEmailPlugin::Mail.new(:subject => 'Hi', :message => 'Hi john', :to => 'unknow@example.com', :environment => @environment) |
| 42 | - assert !mail.valid? | |
| 42 | + refute mail.valid? | |
| 43 | 43 | end |
| 44 | 44 | |
| 45 | 45 | should 'discard some keys on set params hash' do |
| 46 | 46 | mail = SendEmailPlugin::Mail.new(:params => {:action => 1, :controller => 2, :to => 3, :message => 4, :subject => 5, :age => 6}) |
| 47 | 47 | [:params].each do |k| |
| 48 | - assert !mail.params.include?(k) | |
| 48 | + refute mail.params.include?(k) | |
| 49 | 49 | end |
| 50 | 50 | assert mail.params.include?(:age) |
| 51 | 51 | end |
| ... | ... | @@ -57,7 +57,7 @@ class SendEmailPluginMailTest < ActiveSupport::TestCase |
| 57 | 57 | |
| 58 | 58 | should "invalid if just one listed in 'to' list was not allowed" do |
| 59 | 59 | mail = SendEmailPlugin::Mail.new(:subject => 'Hi', :message => 'Hi john', :to => 'john@example.com,notallowed@example.com,someother@example.com', :environment => @environment) |
| 60 | - assert !mail.valid? | |
| 60 | + refute mail.valid? | |
| 61 | 61 | end |
| 62 | 62 | |
| 63 | 63 | end | ... | ... |
plugins/shopping_cart/test/functional/shopping_cart_plugin_controller_test.rb
| ... | ... | @@ -40,8 +40,8 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase |
| 40 | 40 | should 'not add product to cart if it does not exists' do |
| 41 | 41 | assert_nothing_raised { get :add, :id => 9999 } |
| 42 | 42 | |
| 43 | - assert !product_in_cart?(product) | |
| 44 | - assert !response_ok? | |
| 43 | + refute product_in_cart?(product) | |
| 44 | + refute response_ok? | |
| 45 | 45 | assert_equal 3, reponse_error_code |
| 46 | 46 | end |
| 47 | 47 | |
| ... | ... | @@ -50,15 +50,15 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase |
| 50 | 50 | assert cart? |
| 51 | 51 | |
| 52 | 52 | get :remove, :id => product.id |
| 53 | - assert !cart? | |
| 53 | + refute cart? | |
| 54 | 54 | end |
| 55 | 55 | |
| 56 | 56 | should 'not try to remove a product if there is no cart' do |
| 57 | 57 | instantiate_cart |
| 58 | - assert !cart? | |
| 58 | + refute cart? | |
| 59 | 59 | |
| 60 | 60 | assert_nothing_raised { get :remove, :id => 9999 } |
| 61 | - assert !response_ok? | |
| 61 | + refute response_ok? | |
| 62 | 62 | assert_equal 2, reponse_error_code |
| 63 | 63 | end |
| 64 | 64 | |
| ... | ... | @@ -69,7 +69,7 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase |
| 69 | 69 | |
| 70 | 70 | get :remove, :id => product.id |
| 71 | 71 | assert cart? |
| 72 | - assert !product_in_cart?(product) | |
| 72 | + refute product_in_cart?(product) | |
| 73 | 73 | end |
| 74 | 74 | |
| 75 | 75 | should 'not try to remove a product that is not in the cart' do |
| ... | ... | @@ -77,16 +77,16 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase |
| 77 | 77 | assert cart? |
| 78 | 78 | assert_nothing_raised { get :remove, :id => 9999 } |
| 79 | 79 | |
| 80 | - assert !response_ok? | |
| 80 | + refute response_ok? | |
| 81 | 81 | assert_equal 4, reponse_error_code |
| 82 | 82 | end |
| 83 | 83 | |
| 84 | 84 | should 'not try to list the cart if there is no cart' do |
| 85 | 85 | instantiate_cart |
| 86 | - assert !cart? | |
| 86 | + refute cart? | |
| 87 | 87 | |
| 88 | 88 | assert_nothing_raised { get :list } |
| 89 | - assert !response_ok? | |
| 89 | + refute response_ok? | |
| 90 | 90 | assert_equal 2, reponse_error_code |
| 91 | 91 | end |
| 92 | 92 | |
| ... | ... | @@ -107,10 +107,10 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase |
| 107 | 107 | |
| 108 | 108 | should 'not try to update quantity the quantity of a product if there is no cart' do |
| 109 | 109 | instantiate_cart |
| 110 | - assert !cart? | |
| 110 | + refute cart? | |
| 111 | 111 | |
| 112 | 112 | assert_nothing_raised { get :update_quantity, :id => 9999, :quantity => 3 } |
| 113 | - assert !response_ok? | |
| 113 | + refute response_ok? | |
| 114 | 114 | assert_equal 2, reponse_error_code |
| 115 | 115 | end |
| 116 | 116 | |
| ... | ... | @@ -119,7 +119,7 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase |
| 119 | 119 | assert cart? |
| 120 | 120 | assert_nothing_raised { get :update_quantity, :id => 9999, :quantity => 3 } |
| 121 | 121 | |
| 122 | - assert !response_ok? | |
| 122 | + refute response_ok? | |
| 123 | 123 | assert_equal 4, reponse_error_code |
| 124 | 124 | end |
| 125 | 125 | |
| ... | ... | @@ -127,11 +127,11 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase |
| 127 | 127 | get :add, :id => product.id |
| 128 | 128 | |
| 129 | 129 | assert_nothing_raised { get :update_quantity, :id => product.id, :quantity => -1} |
| 130 | - assert !response_ok? | |
| 130 | + refute response_ok? | |
| 131 | 131 | assert_equal 5, reponse_error_code |
| 132 | 132 | |
| 133 | 133 | assert_nothing_raised { get :update_quantity, :id => product.id, :quantity => 'asdf'} |
| 134 | - assert !response_ok? | |
| 134 | + refute response_ok? | |
| 135 | 135 | assert_equal 5, reponse_error_code |
| 136 | 136 | end |
| 137 | 137 | |
| ... | ... | @@ -141,12 +141,12 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase |
| 141 | 141 | get :add, :id => another_product.id |
| 142 | 142 | |
| 143 | 143 | assert_nothing_raised { get :clean } |
| 144 | - assert !cart? | |
| 144 | + refute cart? | |
| 145 | 145 | end |
| 146 | 146 | |
| 147 | 147 | should 'not crash if there is no cart' do |
| 148 | 148 | instantiate_cart |
| 149 | - assert !cart? | |
| 149 | + refute cart? | |
| 150 | 150 | assert_nothing_raised { get :clean } |
| 151 | 151 | end |
| 152 | 152 | |
| ... | ... | @@ -185,12 +185,12 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase |
| 185 | 185 | product1 = fast_create(Product, :profile_id => profile.id) |
| 186 | 186 | post :add, :id => product1.id |
| 187 | 187 | post :send_request, :customer => { :name => "Manuel", :email => "manuel@ceu.com" } |
| 188 | - assert !cart?, "cart expected to be empty!" | |
| 188 | + refute cart?, "cart expected to be empty!" | |
| 189 | 189 | end |
| 190 | 190 | |
| 191 | 191 | should 'not allow buy without any cart' do |
| 192 | 192 | get :buy |
| 193 | - assert !json_response[:ok] | |
| 193 | + refute json_response[:ok] | |
| 194 | 194 | assert_equal 2, json_response['error']['code'] |
| 195 | 195 | end |
| 196 | 196 | ... | ... |
plugins/shopping_cart/test/functional/shopping_cart_plugin_myprofile_controller_test.rb
| ... | ... | @@ -25,7 +25,7 @@ class ShoppingCartPluginMyprofileControllerTest < ActionController::TestCase |
| 25 | 25 | settings.save! |
| 26 | 26 | post :edit, :profile => profile.identifier, :settings => {:enabled => '0'} |
| 27 | 27 | |
| 28 | - assert !settings.enabled | |
| 28 | + refute settings.enabled | |
| 29 | 29 | end |
| 30 | 30 | |
| 31 | 31 | should 'be able to enable shopping cart delivery' do |
| ... | ... | @@ -41,7 +41,7 @@ class ShoppingCartPluginMyprofileControllerTest < ActionController::TestCase |
| 41 | 41 | settings.save! |
| 42 | 42 | post :edit, :profile => profile.identifier, :settings => {:delivery => '0'} |
| 43 | 43 | |
| 44 | - assert !settings.delivery | |
| 44 | + refute settings.delivery | |
| 45 | 45 | end |
| 46 | 46 | |
| 47 | 47 | should 'be able to choose the delivery price' do | ... | ... |
plugins/shopping_cart/test/unit/shopping_cart_plugin_test.rb
| ... | ... | @@ -29,6 +29,6 @@ class ShoppingCartPluginTest < ActiveSupport::TestCase |
| 29 | 29 | should 'be disabled by default on the enterprise' do |
| 30 | 30 | profile = fast_create(Enterprise) |
| 31 | 31 | settings = Noosfero::Plugin::Settings.new(profile, ShoppingCartPlugin) |
| 32 | - assert !settings.enabled | |
| 32 | + refute settings.enabled | |
| 33 | 33 | end |
| 34 | 34 | end | ... | ... |
plugins/solr/test/functional/search_controller_test.rb
| ... | ... | @@ -51,7 +51,7 @@ class SearchControllerTest < ActionController::TestCase |
| 51 | 51 | art.save! |
| 52 | 52 | |
| 53 | 53 | get 'articles', :query => 'article found' |
| 54 | - assert !assigns(:searches)[:articles][:facets].blank? | |
| 54 | + refute assigns(:searches)[:articles][:facets].blank? | |
| 55 | 55 | assert assigns(:searches)[:articles][:facets]['facet_fields']['solr_plugin_f_type_facet'][0][0] == 'Article' |
| 56 | 56 | assert assigns(:searches)[:articles][:facets]['facet_fields']['solr_plugin_f_profile_type_facet'][0][0] == 'Person' |
| 57 | 57 | assert assigns(:searches)[:articles][:facets]['facet_fields']['solr_plugin_f_category_facet'][0][0] == 'cat1' |
| ... | ... | @@ -69,7 +69,7 @@ class SearchControllerTest < ActionController::TestCase |
| 69 | 69 | |
| 70 | 70 | get 'people', :query => 'Hildebrando' |
| 71 | 71 | |
| 72 | - assert !assigns(:searches)[:people][:facets].blank? | |
| 72 | + refute assigns(:searches)[:people][:facets].blank? | |
| 73 | 73 | assert assigns(:searches)[:people][:facets]['facet_fields']['solr_plugin_f_region_facet'][0][0] == city.id.to_s |
| 74 | 74 | |
| 75 | 75 | categories_facet = assigns(:searches)[:people][:facets]['facet_fields']['solr_plugin_f_categories_facet'] |
| ... | ... | @@ -89,7 +89,7 @@ class SearchControllerTest < ActionController::TestCase |
| 89 | 89 | prod.save! |
| 90 | 90 | |
| 91 | 91 | get 'products', :query => 'Sound' |
| 92 | - assert !assigns(:searches)[:products][:facets].blank? | |
| 92 | + refute assigns(:searches)[:products][:facets].blank? | |
| 93 | 93 | assert assigns(:searches)[:products][:facets]['facet_fields']['solr_plugin_f_category_facet'][0][0] == @product_category.name |
| 94 | 94 | assert assigns(:searches)[:products][:facets]['facet_fields']['solr_plugin_f_region_facet'][0][0] == city.id.to_s |
| 95 | 95 | assert assigns(:searches)[:products][:facets]['facet_fields']['solr_plugin_f_qualifier_facet'][0][0] == "#{qualifier1.id} 0" | ... | ... |
plugins/solr/test/unit/acts_as_faceted_test.rb
| ... | ... | @@ -69,7 +69,7 @@ class ActsAsFacetedTest < ActiveSupport::TestCase |
| 69 | 69 | |
| 70 | 70 | should 'show facets option for solr' do |
| 71 | 71 | assert TestModel.facets_option_for_solr.include?(:f_type) |
| 72 | - assert !TestModel.facets_option_for_solr.include?(:f_published_at) | |
| 72 | + refute TestModel.facets_option_for_solr.include?(:f_published_at) | |
| 73 | 73 | end |
| 74 | 74 | |
| 75 | 75 | should 'show facets fields for solr' do | ... | ... |
plugins/solr/test/unit/profile_test.rb
| ... | ... | @@ -91,7 +91,7 @@ class ProfileTest < ActiveSupport::TestCase |
| 91 | 91 | p = create(Profile, :name => 'wanted') |
| 92 | 92 | |
| 93 | 93 | assert Profile.find_by_contents('wanted')[:results].include?(p) |
| 94 | - assert ! Profile.find_by_contents('not_wanted')[:results].include?(p) | |
| 94 | + refute Profile.find_by_contents('not_wanted')[:results].include?(p) | |
| 95 | 95 | end |
| 96 | 96 | |
| 97 | 97 | # This problem should be solved; talk to Bráulio if it fails | ... | ... |
plugins/spaminator/test/functional/spaminator_plugin_admin_controller_test.rb
| ... | ... | @@ -38,7 +38,7 @@ class SpaminatorPluginAdminControllerTest < ActionController::TestCase |
| 38 | 38 | get :withhold |
| 39 | 39 | reload_settings |
| 40 | 40 | |
| 41 | - assert !settings.deployed | |
| 41 | + refute settings.deployed | |
| 42 | 42 | end |
| 43 | 43 | |
| 44 | 44 | should 'make spaminator scan' do |
| ... | ... | @@ -70,7 +70,7 @@ class SpaminatorPluginAdminControllerTest < ActionController::TestCase |
| 70 | 70 | reload_settings |
| 71 | 71 | |
| 72 | 72 | assert settings.scheduled_scan.nil? |
| 73 | - assert !Delayed::Job.exists?(settings.scheduled_scan) | |
| 73 | + refute Delayed::Job.exists?(settings.scheduled_scan) | |
| 74 | 74 | end |
| 75 | 75 | |
| 76 | 76 | private | ... | ... |
plugins/spaminator/test/unit/spaminator_plugin/report_test.rb
| ... | ... | @@ -9,7 +9,7 @@ class SpaminatorPlugin::ReportTest < ActiveSupport::TestCase |
| 9 | 9 | |
| 10 | 10 | report.environment = Environment.default |
| 11 | 11 | report.valid? |
| 12 | - assert !report.errors.include?(:environment) | |
| 12 | + refute report.errors.include?(:environment) | |
| 13 | 13 | end |
| 14 | 14 | |
| 15 | 15 | should 'have scope of all reports from an environment' do | ... | ... |
plugins/spaminator/test/unit/spaminator_plugin/spaminator_test.rb
| ... | ... | @@ -87,7 +87,7 @@ class SpaminatorPlugin::SpaminatorTest < ActiveSupport::TestCase |
| 87 | 87 | |
| 88 | 88 | spaminator.send(:process_person_by_comments, person) |
| 89 | 89 | assert_equal 0, report.spammers_by_comments |
| 90 | - assert !person.abuser? | |
| 90 | + refute person.abuser? | |
| 91 | 91 | |
| 92 | 92 | fast_create(Comment, :author_id => person, :spam => true) |
| 93 | 93 | spaminator.send(:process_person_by_comments, person) |
| ... | ... | @@ -107,17 +107,17 @@ class SpaminatorPlugin::SpaminatorTest < ActiveSupport::TestCase |
| 107 | 107 | fast_create(Comment, :author_id => person) |
| 108 | 108 | |
| 109 | 109 | spaminator.send(:process_person_by_no_network, person) |
| 110 | - assert !person.abuser? | |
| 110 | + refute person.abuser? | |
| 111 | 111 | assert_equal 0, report.spammers_by_no_network |
| 112 | 112 | assert_equal 0, report.spams_by_no_network |
| 113 | 113 | assert person.visible |
| 114 | 114 | |
| 115 | 115 | c1.remove_member(person) |
| 116 | 116 | spaminator.send(:process_person_by_no_network, person) |
| 117 | - assert !person.abuser? | |
| 117 | + refute person.abuser? | |
| 118 | 118 | assert_equal 1, report.spammers_by_no_network |
| 119 | 119 | assert_equal 2, report.spams_by_no_network |
| 120 | - assert !person.visible | |
| 120 | + refute person.visible | |
| 121 | 121 | end |
| 122 | 122 | |
| 123 | 123 | should 'mark person as spammer' do |
| ... | ... | @@ -126,7 +126,7 @@ class SpaminatorPlugin::SpaminatorTest < ActiveSupport::TestCase |
| 126 | 126 | spaminator.send(:mark_as_spammer, person) |
| 127 | 127 | end |
| 128 | 128 | person.reload |
| 129 | - assert !person.visible | |
| 129 | + refute person.visible | |
| 130 | 130 | end |
| 131 | 131 | |
| 132 | 132 | should 'send email notification after disabling person' do | ... | ... |
plugins/statistics/test/unit/statistics_block_test.rb
| ... | ... | @@ -11,7 +11,7 @@ class StatisticsBlockTest < ActiveSupport::TestCase |
| 11 | 11 | ['community_counter', 'enterprise_counter', 'product_counter', 'category_counter', 'hit_counter'].map do |counter| |
| 12 | 12 | should "#{counter} be false by default" do |
| 13 | 13 | b = StatisticsBlock.new |
| 14 | - assert !b.is_visible?(counter) | |
| 14 | + refute b.is_visible?(counter) | |
| 15 | 15 | end |
| 16 | 16 | end |
| 17 | 17 | |
| ... | ... | @@ -41,7 +41,7 @@ class StatisticsBlockTest < ActiveSupport::TestCase |
| 41 | 41 | should 'is_visible? return false if setting is false' do |
| 42 | 42 | b = StatisticsBlock.new |
| 43 | 43 | b.community_counter = false |
| 44 | - assert !b.is_visible?('community_counter') | |
| 44 | + refute b.is_visible?('community_counter') | |
| 45 | 45 | end |
| 46 | 46 | |
| 47 | 47 | should 'templates return the Community templates of the Environment' do |
| ... | ... | @@ -349,7 +349,7 @@ class StatisticsBlockTest < ActiveSupport::TestCase |
| 349 | 349 | should 'is_template_counter_active? return false if setting is false' do |
| 350 | 350 | b = StatisticsBlock.new |
| 351 | 351 | b.templates_ids_counter = {'1' => 'false'} |
| 352 | - assert !b.is_template_counter_active?(1) | |
| 352 | + refute b.is_template_counter_active?(1) | |
| 353 | 353 | end |
| 354 | 354 | |
| 355 | 355 | should 'template_counter_count return the amount of communities of the Environment using a template' do | ... | ... |
plugins/stoa/test/functional/account_controller_test.rb
| ... | ... | @@ -38,7 +38,7 @@ class AccountControllerTest < ActionController::TestCase |
| 38 | 38 | should 'pass if confirmation value matches' do |
| 39 | 39 | #StoaPlugin::UspUser.stubs(:matches?).returns(true) |
| 40 | 40 | post :signup, :profile_data => {:usp_id => '12345678'}, :confirmation_field => 'cpf', :cpf => '12345678' |
| 41 | - assert !assigns(:person).errors.include?(:usp_id) | |
| 41 | + refute assigns(:person).errors.include?(:usp_id) | |
| 42 | 42 | end |
| 43 | 43 | |
| 44 | 44 | should 'include invitation_code param in the person\'s attributes' do | ... | ... |
plugins/stoa/test/functional/stoa_plugin_controller_test.rb
| ... | ... | @@ -99,7 +99,7 @@ class StoaPluginControllerTest < ActionController::TestCase |
| 99 | 99 | |
| 100 | 100 | post :authenticate, :login => user.login, :password => '123456', :fields => 'special' |
| 101 | 101 | |
| 102 | - assert !json_response.keys.include?('f1') | |
| 102 | + refute json_response.keys.include?('f1') | |
| 103 | 103 | assert json_response.keys.include?('f2') |
| 104 | 104 | assert json_response.keys.include?('f3') |
| 105 | 105 | end |
| ... | ... | @@ -153,7 +153,7 @@ class StoaPluginControllerTest < ActionController::TestCase |
| 153 | 153 | usp_id = '87654321' |
| 154 | 154 | StoaPlugin::UspUser.stubs(:exists?).with(usp_id).returns(false) |
| 155 | 155 | get :check_usp_id, :usp_id => usp_id |
| 156 | - assert !json_response['exists'] | |
| 156 | + refute json_response['exists'] | |
| 157 | 157 | end |
| 158 | 158 | |
| 159 | 159 | should 'check existent cpf' do |
| ... | ... | @@ -176,7 +176,7 @@ class StoaPluginControllerTest < ActionController::TestCase |
| 176 | 176 | user_with_cpf.stubs(:cpf).returns(nil) |
| 177 | 177 | StoaPlugin::UspUser.stubs(:find_by_codpes).with(usp_id_without_cpf).returns(user_without_cpf) |
| 178 | 178 | get :check_cpf, :usp_id => usp_id_without_cpf |
| 179 | - assert !json_response['exists'] | |
| 179 | + refute json_response['exists'] | |
| 180 | 180 | end |
| 181 | 181 | |
| 182 | 182 | private | ... | ... |
plugins/stoa/test/unit/person_api_test.rb
| ... | ... | @@ -98,7 +98,7 @@ class StoaPlugin::PersonApiTest < ActiveSupport::TestCase |
| 98 | 98 | create_article_with_tags(person.id, 'free_software') |
| 99 | 99 | |
| 100 | 100 | api = StoaPlugin::PersonApi.new(person) |
| 101 | - assert !api.tags.has_key?('noosfero') | |
| 101 | + refute api.tags.has_key?('noosfero') | |
| 102 | 102 | end |
| 103 | 103 | |
| 104 | 104 | should 'provide communities' do | ... | ... |
plugins/stoa/test/unit/person_test.rb
| ... | ... | @@ -33,12 +33,12 @@ class StoaPlugin::Person < ActiveSupport::TestCase |
| 33 | 33 | Task.create!(:code => 12345678) |
| 34 | 34 | person.invitation_code = 12345678 |
| 35 | 35 | person.valid? |
| 36 | - assert !person.errors.include?(:usp_id) | |
| 36 | + refute person.errors.include?(:usp_id) | |
| 37 | 37 | |
| 38 | 38 | person.invitation_code = nil |
| 39 | 39 | person.is_template = true |
| 40 | 40 | person.valid? |
| 41 | - assert !person.errors.include?(:usp_id) | |
| 41 | + refute person.errors.include?(:usp_id) | |
| 42 | 42 | end |
| 43 | 43 | |
| 44 | 44 | should 'allow multiple nil usp_id' do |
| ... | ... | @@ -47,7 +47,7 @@ class StoaPlugin::Person < ActiveSupport::TestCase |
| 47 | 47 | person = Person.new(:invitation_code => 87654321) |
| 48 | 48 | person.valid? |
| 49 | 49 | |
| 50 | - assert !person.errors.include?(:usp_id) | |
| 50 | + refute person.errors.include?(:usp_id) | |
| 51 | 51 | end |
| 52 | 52 | |
| 53 | 53 | should 'not allow person to be saved with a finished invitation that is not his own' do |
| ... | ... | @@ -68,7 +68,7 @@ class StoaPlugin::Person < ActiveSupport::TestCase |
| 68 | 68 | t.finish |
| 69 | 69 | |
| 70 | 70 | person.valid? |
| 71 | - assert !person.errors.include?(:usp_id) | |
| 71 | + refute person.errors.include?(:usp_id) | |
| 72 | 72 | end |
| 73 | 73 | |
| 74 | 74 | ... | ... |
plugins/stoa/test/unit/usp_user_test.rb
| ... | ... | @@ -21,19 +21,19 @@ class StoaPlugin::UspUserTest < ActiveSupport::TestCase |
| 21 | 21 | |
| 22 | 22 | should 'check existence of usp_id' do |
| 23 | 23 | assert StoaPlugin::UspUser.exists?(123456) |
| 24 | - assert !StoaPlugin::UspUser.exists?(654321) | |
| 24 | + refute StoaPlugin::UspUser.exists?(654321) | |
| 25 | 25 | end |
| 26 | 26 | |
| 27 | 27 | should 'check if usp_id matches with a cpf' do |
| 28 | 28 | assert StoaPlugin::UspUser.matches?(123456, :cpf, 12345678) |
| 29 | - assert !StoaPlugin::UspUser.matches?(123456, :cpf, 87654321) | |
| 30 | - assert !StoaPlugin::UspUser.matches?(654321, :cpf, 12345678) | |
| 29 | + refute StoaPlugin::UspUser.matches?(123456, :cpf, 87654321) | |
| 30 | + refute StoaPlugin::UspUser.matches?(654321, :cpf, 12345678) | |
| 31 | 31 | end |
| 32 | 32 | |
| 33 | 33 | should 'check if usp_id matches with a birth_date' do |
| 34 | 34 | assert StoaPlugin::UspUser.matches?(123456, :birth_date, '1970-01-30') |
| 35 | - assert !StoaPlugin::UspUser.matches?(123456, :birth_date, '1999-01-30') | |
| 36 | - assert !StoaPlugin::UspUser.matches?(654321, :birth_date, '1970-01-30') | |
| 35 | + refute StoaPlugin::UspUser.matches?(123456, :birth_date, '1999-01-30') | |
| 36 | + refute StoaPlugin::UspUser.matches?(654321, :birth_date, '1970-01-30') | |
| 37 | 37 | end |
| 38 | 38 | |
| 39 | 39 | should 'filter leading zeroes of id codes on exists and matches' do | ... | ... |
plugins/sub_organizations/test/unit/related_organizations_block_test.rb
| ... | ... | @@ -25,6 +25,6 @@ class RelatedOrganizationsBlockTest < ActiveSupport::TestCase |
| 25 | 25 | |
| 26 | 26 | assert @block.related_organizations.include?(child1) |
| 27 | 27 | assert @block.related_organizations.include?(child2) |
| 28 | - assert !@block.related_organizations.include?(org1) | |
| 28 | + refute @block.related_organizations.include?(org1) | |
| 29 | 29 | end |
| 30 | 30 | end | ... | ... |
plugins/sub_organizations/test/unit/sub_organizations_plugin/relation_test.rb
| ... | ... | @@ -28,7 +28,7 @@ class SubOrganizationsPlugin::RelationTest < ActiveSupport::TestCase |
| 28 | 28 | should 'not allow self relation' do |
| 29 | 29 | org = fast_create(Organization) |
| 30 | 30 | relation = SubOrganizationsPlugin::Relation.new(:parent => org, :child => org) |
| 31 | - assert !relation.valid? | |
| 31 | + refute relation.valid? | |
| 32 | 32 | assert relation.errors.include?(:child) |
| 33 | 33 | end |
| 34 | 34 | |
| ... | ... | @@ -60,7 +60,7 @@ class SubOrganizationsPlugin::RelationTest < ActiveSupport::TestCase |
| 60 | 60 | SubOrganizationsPlugin::Relation.create!(:parent => org1, :child => org2) |
| 61 | 61 | relation = SubOrganizationsPlugin::Relation.new(:parent => org2, :child => org1) |
| 62 | 62 | |
| 63 | - assert !relation.valid? | |
| 63 | + refute relation.valid? | |
| 64 | 64 | assert relation.errors.include?(:child) |
| 65 | 65 | end |
| 66 | 66 | |
| ... | ... | @@ -72,10 +72,10 @@ class SubOrganizationsPlugin::RelationTest < ActiveSupport::TestCase |
| 72 | 72 | r1 = SubOrganizationsPlugin::Relation.new(:parent => org2, :child => org3) |
| 73 | 73 | r2 = SubOrganizationsPlugin::Relation.new(:parent => org3, :child => org1) |
| 74 | 74 | |
| 75 | - assert !r1.valid? | |
| 75 | + refute r1.valid? | |
| 76 | 76 | assert r1.errors.include?(:child) |
| 77 | 77 | |
| 78 | - assert !r2.valid? | |
| 78 | + refute r2.valid? | |
| 79 | 79 | assert r2.errors.include?(:child) |
| 80 | 80 | end |
| 81 | 81 | ... | ... |
plugins/tolerance_time/test/unit/tolerance_time_plugin/publication_test.rb
| ... | ... | @@ -10,8 +10,8 @@ class ToleranceTimePlugin::PublicationTest < ActiveSupport::TestCase |
| 10 | 10 | publication.target = fast_create(Article) |
| 11 | 11 | publication.valid? |
| 12 | 12 | |
| 13 | - assert !publication.errors[:target_id].present? | |
| 14 | - assert !publication.errors[:target_type].present? | |
| 13 | + refute publication.errors[:target_id].present? | |
| 14 | + refute publication.errors[:target_type].present? | |
| 15 | 15 | end |
| 16 | 16 | |
| 17 | 17 | should 'validate uniqueness of target' do |
| ... | ... | @@ -51,9 +51,9 @@ class ToleranceTimePlugin::PublicationTest < ActiveSupport::TestCase |
| 51 | 51 | on_time_comment.save! |
| 52 | 52 | |
| 53 | 53 | assert expired_article.expired? |
| 54 | - assert !on_time_article.expired? | |
| 54 | + refute on_time_article.expired? | |
| 55 | 55 | assert expired_comment.expired? |
| 56 | - assert !on_time_comment.expired? | |
| 56 | + refute on_time_comment.expired? | |
| 57 | 57 | end |
| 58 | 58 | |
| 59 | 59 | should 'consider tolerance infinity if not defined' do |
| ... | ... | @@ -64,7 +64,7 @@ class ToleranceTimePlugin::PublicationTest < ActiveSupport::TestCase |
| 64 | 64 | article_publication.save! |
| 65 | 65 | ToleranceTimePlugin::Tolerance.create!(:profile => profile) |
| 66 | 66 | |
| 67 | - assert !article_publication.expired? | |
| 67 | + refute article_publication.expired? | |
| 68 | 68 | end |
| 69 | 69 | |
| 70 | 70 | should 'not crash if profile has no tolerance yet defined' do |
| ... | ... | @@ -74,6 +74,6 @@ class ToleranceTimePlugin::PublicationTest < ActiveSupport::TestCase |
| 74 | 74 | article_publication.created_at = 1000.years.ago |
| 75 | 75 | article_publication.save! |
| 76 | 76 | |
| 77 | - assert !article_publication.expired? | |
| 77 | + refute article_publication.expired? | |
| 78 | 78 | end |
| 79 | 79 | end | ... | ... |
plugins/tolerance_time/test/unit/tolerance_time_plugin/tolerance_test.rb
| ... | ... | @@ -8,7 +8,7 @@ class ToleranceTimePlugin::ToleranceTest < ActiveSupport::TestCase |
| 8 | 8 | |
| 9 | 9 | tolerance.profile = fast_create(Profile) |
| 10 | 10 | tolerance.valid? |
| 11 | - assert !tolerance.errors[:profile_id].present? | |
| 11 | + refute tolerance.errors[:profile_id].present? | |
| 12 | 12 | end |
| 13 | 13 | |
| 14 | 14 | should 'validate uniqueness of profile' do | ... | ... |
plugins/video/test/unit/video_block_test.rb
| ... | ... | @@ -36,19 +36,19 @@ class VideoBlockTest < ActiveSupport::TestCase |
| 36 | 36 | should "is_youtube return false when the url not contains youtube video ID" do |
| 37 | 37 | block = VideoBlock.new |
| 38 | 38 | block.url = "youtube.com/" |
| 39 | - assert !block.is_youtube? | |
| 39 | + refute block.is_youtube? | |
| 40 | 40 | end |
| 41 | 41 | |
| 42 | 42 | should "is_youtube return false when the url contains empty youtube video ID" do |
| 43 | 43 | block = VideoBlock.new |
| 44 | 44 | block.url = "youtube.com/?v=" |
| 45 | - assert !block.is_youtube? | |
| 45 | + refute block.is_youtube? | |
| 46 | 46 | end |
| 47 | 47 | |
| 48 | 48 | should "is_youtube return false when the url contains an invalid youtube link" do |
| 49 | 49 | block = VideoBlock.new |
| 50 | 50 | block.url = "http://www.yt.com/?v=XXXXX" |
| 51 | - assert !block.is_youtube? | |
| 51 | + refute block.is_youtube? | |
| 52 | 52 | end |
| 53 | 53 | |
| 54 | 54 | should "format embed video for youtube videos" do |
| ... | ... | @@ -131,19 +131,19 @@ class VideoBlockTest < ActiveSupport::TestCase |
| 131 | 131 | should "is_vimeo return false when the url not contains vimeo video ID" do |
| 132 | 132 | block = VideoBlock.new |
| 133 | 133 | block.url = "vimeo.com/home" |
| 134 | - assert !block.is_vimeo? | |
| 134 | + refute block.is_vimeo? | |
| 135 | 135 | end |
| 136 | 136 | |
| 137 | 137 | should "is_vimeo return false when the url contains empty vimeo video ID" do |
| 138 | 138 | block = VideoBlock.new |
| 139 | 139 | block.url = "vimeo.com/" |
| 140 | - assert !block.is_vimeo? | |
| 140 | + refute block.is_vimeo? | |
| 141 | 141 | end |
| 142 | 142 | |
| 143 | 143 | should "is_vimeo return false when the url contains an invalid vimeo link" do |
| 144 | 144 | block = VideoBlock.new |
| 145 | 145 | block.url = "http://www.vmsd.com/98979" |
| 146 | - assert !block.is_vimeo? | |
| 146 | + refute block.is_vimeo? | |
| 147 | 147 | end |
| 148 | 148 | |
| 149 | 149 | should "format embed video for vimeo videos" do |
| ... | ... | @@ -205,13 +205,13 @@ class VideoBlockTest < ActiveSupport::TestCase |
| 205 | 205 | should "is_video return false if url ends without mp4, ogg, ogv, webm" do |
| 206 | 206 | block = VideoBlock.new |
| 207 | 207 | block.url = "http://www.vmsd.com/98979.mp4r" |
| 208 | - assert !block.is_video_file? | |
| 208 | + refute block.is_video_file? | |
| 209 | 209 | block.url = "http://www.vmsd.com/98979.oggr" |
| 210 | - assert !block.is_video_file? | |
| 210 | + refute block.is_video_file? | |
| 211 | 211 | block.url = "http://www.vmsd.com/98979.ogvr" |
| 212 | - assert !block.is_video_file? | |
| 212 | + refute block.is_video_file? | |
| 213 | 213 | block.url = "http://www.vmsd.com/98979.webmr" |
| 214 | - assert !block.is_video_file? | |
| 214 | + refute block.is_video_file? | |
| 215 | 215 | end |
| 216 | 216 | |
| 217 | 217 | should 'display video block partial' do | ... | ... |
plugins/vote/test/functional/vote_plugin_profile_controller_test.rb
| ... | ... | @@ -27,7 +27,7 @@ class VotePluginProfileControllerTest < ActionController::TestCase |
| 27 | 27 | |
| 28 | 28 | should 'not vote if value is not allowed' do |
| 29 | 29 | xhr :post, :vote, :profile => profile.identifier, :id => comment.id, :model => 'comment', :vote => 4 |
| 30 | - assert !profile.voted_on?(comment) | |
| 30 | + refute profile.voted_on?(comment) | |
| 31 | 31 | end |
| 32 | 32 | |
| 33 | 33 | should 'not vote in a disallowed model' do |
| ... | ... | @@ -43,7 +43,7 @@ class VotePluginProfileControllerTest < ActionController::TestCase |
| 43 | 43 | should 'unlike comment' do |
| 44 | 44 | xhr :post, :vote, :profile => profile.identifier, :id => comment.id, :model => 'comment', :vote => 1 |
| 45 | 45 | xhr :post, :vote, :profile => profile.identifier, :id => comment.id, :model => 'comment', :vote => 1 |
| 46 | - assert !profile.voted_for?(comment) | |
| 46 | + refute profile.voted_for?(comment) | |
| 47 | 47 | end |
| 48 | 48 | |
| 49 | 49 | should 'dislike comment' do |
| ... | ... | @@ -54,7 +54,7 @@ class VotePluginProfileControllerTest < ActionController::TestCase |
| 54 | 54 | should 'undislike comment' do |
| 55 | 55 | xhr :post, :vote, :profile => profile.identifier, :id => comment.id, :model => 'comment', :vote => -1 |
| 56 | 56 | xhr :post, :vote, :profile => profile.identifier, :id => comment.id, :model => 'comment', :vote => -1 |
| 57 | - assert !profile.voted_against?(comment) | |
| 57 | + refute profile.voted_against?(comment) | |
| 58 | 58 | end |
| 59 | 59 | |
| 60 | 60 | should 'dislike a liked comment' do | ... | ... |
plugins/work_assignment/test/unit/work_assingment_plugin_test.rb
| ... | ... | @@ -15,7 +15,7 @@ class WorkAssignmentPluginTest < ActiveSupport::TestCase |
| 15 | 15 | }, |
| 16 | 16 | :without_protection => true |
| 17 | 17 | ) |
| 18 | - assert !WorkAssignmentPlugin.is_submission?(content) | |
| 18 | + refute WorkAssignmentPlugin.is_submission?(content) | |
| 19 | 19 | |
| 20 | 20 | work_assignment = WorkAssignmentPlugin::WorkAssignment.create!(:name => 'Work Assignment', :profile => organization) |
| 21 | 21 | content.parent = work_assignment |
| ... | ... | @@ -28,7 +28,7 @@ class WorkAssignmentPluginTest < ActiveSupport::TestCase |
| 28 | 28 | |
| 29 | 29 | should 'be able to download submission if work_assignment published submissions' do |
| 30 | 30 | submission = create_submission |
| 31 | - assert !WorkAssignmentPlugin.can_download_submission?(nil, submission) | |
| 31 | + refute WorkAssignmentPlugin.can_download_submission?(nil, submission) | |
| 32 | 32 | |
| 33 | 33 | work_assignment = submission.parent.parent |
| 34 | 34 | work_assignment.publish_submissions = true |
| ... | ... | @@ -41,7 +41,7 @@ class WorkAssignmentPluginTest < ActiveSupport::TestCase |
| 41 | 41 | should 'be able to download submission if the user is author of it' do |
| 42 | 42 | person = fast_create(Person) |
| 43 | 43 | submission = create_submission |
| 44 | - assert !WorkAssignmentPlugin.can_download_submission?(person, submission) | |
| 44 | + refute WorkAssignmentPlugin.can_download_submission?(person, submission) | |
| 45 | 45 | |
| 46 | 46 | submission = create_submission(person) |
| 47 | 47 | assert WorkAssignmentPlugin.can_download_submission?(person, submission) |
| ... | ... | @@ -50,7 +50,7 @@ class WorkAssignmentPluginTest < ActiveSupport::TestCase |
| 50 | 50 | should 'be able to download submission if the user has the view_private_content permission on the profile' do |
| 51 | 51 | person = fast_create(Person) |
| 52 | 52 | submission = create_submission |
| 53 | - assert !WorkAssignmentPlugin.can_download_submission?(person, submission) | |
| 53 | + refute WorkAssignmentPlugin.can_download_submission?(person, submission) | |
| 54 | 54 | |
| 55 | 55 | moderator = create_user_with_permission('moderator', 'view_private_content', submission.profile) |
| 56 | 56 | assert WorkAssignmentPlugin.can_download_submission?(moderator, submission) | ... | ... |
test/functional/account_controller_test.rb
| ... | ... | @@ -142,14 +142,14 @@ class AccountControllerTest < ActionController::TestCase |
| 142 | 142 | users(:johndoe).update_attribute :remember_token_expires_at, 5.minutes.ago |
| 143 | 143 | @request.cookies["auth_token"] = cookie_for(:johndoe) |
| 144 | 144 | get :index |
| 145 | - assert !@controller.send(:logged_in?) | |
| 145 | + refute @controller.send(:logged_in?) | |
| 146 | 146 | end |
| 147 | 147 | |
| 148 | 148 | def test_should_fail_cookie_login |
| 149 | 149 | users(:johndoe).remember_me |
| 150 | 150 | @request.cookies["auth_token"] = auth_token('invalid_auth_token') |
| 151 | 151 | get :index |
| 152 | - assert !@controller.send(:logged_in?) | |
| 152 | + refute @controller.send(:logged_in?) | |
| 153 | 153 | end |
| 154 | 154 | |
| 155 | 155 | def test_should_display_anonymous_user_options |
| ... | ... | @@ -187,7 +187,7 @@ class AccountControllerTest < ActionController::TestCase |
| 187 | 187 | post :change_password, :current_password => 'wrong', :new_password => 'blabla', :new_password_confirmation => 'blabla' |
| 188 | 188 | assert_response :success |
| 189 | 189 | assert_template 'change_password' |
| 190 | - assert ! User.find_by_login('ze').authenticated?('blabla') | |
| 190 | + refute User.find_by_login('ze').authenticated?('blabla') | |
| 191 | 191 | assert_equal users(:ze), @controller.send(:current_user) |
| 192 | 192 | end |
| 193 | 193 | |
| ... | ... | @@ -196,8 +196,8 @@ class AccountControllerTest < ActionController::TestCase |
| 196 | 196 | post :change_password, :current_password => 'test', :new_password => 'blabla', :new_password_confirmation => 'blibli' |
| 197 | 197 | assert_response :success |
| 198 | 198 | assert_template 'change_password' |
| 199 | - assert !assigns(:current_user).authenticated?('blabla') | |
| 200 | - assert !assigns(:current_user).authenticated?('blibli') | |
| 199 | + refute assigns(:current_user).authenticated?('blabla') | |
| 200 | + refute assigns(:current_user).authenticated?('blibli') | |
| 201 | 201 | assert_equal users(:ze), @controller.send(:current_user) |
| 202 | 202 | end |
| 203 | 203 | |
| ... | ... | @@ -282,7 +282,7 @@ class AccountControllerTest < ActionController::TestCase |
| 282 | 282 | assert_response :success |
| 283 | 283 | assert_template 'new_password' |
| 284 | 284 | |
| 285 | - assert !User.find(user.id).authenticated?('onepass') | |
| 285 | + refute User.find(user.id).authenticated?('onepass') | |
| 286 | 286 | end |
| 287 | 287 | |
| 288 | 288 | should 'display login popup' do |
| ... | ... | @@ -536,7 +536,7 @@ class AccountControllerTest < ActionController::TestCase |
| 536 | 536 | post :activate_enterprise, :enterprise_code => '0123456789', :answer => '1998', :terms_accepted => false |
| 537 | 537 | ent.reload |
| 538 | 538 | |
| 539 | - assert !ent.enabled | |
| 539 | + refute ent.enabled | |
| 540 | 540 | assert_not_includes ent.members, p |
| 541 | 541 | end |
| 542 | 542 | ... | ... |
test/functional/admin_panel_controller_test.rb
| ... | ... | @@ -102,7 +102,7 @@ class AdminPanelControllerTest < ActionController::TestCase |
| 102 | 102 | post :site_info, :environment => { :terms_of_use => content } |
| 103 | 103 | assert_redirected_to :action => 'index' |
| 104 | 104 | |
| 105 | - assert !Environment.default.has_terms_of_use? | |
| 105 | + refute Environment.default.has_terms_of_use? | |
| 106 | 106 | end |
| 107 | 107 | |
| 108 | 108 | should 'save subject and body of signup welcome text' do |
| ... | ... | @@ -113,7 +113,7 @@ class AdminPanelControllerTest < ActionController::TestCase |
| 113 | 113 | |
| 114 | 114 | assert_equal subject, Environment.default.signup_welcome_text[:subject] |
| 115 | 115 | assert_equal body, Environment.default.signup_welcome_text[:body] |
| 116 | - assert !Environment.default.signup_welcome_text.blank? | |
| 116 | + refute Environment.default.signup_welcome_text.blank? | |
| 117 | 117 | end |
| 118 | 118 | |
| 119 | 119 | should 'not save empty string as signup welcome text' do |
| ... | ... | @@ -121,7 +121,7 @@ class AdminPanelControllerTest < ActionController::TestCase |
| 121 | 121 | post :site_info, :environment => { :signup_welcome_text_body => content } |
| 122 | 122 | assert_redirected_to :action => 'index' |
| 123 | 123 | |
| 124 | - assert !Environment.default.has_signup_welcome_text? | |
| 124 | + refute Environment.default.has_signup_welcome_text? | |
| 125 | 125 | end |
| 126 | 126 | |
| 127 | 127 | should 'sanitize message for disabled enterprise with white_list' do |
| ... | ... | @@ -390,6 +390,6 @@ class AdminPanelControllerTest < ActionController::TestCase |
| 390 | 390 | assert_redirected_to :action => 'index' |
| 391 | 391 | |
| 392 | 392 | assert_equal body, Environment.default.signup_welcome_screen_body |
| 393 | - assert !Environment.default.signup_welcome_screen_body.blank? | |
| 393 | + refute Environment.default.signup_welcome_screen_body.blank? | |
| 394 | 394 | end |
| 395 | 395 | end | ... | ... |
test/functional/application_controller_test.rb
| ... | ... | @@ -150,7 +150,7 @@ class ApplicationControllerTest < ActionController::TestCase |
| 150 | 150 | class DoesNotUsesBlocksTestController < ApplicationController |
| 151 | 151 | no_design_blocks |
| 152 | 152 | end |
| 153 | - assert !DoesNotUsesBlocksTestController.new.send(:uses_design_blocks?) | |
| 153 | + refute DoesNotUsesBlocksTestController.new.send(:uses_design_blocks?) | |
| 154 | 154 | end |
| 155 | 155 | |
| 156 | 156 | should 'generate blocks' do | ... | ... |
test/functional/cms_controller_test.rb
| ... | ... | @@ -141,7 +141,7 @@ class CmsControllerTest < ActionController::TestCase |
| 141 | 141 | profile.description = 'a' * 600 |
| 142 | 142 | profile.save(:validate => false) |
| 143 | 143 | |
| 144 | - assert !profile.valid? | |
| 144 | + refute profile.valid? | |
| 145 | 145 | assert_not_equal a, profile.home_page |
| 146 | 146 | |
| 147 | 147 | post :set_home_page, :profile => profile.identifier, :id => a.id |
| ... | ... | @@ -779,9 +779,9 @@ class CmsControllerTest < ActionController::TestCase |
| 779 | 779 | post :new, :profile => profile.identifier, :type => 'TextileArticle', :parent_id => folder.id, :article => { :name => 'new-private-article'} |
| 780 | 780 | folder.reload |
| 781 | 781 | |
| 782 | - assert !assigns(:article).published? | |
| 782 | + refute assigns(:article).published? | |
| 783 | 783 | assert_equal 'new-private-article', folder.children[0].name |
| 784 | - assert !folder.children[0].published? | |
| 784 | + refute folder.children[0].published? | |
| 785 | 785 | end |
| 786 | 786 | |
| 787 | 787 | should 'publish the article in the selected community if community is not moderated' do |
| ... | ... | @@ -1310,7 +1310,7 @@ class CmsControllerTest < ActionController::TestCase |
| 1310 | 1310 | |
| 1311 | 1311 | UploadedFile.attachment_options[:thumbnails].each do |suffix, size| |
| 1312 | 1312 | assert File.exists?(UploadedFile.find(file_1.id).public_filename(suffix)) |
| 1313 | - assert !File.exists?(UploadedFile.find(file_2.id).public_filename(suffix)) | |
| 1313 | + refute File.exists?(UploadedFile.find(file_2.id).public_filename(suffix)) | |
| 1314 | 1314 | end |
| 1315 | 1315 | file_1.destroy |
| 1316 | 1316 | file_2.destroy |
| ... | ... | @@ -1553,7 +1553,7 @@ class CmsControllerTest < ActionController::TestCase |
| 1553 | 1553 | profile.articles << Blog.new(:name => 'Blog for test', :profile => profile, :display_posts_in_current_language => true) |
| 1554 | 1554 | post :edit, :profile => profile.identifier, :id => profile.blog.id, :article => { :display_posts_in_current_language => false } |
| 1555 | 1555 | profile.blog.reload |
| 1556 | - assert !profile.blog.display_posts_in_current_language? | |
| 1556 | + refute profile.blog.display_posts_in_current_language? | |
| 1557 | 1557 | end |
| 1558 | 1558 | |
| 1559 | 1559 | should 'update to true blog display posts in current language setting' do | ... | ... |
test/functional/comment_controller_test.rb
| ... | ... | @@ -417,7 +417,7 @@ class CommentControllerTest < ActionController::TestCase |
| 417 | 417 | login_as 'normaluser' # normaluser cannot remove other people's comments |
| 418 | 418 | xhr :post, :mark_as_spam, :profile => profile.identifier, :id => comment.id |
| 419 | 419 | comment.reload |
| 420 | - assert !comment.spam? | |
| 420 | + refute comment.spam? | |
| 421 | 421 | end |
| 422 | 422 | |
| 423 | 423 | should "not be able to mark as spam other people's comments if not moderator or admin and return json if is an ajax request" do |
| ... | ... | @@ -434,7 +434,7 @@ class CommentControllerTest < ActionController::TestCase |
| 434 | 434 | xhr :post, :mark_as_spam, :profile => profile.identifier, :id => comment.id |
| 435 | 435 | assert_response :success |
| 436 | 436 | comment.reload |
| 437 | - assert !comment.spam? | |
| 437 | + refute comment.spam? | |
| 438 | 438 | assert_match /\{\"ok\":false\}/, @response.body |
| 439 | 439 | end |
| 440 | 440 | ... | ... |
test/functional/environment_design_controller_test.rb
| ... | ... | @@ -207,9 +207,9 @@ class EnvironmentDesignControllerTest < ActionController::TestCase |
| 207 | 207 | |
| 208 | 208 | Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([TestBlockPlugin.new]) |
| 209 | 209 | assert @controller.available_blocks.include?(CustomBlock1) |
| 210 | - assert !@controller.available_blocks.include?(CustomBlock2) | |
| 211 | - assert !@controller.available_blocks.include?(CustomBlock3) | |
| 212 | - assert !@controller.available_blocks.include?(CustomBlock4) | |
| 210 | + refute @controller.available_blocks.include?(CustomBlock2) | |
| 211 | + refute @controller.available_blocks.include?(CustomBlock3) | |
| 212 | + refute @controller.available_blocks.include?(CustomBlock4) | |
| 213 | 213 | end |
| 214 | 214 | |
| 215 | 215 | should 'a block plugin with center position add new blocks only in this position' do |
| ... | ... | @@ -247,12 +247,12 @@ class EnvironmentDesignControllerTest < ActionController::TestCase |
| 247 | 247 | assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock1) |
| 248 | 248 | assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock2) |
| 249 | 249 | assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock3) |
| 250 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock4) | |
| 251 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock5) | |
| 252 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock6) | |
| 253 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock7) | |
| 254 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock8) | |
| 255 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock9) | |
| 250 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock4) | |
| 251 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock5) | |
| 252 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock6) | |
| 253 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock7) | |
| 254 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock8) | |
| 255 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock9) | |
| 256 | 256 | end |
| 257 | 257 | |
| 258 | 258 | should 'a block plugin with side position add new blocks only in this position' do |
| ... | ... | @@ -287,9 +287,9 @@ class EnvironmentDesignControllerTest < ActionController::TestCase |
| 287 | 287 | get :add_block |
| 288 | 288 | assert_response :success |
| 289 | 289 | |
| 290 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock1) | |
| 291 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock2) | |
| 292 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock3) | |
| 290 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock1) | |
| 291 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock2) | |
| 292 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock3) | |
| 293 | 293 | assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock4) |
| 294 | 294 | assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock5) |
| 295 | 295 | assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock6) |
| ... | ... | @@ -328,13 +328,13 @@ class EnvironmentDesignControllerTest < ActionController::TestCase |
| 328 | 328 | get :add_block |
| 329 | 329 | assert_response :success |
| 330 | 330 | |
| 331 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock1) | |
| 332 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock2) | |
| 333 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock3) | |
| 331 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock1) | |
| 332 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock2) | |
| 333 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock3) | |
| 334 | 334 | assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock4) |
| 335 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock5) | |
| 336 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock6) | |
| 337 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock7) | |
| 335 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock5) | |
| 336 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock6) | |
| 337 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock7) | |
| 338 | 338 | assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock8) |
| 339 | 339 | end |
| 340 | 340 | ... | ... |
test/functional/features_controller_test.rb
| ... | ... | @@ -38,7 +38,7 @@ class FeaturesControllerTest < ActionController::TestCase |
| 38 | 38 | v = Environment.find(environments(:anhetegua_net).id) |
| 39 | 39 | assert v.enabled?('feature2') |
| 40 | 40 | assert v.enabled?('feature2') |
| 41 | - assert !v.enabled?('feature3') | |
| 41 | + refute v.enabled?('feature3') | |
| 42 | 42 | end |
| 43 | 43 | |
| 44 | 44 | def test_update_disable_all |
| ... | ... | @@ -47,9 +47,9 @@ class FeaturesControllerTest < ActionController::TestCase |
| 47 | 47 | assert_redirected_to :action => 'index' |
| 48 | 48 | assert_kind_of String, session[:notice] |
| 49 | 49 | v = Environment.find(environments(:anhetegua_net).id) |
| 50 | - assert !v.enabled?('feature1') | |
| 51 | - assert !v.enabled?('feature2') | |
| 52 | - assert !v.enabled?('feature3') | |
| 50 | + refute v.enabled?('feature1') | |
| 51 | + refute v.enabled?('feature2') | |
| 52 | + refute v.enabled?('feature3') | |
| 53 | 53 | end |
| 54 | 54 | |
| 55 | 55 | def test_update_no_post | ... | ... |
test/functional/invite_controller_test.rb
| ... | ... | @@ -164,7 +164,7 @@ class InviteControllerTest < ActionController::TestCase |
| 164 | 164 | |
| 165 | 165 | assert ContactList.exists?(contact_list.id) |
| 166 | 166 | process_delayed_job_queue |
| 167 | - assert !ContactList.exists?(contact_list.id) | |
| 167 | + refute ContactList.exists?(contact_list.id) | |
| 168 | 168 | end |
| 169 | 169 | |
| 170 | 170 | should 'destroy contact_list after invitation when import is not manual' do |
| ... | ... | @@ -173,7 +173,7 @@ class InviteControllerTest < ActionController::TestCase |
| 173 | 173 | |
| 174 | 174 | assert ContactList.exists?(contact_list.id) |
| 175 | 175 | process_delayed_job_queue |
| 176 | - assert !ContactList.exists?(contact_list.id) | |
| 176 | + refute ContactList.exists?(contact_list.id) | |
| 177 | 177 | end |
| 178 | 178 | |
| 179 | 179 | should 'return empty hash as invitation data if contact list was not fetched' do | ... | ... |
test/functional/mailconf_controller_test.rb
| ... | ... | @@ -95,7 +95,7 @@ class MailconfControllerTest < ActionController::TestCase |
| 95 | 95 | login_as('ze') |
| 96 | 96 | assert user.enable_email! |
| 97 | 97 | post :disable, :profile => 'ze' |
| 98 | - assert !Profile['ze'].user.enable_email | |
| 98 | + refute Profile['ze'].user.enable_email | |
| 99 | 99 | end |
| 100 | 100 | |
| 101 | 101 | should 'go back on save' do | ... | ... |
test/functional/manage_products_controller_test.rb
| ... | ... | @@ -44,7 +44,7 @@ class ManageProductsControllerTest < ActionController::TestCase |
| 44 | 44 | assert_difference 'Product.count' do |
| 45 | 45 | post 'new', :profile => @enterprise.identifier, :product => {:name => 'test product'}, :selected_category_id => @product_category.id |
| 46 | 46 | assert assigns(:product) |
| 47 | - assert !assigns(:product).new_record? | |
| 47 | + refute assigns(:product).new_record? | |
| 48 | 48 | end |
| 49 | 49 | end |
| 50 | 50 | |
| ... | ... | @@ -86,7 +86,7 @@ class ManageProductsControllerTest < ActionController::TestCase |
| 86 | 86 | post :edit, :profile => @enterprise.identifier, :product => {:name => 'new test product'}, :id => product.id, :field => 'name' |
| 87 | 87 | assert_response :success |
| 88 | 88 | assert assigns(:product) |
| 89 | - assert ! assigns(:product).new_record? | |
| 89 | + refute assigns(:product).new_record? | |
| 90 | 90 | assert_equal product, Product.find_by_name('new test product') |
| 91 | 91 | end |
| 92 | 92 | |
| ... | ... | @@ -95,7 +95,7 @@ class ManageProductsControllerTest < ActionController::TestCase |
| 95 | 95 | post :edit, :profile => @enterprise.identifier, :product => {:description => 'A very good product!'}, :id => product.id, :field => 'info' |
| 96 | 96 | assert_response :success |
| 97 | 97 | assert assigns(:product) |
| 98 | - assert ! assigns(:product).new_record? | |
| 98 | + refute assigns(:product).new_record? | |
| 99 | 99 | assert_equal 'A very good product!', Product.find_by_name('test product').description |
| 100 | 100 | end |
| 101 | 101 | |
| ... | ... | @@ -104,7 +104,7 @@ class ManageProductsControllerTest < ActionController::TestCase |
| 104 | 104 | post :edit, :profile => @enterprise.identifier, :product => { :image_builder => { :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png') } }, :id => product.id, :field => 'image' |
| 105 | 105 | assert_response :success |
| 106 | 106 | assert assigns(:product) |
| 107 | - assert ! assigns(:product).new_record? | |
| 107 | + refute assigns(:product).new_record? | |
| 108 | 108 | assert_equal 'rails.png', Product.find_by_name('test product').image.filename |
| 109 | 109 | end |
| 110 | 110 | |
| ... | ... | @@ -129,7 +129,7 @@ class ManageProductsControllerTest < ActionController::TestCase |
| 129 | 129 | assert_response :redirect |
| 130 | 130 | assert_redirected_to :action => 'index' |
| 131 | 131 | assert assigns(:product) |
| 132 | - assert ! Product.find_by_name('test product') | |
| 132 | + refute Product.find_by_name('test product') | |
| 133 | 133 | end |
| 134 | 134 | end |
| 135 | 135 | |
| ... | ... | @@ -491,7 +491,7 @@ class ManageProductsControllerTest < ActionController::TestCase |
| 491 | 491 | resp = ActiveSupport::JSON.decode(@response.body) |
| 492 | 492 | assert_nil resp['name'] |
| 493 | 493 | assert_nil resp['id'] |
| 494 | - assert !resp['ok'] | |
| 494 | + refute resp['ok'] | |
| 495 | 495 | assert_match /blank/, resp['error_msg'] |
| 496 | 496 | end |
| 497 | 497 | |
| ... | ... | @@ -501,7 +501,7 @@ class ManageProductsControllerTest < ActionController::TestCase |
| 501 | 501 | resp = ActiveSupport::JSON.decode(@response.body) |
| 502 | 502 | assert_nil resp['name'] |
| 503 | 503 | assert_nil resp['id'] |
| 504 | - assert !resp['ok'] | |
| 504 | + refute resp['ok'] | |
| 505 | 505 | assert_match /too long/, resp['error_msg'] |
| 506 | 506 | end |
| 507 | 507 | ... | ... |
test/functional/organizations_controller_test.rb
| ... | ... | @@ -86,7 +86,7 @@ class OrganizationsControllerTest < ActionController::TestCase |
| 86 | 86 | |
| 87 | 87 | should 'activate organization profile' do |
| 88 | 88 | organization = fast_create(Organization, :visible => false, :environment_id => environment.id) |
| 89 | - assert !organization.visible? | |
| 89 | + refute organization.visible? | |
| 90 | 90 | |
| 91 | 91 | get :activate, {:id => organization.id} |
| 92 | 92 | organization.reload |
| ... | ... | @@ -101,7 +101,7 @@ class OrganizationsControllerTest < ActionController::TestCase |
| 101 | 101 | get :deactivate, {:id => organization.id} |
| 102 | 102 | organization.reload |
| 103 | 103 | |
| 104 | - assert !organization.visible | |
| 104 | + refute organization.visible | |
| 105 | 105 | end |
| 106 | 106 | |
| 107 | 107 | should 'destroy organization profile' do | ... | ... |
test/functional/profile_controller_test.rb
| ... | ... | @@ -595,7 +595,7 @@ class ProfileControllerTest < ActionController::TestCase |
| 595 | 595 | assert_response :success |
| 596 | 596 | assert_equal "Message successfully sent.", assigns(:message) |
| 597 | 597 | profile.reload |
| 598 | - assert !profile.scraps_received.empty? | |
| 598 | + refute profile.scraps_received.empty? | |
| 599 | 599 | end |
| 600 | 600 | |
| 601 | 601 | should "leave a scrap on another profile" do |
| ... | ... | @@ -608,7 +608,7 @@ class ProfileControllerTest < ActionController::TestCase |
| 608 | 608 | assert_response :success |
| 609 | 609 | assert_equal "Message successfully sent.", assigns(:message) |
| 610 | 610 | another_person.reload |
| 611 | - assert !another_person.scraps_received.empty? | |
| 611 | + refute another_person.scraps_received.empty? | |
| 612 | 612 | end |
| 613 | 613 | |
| 614 | 614 | should "the owner of scrap could remove it" do |
| ... | ... | @@ -729,7 +729,7 @@ class ProfileControllerTest < ActionController::TestCase |
| 729 | 729 | |
| 730 | 730 | should 'not see the friends activities in the current profile' do |
| 731 | 731 | p2 = create_user.person |
| 732 | - assert !profile.is_a_friend?(p2) | |
| 732 | + refute profile.is_a_friend?(p2) | |
| 733 | 733 | p3 = create_user.person |
| 734 | 734 | p3.add_friend(profile) |
| 735 | 735 | assert p3.is_a_friend?(profile) |
| ... | ... | @@ -753,7 +753,7 @@ class ProfileControllerTest < ActionController::TestCase |
| 753 | 753 | should 'see all the activities in the current profile network' do |
| 754 | 754 | p1= create_user.person |
| 755 | 755 | p2= create_user.person |
| 756 | - assert !p1.is_a_friend?(p2) | |
| 756 | + refute p1.is_a_friend?(p2) | |
| 757 | 757 | |
| 758 | 758 | p3= create_user.person |
| 759 | 759 | p3.add_friend(p1) |
| ... | ... | @@ -783,7 +783,7 @@ class ProfileControllerTest < ActionController::TestCase |
| 783 | 783 | should 'the network activity be visible only to profile followers' do |
| 784 | 784 | p1= create_user.person |
| 785 | 785 | p2= create_user.person |
| 786 | - assert !p1.is_a_friend?(p2) | |
| 786 | + refute p1.is_a_friend?(p2) | |
| 787 | 787 | |
| 788 | 788 | p3= create_user.person |
| 789 | 789 | p3.add_friend(p1) |
| ... | ... | @@ -826,7 +826,7 @@ class ProfileControllerTest < ActionController::TestCase |
| 826 | 826 | should 'the network activity be visible only to logged users' do |
| 827 | 827 | p1= create_user.person |
| 828 | 828 | p2= create_user.person |
| 829 | - assert !p1.is_a_friend?(p2) | |
| 829 | + refute p1.is_a_friend?(p2) | |
| 830 | 830 | p3= create_user.person |
| 831 | 831 | p3.add_friend(p1) |
| 832 | 832 | assert p3.is_a_friend?(p1) |
| ... | ... | @@ -862,7 +862,7 @@ class ProfileControllerTest < ActionController::TestCase |
| 862 | 862 | p1= fast_create(Person) |
| 863 | 863 | community = fast_create(Community) |
| 864 | 864 | p2= fast_create(Person) |
| 865 | - assert !p1.is_a_friend?(p2) | |
| 865 | + refute p1.is_a_friend?(p2) | |
| 866 | 866 | community.add_member(p1) |
| 867 | 867 | community.add_member(p2) |
| 868 | 868 | ActionTracker::Record.destroy_all |
| ... | ... | @@ -888,7 +888,7 @@ class ProfileControllerTest < ActionController::TestCase |
| 888 | 888 | should 'the self activity not crashes with user not logged in' do |
| 889 | 889 | p1= create_user.person |
| 890 | 890 | p2= create_user.person |
| 891 | - assert !p1.is_a_friend?(p2) | |
| 891 | + refute p1.is_a_friend?(p2) | |
| 892 | 892 | p3= create_user.person |
| 893 | 893 | p3.add_friend(p1) |
| 894 | 894 | assert p3.is_a_friend?(p1) |
| ... | ... | @@ -1404,7 +1404,7 @@ class ProfileControllerTest < ActionController::TestCase |
| 1404 | 1404 | login_as(profile.identifier) |
| 1405 | 1405 | get :index, :profile => profile.identifier |
| 1406 | 1406 | |
| 1407 | - assert !/This article makes me hungry/.match(@response.body), 'Spam comment was shown!' | |
| 1407 | + refute /This article makes me hungry/.match(@response.body), 'Spam comment was shown!' | |
| 1408 | 1408 | end |
| 1409 | 1409 | |
| 1410 | 1410 | should 'display comment in wall from non logged users after click in view all comments' do | ... | ... |
test/functional/profile_design_controller_test.rb
| ... | ... | @@ -203,12 +203,12 @@ class ProfileDesignControllerTest < ActionController::TestCase |
| 203 | 203 | assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock1) |
| 204 | 204 | assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock2) |
| 205 | 205 | assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock3) |
| 206 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock4) | |
| 207 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock5) | |
| 208 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock6) | |
| 209 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock7) | |
| 210 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock8) | |
| 211 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock9) | |
| 206 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock4) | |
| 207 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock5) | |
| 208 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock6) | |
| 209 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock7) | |
| 210 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock8) | |
| 211 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock9) | |
| 212 | 212 | end |
| 213 | 213 | |
| 214 | 214 | should 'a block plugin with side position add new blocks only in this position' do |
| ... | ... | @@ -242,9 +242,9 @@ class ProfileDesignControllerTest < ActionController::TestCase |
| 242 | 242 | get :add_block, :profile => 'designtestuser' |
| 243 | 243 | assert_response :success |
| 244 | 244 | |
| 245 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock1) | |
| 246 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock2) | |
| 247 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock3) | |
| 245 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock1) | |
| 246 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock2) | |
| 247 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock3) | |
| 248 | 248 | assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock4) |
| 249 | 249 | assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock5) |
| 250 | 250 | assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock6) |
| ... | ... | @@ -283,13 +283,13 @@ class ProfileDesignControllerTest < ActionController::TestCase |
| 283 | 283 | assert_response :success |
| 284 | 284 | |
| 285 | 285 | assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock1) |
| 286 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock2) | |
| 287 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock3) | |
| 288 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock4) | |
| 286 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock2) | |
| 287 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock3) | |
| 288 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock4) | |
| 289 | 289 | assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock5) |
| 290 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock6) | |
| 291 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock7) | |
| 292 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock8) | |
| 290 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock6) | |
| 291 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock7) | |
| 292 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock8) | |
| 293 | 293 | end |
| 294 | 294 | |
| 295 | 295 | should 'not edit main block with never option' do |
| ... | ... | @@ -726,7 +726,7 @@ class ProfileDesignControllerTest < ActionController::TestCase |
| 726 | 726 | end |
| 727 | 727 | |
| 728 | 728 | Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([TestBlockPlugin.new]) |
| 729 | - assert !@controller.available_blocks.include?(CustomBlock1) | |
| 729 | + refute @controller.available_blocks.include?(CustomBlock1) | |
| 730 | 730 | end |
| 731 | 731 | |
| 732 | 732 | should 'clone a block' do | ... | ... |
test/functional/profile_editor_controller_test.rb
| ... | ... | @@ -333,7 +333,7 @@ class ProfileEditorControllerTest < ActionController::TestCase |
| 333 | 333 | |
| 334 | 334 | post :edit, :profile => org.identifier, :profile_data => { :closed => 'false' } |
| 335 | 335 | org.reload |
| 336 | - assert !org.closed | |
| 336 | + refute org.closed | |
| 337 | 337 | end |
| 338 | 338 | |
| 339 | 339 | should 'not display option to close when it is enterprise' do |
| ... | ... | @@ -477,13 +477,13 @@ class ProfileEditorControllerTest < ActionController::TestCase |
| 477 | 477 | should 'not enable enterprise without confirmation' do |
| 478 | 478 | ent = fast_create(Enterprise, :enabled => false) |
| 479 | 479 | post :enable, :profile => ent.identifier |
| 480 | - assert !assigns(:to_enable).enabled? | |
| 480 | + refute assigns(:to_enable).enabled? | |
| 481 | 481 | end |
| 482 | 482 | |
| 483 | 483 | should 'disable enterprise after confirmation' do |
| 484 | 484 | ent = fast_create(Enterprise, :enabled => true) |
| 485 | 485 | post :disable, :profile => ent.identifier, :confirmation => 1 |
| 486 | - assert !assigns(:to_disable).enabled? | |
| 486 | + refute assigns(:to_disable).enabled? | |
| 487 | 487 | end |
| 488 | 488 | |
| 489 | 489 | should 'not disable enterprise without confirmation' do |
| ... | ... | @@ -883,7 +883,7 @@ class ProfileEditorControllerTest < ActionController::TestCase |
| 883 | 883 | should 'have welcome_page only for template' do |
| 884 | 884 | organization = fast_create(Organization, :is_template => false) |
| 885 | 885 | @controller.stubs(:profile).returns(organization) |
| 886 | - assert !@controller.send(:has_welcome_page) | |
| 886 | + refute @controller.send(:has_welcome_page) | |
| 887 | 887 | |
| 888 | 888 | organization = fast_create(Organization, :is_template => true) |
| 889 | 889 | @controller.stubs(:profile).returns(organization) |
| ... | ... | @@ -891,7 +891,7 @@ class ProfileEditorControllerTest < ActionController::TestCase |
| 891 | 891 | |
| 892 | 892 | person = fast_create(Person, :is_template => false) |
| 893 | 893 | @controller.stubs(:profile).returns(person) |
| 894 | - assert !@controller.send(:has_welcome_page) | |
| 894 | + refute @controller.send(:has_welcome_page) | |
| 895 | 895 | |
| 896 | 896 | person = fast_create(Person, :is_template => true) |
| 897 | 897 | @controller.stubs(:profile).returns(person) |
| ... | ... | @@ -916,7 +916,7 @@ class ProfileEditorControllerTest < ActionController::TestCase |
| 916 | 916 | |
| 917 | 917 | should 'create welcome_page with public false by default' do |
| 918 | 918 | get :welcome_page, :profile => fast_create(Person, :is_template => true).identifier |
| 919 | - assert !assigns(:welcome_page).published | |
| 919 | + refute assigns(:welcome_page).published | |
| 920 | 920 | end |
| 921 | 921 | |
| 922 | 922 | should 'update welcome page and redirect to index' do | ... | ... |
test/functional/region_validators_controller_test.rb
| ... | ... | @@ -26,7 +26,7 @@ class RegionValidatorsControllerTest < ActionController::TestCase |
| 26 | 26 | give_permission('ze', 'manage_environment_validators', environment) |
| 27 | 27 | region = Region.new(:name => 'my region') |
| 28 | 28 | environment.regions << region |
| 29 | - assert !region.new_record? | |
| 29 | + refute region.new_record? | |
| 30 | 30 | |
| 31 | 31 | @controller.expects(:environment).returns(environment).at_least_once |
| 32 | 32 | |
| ... | ... | @@ -42,7 +42,7 @@ class RegionValidatorsControllerTest < ActionController::TestCase |
| 42 | 42 | give_permission('ze', 'manage_environment_validators', environment) |
| 43 | 43 | region = Region.new(:name => 'my region') |
| 44 | 44 | environment.regions << region |
| 45 | - assert !region.new_record? | |
| 45 | + refute region.new_record? | |
| 46 | 46 | org = create(Organization, :name => "My frufru organization", :identifier => 'frufru', :environment_id => environment.id) |
| 47 | 47 | |
| 48 | 48 | @controller.expects(:environment).returns(environment).at_least_once |
| ... | ... | @@ -58,7 +58,7 @@ class RegionValidatorsControllerTest < ActionController::TestCase |
| 58 | 58 | give_permission('ze', 'manage_environment_validators', environment) |
| 59 | 59 | region = Region.new(:name => 'my region') |
| 60 | 60 | environment.regions << region |
| 61 | - assert !region.new_record? | |
| 61 | + refute region.new_record? | |
| 62 | 62 | org = create(Organization, :name => "My frufru organization", :identifier => 'frufru', :environment_id => environment.id) |
| 63 | 63 | |
| 64 | 64 | @controller.expects(:environment).returns(environment).at_least_once |
| ... | ... | @@ -75,7 +75,7 @@ class RegionValidatorsControllerTest < ActionController::TestCase |
| 75 | 75 | give_permission('ze', 'manage_environment_validators', environment) |
| 76 | 76 | region = Region.new(:name => 'my region') |
| 77 | 77 | environment.regions << region |
| 78 | - assert !region.new_record? | |
| 78 | + refute region.new_record? | |
| 79 | 79 | org = create(Organization, :name => "My frufru organization", :identifier => 'frufru', :environment_id => environment.id) |
| 80 | 80 | region.validators << org |
| 81 | 81 | |
| ... | ... | @@ -85,7 +85,7 @@ class RegionValidatorsControllerTest < ActionController::TestCase |
| 85 | 85 | assert_response :redirect |
| 86 | 86 | assert_redirected_to :action => 'region', :id => region.id |
| 87 | 87 | |
| 88 | - assert !Region.find(region.id).validators.include?(org) | |
| 88 | + refute Region.find(region.id).validators.include?(org) | |
| 89 | 89 | end |
| 90 | 90 | |
| 91 | 91 | end | ... | ... |
test/functional/search_controller_test.rb
| ... | ... | @@ -267,11 +267,11 @@ class SearchControllerTest < ActionController::TestCase |
| 267 | 267 | get :index, :query => 'something' |
| 268 | 268 | |
| 269 | 269 | assert assigns(:searches).has_key?(:articles) |
| 270 | - assert !assigns(:searches).has_key?(:enterprises) | |
| 271 | - assert !assigns(:searches).has_key?(:people) | |
| 272 | - assert !assigns(:searches).has_key?(:communities) | |
| 273 | - assert !assigns(:searches).has_key?(:products) | |
| 274 | - assert !assigns(:searches).has_key?(:events) | |
| 270 | + refute assigns(:searches).has_key?(:enterprises) | |
| 271 | + refute assigns(:searches).has_key?(:people) | |
| 272 | + refute assigns(:searches).has_key?(:communities) | |
| 273 | + refute assigns(:searches).has_key?(:products) | |
| 274 | + refute assigns(:searches).has_key?(:events) | |
| 275 | 275 | end |
| 276 | 276 | |
| 277 | 277 | should 'search all enabled assets in general search' do |
| ... | ... | @@ -288,7 +288,7 @@ class SearchControllerTest < ActionController::TestCase |
| 288 | 288 | [:articles, :enterprises, :people, :communities, :products, :events].select do |key, name| |
| 289 | 289 | !assigns(:environment).enabled?('disable_asset_' + key.to_s) |
| 290 | 290 | end.each do |asset| |
| 291 | - assert !assigns(:searches)[asset][:results].empty? | |
| 291 | + refute assigns(:searches)[asset][:results].empty? | |
| 292 | 292 | end |
| 293 | 293 | end |
| 294 | 294 | ... | ... |
test/functional/spam_controller_test.rb
| ... | ... | @@ -40,13 +40,13 @@ class SpamControllerTest < ActionController::TestCase |
| 40 | 40 | test "should remove comments" do |
| 41 | 41 | post :index, :profile => @community.identifier, :remove_comment => @spam_comment.id |
| 42 | 42 | |
| 43 | - assert !Comment.exists?(@spam_comment.id) | |
| 43 | + refute Comment.exists?(@spam_comment.id) | |
| 44 | 44 | end |
| 45 | 45 | |
| 46 | 46 | test "should remove suggest articles" do |
| 47 | 47 | post :index, :profile => @community.identifier, :remove_task => @spam_suggest_article.id |
| 48 | 48 | |
| 49 | - assert !SuggestArticle.exists?(@spam_suggest_article.id) | |
| 49 | + refute SuggestArticle.exists?(@spam_suggest_article.id) | |
| 50 | 50 | end |
| 51 | 51 | |
| 52 | 52 | should 'properly render spam that have replies' do | ... | ... |
test/functional/tasks_controller_test.rb
| ... | ... | @@ -517,7 +517,7 @@ class TasksControllerTest < ActionController::TestCase |
| 517 | 517 | post :change_responsible, :task_id => task.id, :responsible_id => person2.id, :old_responsible => nil |
| 518 | 518 | assert_equal person1, task.reload.responsible |
| 519 | 519 | json_response = ActiveSupport::JSON.decode(response.body) |
| 520 | - assert !json_response['success'] | |
| 520 | + refute json_response['success'] | |
| 521 | 521 | end |
| 522 | 522 | |
| 523 | 523 | should 'list tasks for user with only view_tasks permission' do | ... | ... |
test/functional/trusted_sites_controller_test.rb
| ... | ... | @@ -40,14 +40,14 @@ class TrustedSitesControllerTest < ActionController::TestCase |
| 40 | 40 | @controller.stubs(:add_trusted_site).returns(false) |
| 41 | 41 | post :create, :site => 'new.site.com' |
| 42 | 42 | assert_response :success # it actually failed, but was not redirected |
| 43 | - assert !assigns(:environment).trusted_sites_for_iframe.include?('new.site.com'), 'Site was included in the trusted_sites!?' | |
| 43 | + refute assigns(:environment).trusted_sites_for_iframe.include?('new.site.com'), 'Site was included in the trusted_sites!?' | |
| 44 | 44 | end |
| 45 | 45 | |
| 46 | 46 | should 'destroy site' do |
| 47 | 47 | post :create, :site => 'todel.site.com' |
| 48 | 48 | delete :destroy, :site => 'todel.site.com' |
| 49 | 49 | assert_redirected_to :action => :index |
| 50 | - assert ! assigns(:environment).trusted_sites_for_iframe.include?('todel.site.com'), 'Site was not removed from trusted_sites' | |
| 50 | + refute assigns(:environment).trusted_sites_for_iframe.include?('todel.site.com'), 'Site was not removed from trusted_sites' | |
| 51 | 51 | end |
| 52 | 52 | |
| 53 | 53 | should "get edit" do |
| ... | ... | @@ -64,7 +64,7 @@ class TrustedSitesControllerTest < ActionController::TestCase |
| 64 | 64 | post :create, :site => 'toedit.site.com' |
| 65 | 65 | post :update, :orig_site => 'toedit.site.com', :site => 'edited.site.com' |
| 66 | 66 | assert_redirected_to :action => :edit |
| 67 | - assert ! assigns(:environment).trusted_sites_for_iframe.include?('toedit.site.com'), 'Original site found. Site was not updated?' | |
| 67 | + refute assigns(:environment).trusted_sites_for_iframe.include?('toedit.site.com'), 'Original site found. Site was not updated?' | |
| 68 | 68 | assert assigns(:environment).trusted_sites_for_iframe.include?('edited.site.com'), 'New name for site not found. Site was not updated?' |
| 69 | 69 | end |
| 70 | 70 | |
| ... | ... | @@ -74,6 +74,6 @@ class TrustedSitesControllerTest < ActionController::TestCase |
| 74 | 74 | post :update, :orig_site => 'toedit.site.com', :site => 'edited.site.com' |
| 75 | 75 | assert_response :success # it actually failed, but was not redirected |
| 76 | 76 | assert assigns(:environment).trusted_sites_for_iframe.include?('toedit.site.com'), 'Original site not found. Site was updated?' |
| 77 | - assert !assigns(:environment).trusted_sites_for_iframe.include?('edited.site.com'), 'New name for site found. Site was updated?' | |
| 77 | + refute assigns(:environment).trusted_sites_for_iframe.include?('edited.site.com'), 'New name for site found. Site was updated?' | |
| 78 | 78 | end |
| 79 | 79 | end | ... | ... |
test/functional/users_controller_test.rb
test/integration/manage_friendships_test.rb
| ... | ... | @@ -31,7 +31,7 @@ class ManageFriendshipsTest < ActionController::IntegrationTest |
| 31 | 31 | follow_redirect! |
| 32 | 32 | |
| 33 | 33 | assert assigns(:friends).empty? |
| 34 | - assert !@person.is_a_friend?(@friend) | |
| 35 | - assert !@friend.is_a_friend?(@person) | |
| 34 | + refute @person.is_a_friend?(@friend) | |
| 35 | + refute @friend.is_a_friend?(@person) | |
| 36 | 36 | end |
| 37 | 37 | end | ... | ... |
test/integration/varnish_conf_test.rb
| ... | ... | @@ -3,7 +3,7 @@ require 'test/unit' |
| 3 | 3 | class VarnishConfTest < Test::Unit::TestCase |
| 4 | 4 | |
| 5 | 5 | def test_not_use_return_in_varnish_noosfero |
| 6 | - assert !system('grep "return.*pass" etc/noosfero/varnish-noosfero.vcl') | |
| 6 | + refute system('grep "return.*pass" etc/noosfero/varnish-noosfero.vcl') | |
| 7 | 7 | end |
| 8 | 8 | |
| 9 | 9 | end | ... | ... |
test/unit/abuse_complaint_test.rb
| ... | ... | @@ -6,7 +6,7 @@ class AbuseComplaintTest < ActiveSupport::TestCase |
| 6 | 6 | reported = fast_create(Profile) |
| 7 | 7 | abuse_complaint = AbuseComplaint.new |
| 8 | 8 | |
| 9 | - assert !abuse_complaint.valid? | |
| 9 | + refute abuse_complaint.valid? | |
| 10 | 10 | assert abuse_complaint.errors[:reported].any? |
| 11 | 11 | |
| 12 | 12 | abuse_complaint.reported = reported |
| ... | ... | @@ -54,6 +54,6 @@ class AbuseComplaintTest < ActiveSupport::TestCase |
| 54 | 54 | |
| 55 | 55 | reported.destroy |
| 56 | 56 | |
| 57 | - assert !AbuseComplaint.find_by_requestor_id(reported_id), "AbuseComplaint still exist!" | |
| 57 | + refute AbuseComplaint.find_by_requestor_id(reported_id), "AbuseComplaint still exist!" | |
| 58 | 58 | end |
| 59 | 59 | end | ... | ... |
test/unit/abuse_report_test.rb
| ... | ... | @@ -13,7 +13,7 @@ class AbuseReportTest < ActiveSupport::TestCase |
| 13 | 13 | should 'ensure presence of complaint, reporter and reported' do |
| 14 | 14 | abuse_report = AbuseReport.new(:reason => 'some reason') |
| 15 | 15 | |
| 16 | - assert !abuse_report.valid? | |
| 16 | + refute abuse_report.valid? | |
| 17 | 17 | assert abuse_report.invalid?(:reporter) |
| 18 | 18 | assert abuse_report.invalid?(:abuse_complaint) |
| 19 | 19 | ... | ... |
test/unit/action_tracker_notification_test.rb
| ... | ... | @@ -9,7 +9,7 @@ class ActionTrackerNotificationTest < ActiveSupport::TestCase |
| 9 | 9 | |
| 10 | 10 | a.profile_id= 1 |
| 11 | 11 | a.valid? |
| 12 | - assert !a.errors[:profile_id.to_s].present? | |
| 12 | + refute a.errors[:profile_id.to_s].present? | |
| 13 | 13 | end |
| 14 | 14 | |
| 15 | 15 | should "have the action tracker" do |
| ... | ... | @@ -19,7 +19,7 @@ class ActionTrackerNotificationTest < ActiveSupport::TestCase |
| 19 | 19 | |
| 20 | 20 | a.action_tracker_id= 1 |
| 21 | 21 | a.valid? |
| 22 | - assert !a.errors[:action_tracker_id.to_s].present? | |
| 22 | + refute a.errors[:action_tracker_id.to_s].present? | |
| 23 | 23 | end |
| 24 | 24 | |
| 25 | 25 | should "be associated to Person" do |
| ... | ... | @@ -58,7 +58,7 @@ class ActionTrackerNotificationTest < ActiveSupport::TestCase |
| 58 | 58 | |
| 59 | 59 | atn.profile_id = 2 |
| 60 | 60 | atn.valid? |
| 61 | - assert !atn.errors[:action_tracker_id.to_s].present? | |
| 61 | + refute atn.errors[:action_tracker_id.to_s].present? | |
| 62 | 62 | end |
| 63 | 63 | |
| 64 | 64 | should "the action_tracker_id be unique on scope of profile when created by ActionTracker::Record association" do | ... | ... |
test/unit/acts_as_having_settings_test.rb
| ... | ... | @@ -23,8 +23,8 @@ class ActsAsHavingSettingsTest < ActiveSupport::TestCase |
| 23 | 23 | block_class = Class.new(Block) |
| 24 | 24 | |
| 25 | 25 | block = block_class.new |
| 26 | - assert !block.respond_to?(:limit) | |
| 27 | - assert !block.respond_to?(:limit=) | |
| 26 | + refute block.respond_to?(:limit) | |
| 27 | + refute block.respond_to?(:limit=) | |
| 28 | 28 | |
| 29 | 29 | block_class.settings_items :limit |
| 30 | 30 | |
| ... | ... | @@ -89,7 +89,7 @@ class ActsAsHavingSettingsTest < ActiveSupport::TestCase |
| 89 | 89 | |
| 90 | 90 | should 'setting_changed be false if a setting passed as parameter was not changed' do |
| 91 | 91 | obj = TestClass.new |
| 92 | - assert !obj.setting_changed?('flag') | |
| 92 | + refute obj.setting_changed?('flag') | |
| 93 | 93 | end |
| 94 | 94 | |
| 95 | 95 | should 'setting_changed be false if a setting passed as parameter was changed with the same value' do |
| ... | ... | @@ -97,14 +97,14 @@ class ActsAsHavingSettingsTest < ActiveSupport::TestCase |
| 97 | 97 | obj.flag = true |
| 98 | 98 | obj.save |
| 99 | 99 | obj.flag = true |
| 100 | - assert !obj.setting_changed?('flag') | |
| 100 | + refute obj.setting_changed?('flag') | |
| 101 | 101 | end |
| 102 | 102 | |
| 103 | 103 | should 'setting_changed be false if a setting passed as parameter was not changed but another setting is changed' do |
| 104 | 104 | obj = TestClass.new(:name => 'some name') |
| 105 | 105 | obj.save |
| 106 | 106 | obj.name = 'antoher nme' |
| 107 | - assert !obj.setting_changed?('flag') | |
| 107 | + refute obj.setting_changed?('flag') | |
| 108 | 108 | end |
| 109 | 109 | |
| 110 | 110 | should 'setting_changed be true for all changed fields' do | ... | ... |
test/unit/add_friend_test.rb
| ... | ... | @@ -101,7 +101,7 @@ class AddFriendTest < ActiveSupport::TestCase |
| 101 | 101 | |
| 102 | 102 | task.group_for_person = 'short name' |
| 103 | 103 | task.valid? |
| 104 | - assert !task.errors[:group_for_person].present? | |
| 104 | + refute task.errors[:group_for_person].present? | |
| 105 | 105 | end |
| 106 | 106 | |
| 107 | 107 | should 'limit "group for friend" number of characters' do |
| ... | ... | @@ -115,7 +115,7 @@ class AddFriendTest < ActiveSupport::TestCase |
| 115 | 115 | |
| 116 | 116 | task.group_for_friend = 'short name' |
| 117 | 117 | task.valid? |
| 118 | - assert !task.errors[:group_for_friend].present? | |
| 118 | + refute task.errors[:group_for_friend].present? | |
| 119 | 119 | end |
| 120 | 120 | |
| 121 | 121 | should 'have target notification message if is organization and not moderated' do | ... | ... |
test/unit/application_helper_test.rb
| ... | ... | @@ -794,7 +794,7 @@ class ApplicationHelperTest < ActionView::TestCase |
| 794 | 794 | article = fast_create(Article, :name => 'my article') |
| 795 | 795 | response = content_id_to_str(article) |
| 796 | 796 | assert_equal String, response.class |
| 797 | - assert !response.empty? | |
| 797 | + refute response.empty? | |
| 798 | 798 | end |
| 799 | 799 | |
| 800 | 800 | should 'content_id_to_str return empty string when receiving nil' do | ... | ... |
test/unit/approve_article_test.rb
| ... | ... | @@ -85,7 +85,7 @@ class ApproveArticleTest < ActiveSupport::TestCase |
| 85 | 85 | community.stubs(:notification_emails).returns(['adm@example.com']) |
| 86 | 86 | |
| 87 | 87 | a = create(ApproveArticle, :name => '', :article => article, :target => community, :requestor => profile) |
| 88 | - assert !ActionMailer::Base.deliveries.empty? | |
| 88 | + refute ActionMailer::Base.deliveries.empty? | |
| 89 | 89 | end |
| 90 | 90 | |
| 91 | 91 | should 'not notify target if group is not moderated' do |
| ... | ... | @@ -167,7 +167,7 @@ class ApproveArticleTest < ActiveSupport::TestCase |
| 167 | 167 | a = create(ApproveArticle, :article => article, :target => community, :requestor => profile) |
| 168 | 168 | a.finish |
| 169 | 169 | |
| 170 | - assert !community.has_blog? | |
| 170 | + refute community.has_blog? | |
| 171 | 171 | assert_nil article.class.last.parent |
| 172 | 172 | end |
| 173 | 173 | ... | ... |
test/unit/approve_comment_test.rb
| ... | ... | @@ -162,7 +162,7 @@ class ApproveCommentTest < ActiveSupport::TestCase |
| 162 | 162 | |
| 163 | 163 | should 'accept_disabled be false if there is an article associated to task' do |
| 164 | 164 | a = ApproveComment.new(:comment_attributes => @comment.attributes.to_json) |
| 165 | - assert !a.accept_disabled? | |
| 165 | + refute a.accept_disabled? | |
| 166 | 166 | end |
| 167 | 167 | |
| 168 | 168 | should 'have target notification description' do | ... | ... |
test/unit/article_test.rb
| ... | ... | @@ -18,7 +18,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 18 | 18 | |
| 19 | 19 | a.profile = profile |
| 20 | 20 | a.valid? |
| 21 | - assert !a.errors[:profile_id.to_s].present? | |
| 21 | + refute a.errors[:profile_id.to_s].present? | |
| 22 | 22 | end |
| 23 | 23 | |
| 24 | 24 | should 'require value for name' do |
| ... | ... | @@ -28,7 +28,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 28 | 28 | |
| 29 | 29 | a.name = 'my article' |
| 30 | 30 | a.valid? |
| 31 | - assert !a.errors[:name.to_s].present? | |
| 31 | + refute a.errors[:name.to_s].present? | |
| 32 | 32 | end |
| 33 | 33 | |
| 34 | 34 | should 'limit length of names' do |
| ... | ... | @@ -38,7 +38,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 38 | 38 | |
| 39 | 39 | a.name = 'a'*150 |
| 40 | 40 | a.valid? |
| 41 | - assert !a.errors[:name.to_s].present? | |
| 41 | + refute a.errors[:name.to_s].present? | |
| 42 | 42 | end |
| 43 | 43 | |
| 44 | 44 | should 'require value for slug and path if name is filled' do |
| ... | ... | @@ -53,8 +53,8 @@ class ArticleTest < ActiveSupport::TestCase |
| 53 | 53 | should 'not require value for slug and path if name is blank' do |
| 54 | 54 | a = Article.new |
| 55 | 55 | a.valid? |
| 56 | - assert !a.errors[:slug.to_s].present? | |
| 57 | - assert !a.errors[:path.to_s].present? | |
| 56 | + refute a.errors[:slug.to_s].present? | |
| 57 | + refute a.errors[:path.to_s].present? | |
| 58 | 58 | end |
| 59 | 59 | |
| 60 | 60 | should 'act as versioned' do |
| ... | ... | @@ -145,7 +145,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 145 | 145 | a3 = profile.articles.build(:name => 'test') |
| 146 | 146 | a3.parent = a1 |
| 147 | 147 | a3.valid? |
| 148 | - assert !a3.errors[:slug.to_s].present? | |
| 148 | + refute a3.errors[:slug.to_s].present? | |
| 149 | 149 | a3.save! |
| 150 | 150 | |
| 151 | 151 | # cannot add another child of a1 with same slug |
| ... | ... | @@ -352,11 +352,11 @@ class ArticleTest < ActiveSupport::TestCase |
| 352 | 352 | end |
| 353 | 353 | |
| 354 | 354 | should 'identify itself as a non-folder' do |
| 355 | - assert !Article.new.folder?, 'should identify itself as non-folder' | |
| 355 | + refute Article.new.folder?, 'should identify itself as non-folder' | |
| 356 | 356 | end |
| 357 | 357 | |
| 358 | 358 | should 'identify itself as a non-blog' do |
| 359 | - assert !Article.new.blog?, 'should identify itself as non-blog' | |
| 359 | + refute Article.new.blog?, 'should identify itself as non-blog' | |
| 360 | 360 | end |
| 361 | 361 | |
| 362 | 362 | should 'always display if public content' do |
| ... | ... | @@ -425,7 +425,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 425 | 425 | |
| 426 | 426 | assert_equivalent [c2, c3], art.categories(true) |
| 427 | 427 | assert_includes art.categories_including_virtual(true), c1 |
| 428 | - assert !art.categories_including_virtual(true).include?(c4) | |
| 428 | + refute art.categories_including_virtual(true).include?(c4) | |
| 429 | 429 | end |
| 430 | 430 | |
| 431 | 431 | should 'be able to create an article already with categories' do |
| ... | ... | @@ -459,7 +459,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 459 | 459 | end |
| 460 | 460 | |
| 461 | 461 | should 'not accept Product category as category' do |
| 462 | - assert !Article.new.accept_category?(ProductCategory.new) | |
| 462 | + refute Article.new.accept_category?(ProductCategory.new) | |
| 463 | 463 | end |
| 464 | 464 | |
| 465 | 465 | should 'accept published attribute' do |
| ... | ... | @@ -471,7 +471,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 471 | 471 | profile = fast_create(Profile, :name => 'test profile', :identifier => 'test_profile') |
| 472 | 472 | article = fast_create(Article, :name => 'test article', :profile_id => profile.id, :published => false) |
| 473 | 473 | |
| 474 | - assert !article.display_to?(nil) | |
| 474 | + refute article.display_to?(nil) | |
| 475 | 475 | end |
| 476 | 476 | |
| 477 | 477 | should 'say that not member of profile cannot see private article' do |
| ... | ... | @@ -479,7 +479,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 479 | 479 | article = fast_create(Article, :name => 'test article', :profile_id => profile.id, :published => false) |
| 480 | 480 | person = create_user('test_user').person |
| 481 | 481 | |
| 482 | - assert !article.display_to?(person) | |
| 482 | + refute article.display_to?(person) | |
| 483 | 483 | end |
| 484 | 484 | |
| 485 | 485 | should 'say that member user can not see private article' do |
| ... | ... | @@ -488,7 +488,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 488 | 488 | person = create_user('test_user').person |
| 489 | 489 | profile.affiliate(person, Profile::Roles.member(profile.environment.id)) |
| 490 | 490 | |
| 491 | - assert !article.display_to?(person) | |
| 491 | + refute article.display_to?(person) | |
| 492 | 492 | end |
| 493 | 493 | |
| 494 | 494 | should 'say that profile admin can see private article' do |
| ... | ... | @@ -526,7 +526,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 526 | 526 | folder = fast_create(Folder, :name => 'my_intranet', :profile_id => profile.id, :published => false) |
| 527 | 527 | article = fast_create(Article, :name => 'my private article', :profile_id => profile.id, :parent_id => folder.id) |
| 528 | 528 | |
| 529 | - assert !article.published? | |
| 529 | + refute article.published? | |
| 530 | 530 | end |
| 531 | 531 | |
| 532 | 532 | should 'save as private' do |
| ... | ... | @@ -538,7 +538,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 538 | 538 | article.save! |
| 539 | 539 | article.reload |
| 540 | 540 | |
| 541 | - assert !article.published? | |
| 541 | + refute article.published? | |
| 542 | 542 | end |
| 543 | 543 | |
| 544 | 544 | should 'not allow friends of private person see the article' do |
| ... | ... | @@ -549,7 +549,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 549 | 549 | person.save! |
| 550 | 550 | friend.save! |
| 551 | 551 | |
| 552 | - assert !article.display_to?(friend) | |
| 552 | + refute article.display_to?(friend) | |
| 553 | 553 | end |
| 554 | 554 | |
| 555 | 555 | should 'display private articles to people who can view private content' do |
| ... | ... | @@ -661,7 +661,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 661 | 661 | p = create_user('user_blog_test').person |
| 662 | 662 | folder = fast_create(Folder, :name => 'Not Blog', :profile_id => p.id) |
| 663 | 663 | a = fast_create(TextileArticle, :name => 'Not blog post', :profile_id => p.id, :parent_id => folder.id) |
| 664 | - assert !a.belongs_to_blog? | |
| 664 | + refute a.belongs_to_blog? | |
| 665 | 665 | end |
| 666 | 666 | |
| 667 | 667 | should 'has comments notifier true by default' do |
| ... | ... | @@ -690,7 +690,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 690 | 690 | should 'moderate_comments? return false if moderate_comments variable is false' do |
| 691 | 691 | a = Article.new |
| 692 | 692 | a.moderate_comments= false |
| 693 | - assert !a.moderate_comments? | |
| 693 | + refute a.moderate_comments? | |
| 694 | 694 | end |
| 695 | 695 | |
| 696 | 696 | should 'hold hits count' do |
| ... | ... | @@ -761,7 +761,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 761 | 761 | |
| 762 | 762 | should 'not be highlighted by default' do |
| 763 | 763 | a = Article.new |
| 764 | - assert !a.highlighted | |
| 764 | + refute a.highlighted | |
| 765 | 765 | end |
| 766 | 766 | |
| 767 | 767 | should 'get tagged with tag' do |
| ... | ... | @@ -1009,7 +1009,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 1009 | 1009 | |
| 1010 | 1010 | should 'notifiable is false by default' do |
| 1011 | 1011 | a = fast_create(Article) |
| 1012 | - assert !a.notifiable? | |
| 1012 | + refute a.notifiable? | |
| 1013 | 1013 | end |
| 1014 | 1014 | |
| 1015 | 1015 | should 'not notify activity by default on create' do |
| ... | ... | @@ -1205,11 +1205,11 @@ class ArticleTest < ActiveSupport::TestCase |
| 1205 | 1205 | end |
| 1206 | 1206 | |
| 1207 | 1207 | should 'not be a forum by default' do |
| 1208 | - assert !fast_create(Article).forum? | |
| 1208 | + refute fast_create(Article).forum? | |
| 1209 | 1209 | end |
| 1210 | 1210 | |
| 1211 | 1211 | should 'not have posts by default' do |
| 1212 | - assert !fast_create(Article).has_posts? | |
| 1212 | + refute fast_create(Article).has_posts? | |
| 1213 | 1213 | end |
| 1214 | 1214 | |
| 1215 | 1215 | should 'get article galleries' do |
| ... | ... | @@ -1243,21 +1243,21 @@ class ArticleTest < ActiveSupport::TestCase |
| 1243 | 1243 | assert a.errors[:language.to_s].present? |
| 1244 | 1244 | a.language = 'en' |
| 1245 | 1245 | a.valid? |
| 1246 | - assert !a.errors[:language.to_s].present? | |
| 1246 | + refute a.errors[:language.to_s].present? | |
| 1247 | 1247 | end |
| 1248 | 1248 | |
| 1249 | 1249 | should 'language can be blank' do |
| 1250 | 1250 | a = build(Article) |
| 1251 | 1251 | a.valid? |
| 1252 | - assert !a.errors[:language.to_s].present? | |
| 1252 | + refute a.errors[:language.to_s].present? | |
| 1253 | 1253 | a.language = '' |
| 1254 | 1254 | a.valid? |
| 1255 | - assert !a.errors[:language.to_s].present? | |
| 1255 | + refute a.errors[:language.to_s].present? | |
| 1256 | 1256 | end |
| 1257 | 1257 | |
| 1258 | 1258 | should 'article is not translatable' do |
| 1259 | 1259 | a = build(Article) |
| 1260 | - assert !a.translatable? | |
| 1260 | + refute a.translatable? | |
| 1261 | 1261 | end |
| 1262 | 1262 | |
| 1263 | 1263 | should 'get native translation' do |
| ... | ... | @@ -1272,7 +1272,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 1272 | 1272 | native_article = fast_create(Article, :language => 'pt', :profile_id => fast_create(Profile).id ) |
| 1273 | 1273 | article_translation = fast_create(Article, :language => 'en', :translation_of_id => native_article.id) |
| 1274 | 1274 | possible_translations = native_article.possible_translations |
| 1275 | - assert !possible_translations.include?('en') | |
| 1275 | + refute possible_translations.include?('en') | |
| 1276 | 1276 | assert possible_translations.include?('pt') |
| 1277 | 1277 | end |
| 1278 | 1278 | |
| ... | ... | @@ -1286,7 +1286,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 1286 | 1286 | assert a.errors[:language.to_s].present? |
| 1287 | 1287 | a.language = 'es' |
| 1288 | 1288 | a.valid? |
| 1289 | - assert !a.errors[:language.to_s].present? | |
| 1289 | + refute a.errors[:language.to_s].present? | |
| 1290 | 1290 | end |
| 1291 | 1291 | |
| 1292 | 1292 | should 'verify if native translation is already in use' do |
| ... | ... | @@ -1298,7 +1298,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 1298 | 1298 | assert a.errors[:language.to_s].present? |
| 1299 | 1299 | a.language = 'es' |
| 1300 | 1300 | a.valid? |
| 1301 | - assert !a.errors[:language.to_s].present? | |
| 1301 | + refute a.errors[:language.to_s].present? | |
| 1302 | 1302 | end |
| 1303 | 1303 | |
| 1304 | 1304 | should 'translation have a language' do |
| ... | ... | @@ -1309,7 +1309,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 1309 | 1309 | assert a.errors[:language.to_s].present? |
| 1310 | 1310 | a.language = 'en' |
| 1311 | 1311 | a.valid? |
| 1312 | - assert !a.errors[:language.to_s].present? | |
| 1312 | + refute a.errors[:language.to_s].present? | |
| 1313 | 1313 | end |
| 1314 | 1314 | |
| 1315 | 1315 | should 'native translation have a language' do |
| ... | ... | @@ -1387,10 +1387,10 @@ class ArticleTest < ActiveSupport::TestCase |
| 1387 | 1387 | |
| 1388 | 1388 | should 'not list own language as a possible translation if language has changed' do |
| 1389 | 1389 | a = build(Article, :language => 'pt', :profile_id => fast_create(Profile).id) |
| 1390 | - assert !a.possible_translations.include?('pt') | |
| 1390 | + refute a.possible_translations.include?('pt') | |
| 1391 | 1391 | a = fast_create(Article, :language => 'pt', :profile_id => fast_create(Profile).id ) |
| 1392 | 1392 | a.language = 'en' |
| 1393 | - assert !a.possible_translations.include?('en') | |
| 1393 | + refute a.possible_translations.include?('en') | |
| 1394 | 1394 | end |
| 1395 | 1395 | |
| 1396 | 1396 | should 'list own language as a possible translation if language has not changed' do |
| ... | ... | @@ -1430,7 +1430,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 1430 | 1430 | end |
| 1431 | 1431 | |
| 1432 | 1432 | should 'tiny mce editor is disabled by default' do |
| 1433 | - assert !Article.new.tiny_mce? | |
| 1433 | + refute Article.new.tiny_mce? | |
| 1434 | 1434 | end |
| 1435 | 1435 | |
| 1436 | 1436 | should 'return only folders' do |
| ... | ... | @@ -1474,19 +1474,19 @@ class ArticleTest < ActiveSupport::TestCase |
| 1474 | 1474 | |
| 1475 | 1475 | should 'not accept uploads if has no parent' do |
| 1476 | 1476 | child = fast_create(UploadedFile) |
| 1477 | - assert !child.accept_uploads? | |
| 1477 | + refute child.accept_uploads? | |
| 1478 | 1478 | end |
| 1479 | 1479 | |
| 1480 | 1480 | should 'not accept uploads if parent is a blog' do |
| 1481 | 1481 | folder = fast_create(Blog) |
| 1482 | 1482 | child = fast_create(UploadedFile, :parent_id => folder.id) |
| 1483 | - assert !child.accept_uploads? | |
| 1483 | + refute child.accept_uploads? | |
| 1484 | 1484 | end |
| 1485 | 1485 | |
| 1486 | 1486 | should 'not accept uploads if parent is a forum' do |
| 1487 | 1487 | folder = fast_create(Forum) |
| 1488 | 1488 | child = fast_create(UploadedFile, :parent_id => folder.id) |
| 1489 | - assert !child.accept_uploads? | |
| 1489 | + refute child.accept_uploads? | |
| 1490 | 1490 | end |
| 1491 | 1491 | |
| 1492 | 1492 | should 'get images paths in article body' do |
| ... | ... | @@ -1684,7 +1684,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 1684 | 1684 | should 'not crash on allow_edit without a current user' do |
| 1685 | 1685 | a = build(Article) |
| 1686 | 1686 | a.allow_members_to_edit = true |
| 1687 | - assert !a.allow_edit?(nil) | |
| 1687 | + refute a.allow_edit?(nil) | |
| 1688 | 1688 | end |
| 1689 | 1689 | |
| 1690 | 1690 | should 'allow author to edit topic' do |
| ... | ... | @@ -1834,13 +1834,13 @@ class ArticleTest < ActiveSupport::TestCase |
| 1834 | 1834 | p = create_user('user_forum_test').person |
| 1835 | 1835 | blog = fast_create(Blog, :name => 'Not Forum', :profile_id => p.id) |
| 1836 | 1836 | a = fast_create(TextileArticle, :name => 'Not forum post', :profile_id => p.id, :parent_id => blog.id) |
| 1837 | - assert !a.belongs_to_forum? | |
| 1837 | + refute a.belongs_to_forum? | |
| 1838 | 1838 | end |
| 1839 | 1839 | |
| 1840 | 1840 | should 'not belongs to forum if do not have a parent' do |
| 1841 | 1841 | p = create_user('user_forum_test').person |
| 1842 | 1842 | a = fast_create(TextileArticle, :name => 'Orphan post', :profile_id => p.id) |
| 1843 | - assert !a.belongs_to_forum? | |
| 1843 | + refute a.belongs_to_forum? | |
| 1844 | 1844 | end |
| 1845 | 1845 | |
| 1846 | 1846 | should 'save image on create article' do |
| ... | ... | @@ -1998,7 +1998,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 1998 | 1998 | should 'display_filter do not show person private content to non friends' do |
| 1999 | 1999 | user = create_user('someuser').person |
| 2000 | 2000 | p = fast_create(Person) |
| 2001 | - assert !p.is_a_friend?(user) | |
| 2001 | + refute p.is_a_friend?(user) | |
| 2002 | 2002 | user.stubs(:has_permission?).with(:view_private_content, p).returns(false) |
| 2003 | 2003 | Article.delete_all |
| 2004 | 2004 | a = fast_create(Article, :published => false, :show_to_followers => true, :profile_id => p.id) |
| ... | ... | @@ -2010,7 +2010,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 2010 | 2010 | should 'display_filter do not show community private content to non members' do |
| 2011 | 2011 | user = create_user('someuser').person |
| 2012 | 2012 | p = fast_create(Community) |
| 2013 | - assert !user.is_member_of?(p) | |
| 2013 | + refute user.is_member_of?(p) | |
| 2014 | 2014 | user.stubs(:has_permission?).with(:view_private_content, p).returns(false) |
| 2015 | 2015 | Article.delete_all |
| 2016 | 2016 | a = fast_create(Article, :published => false, :show_to_followers => true, :profile_id => p.id) |
| ... | ... | @@ -2022,7 +2022,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 2022 | 2022 | should 'display_filter show community public content even it has no followers defined' do |
| 2023 | 2023 | user = create_user('someuser').person |
| 2024 | 2024 | p = fast_create(Community) |
| 2025 | - assert !user.is_member_of?(p) | |
| 2025 | + refute user.is_member_of?(p) | |
| 2026 | 2026 | user.stubs(:has_permission?).with(:view_private_content, p).returns(false) |
| 2027 | 2027 | Article.delete_all |
| 2028 | 2028 | a = fast_create(Article, :published => true, :show_to_followers => true, :profile_id => p.id) |
| ... | ... | @@ -2034,7 +2034,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 2034 | 2034 | should 'display_filter show person public content even it has no followers defined' do |
| 2035 | 2035 | user = create_user('someuser').person |
| 2036 | 2036 | p = fast_create(Community) |
| 2037 | - assert !user.is_a_friend?(p) | |
| 2037 | + refute user.is_a_friend?(p) | |
| 2038 | 2038 | user.stubs(:has_permission?).with(:view_private_content, p).returns(false) |
| 2039 | 2039 | Article.delete_all |
| 2040 | 2040 | a = fast_create(Article, :published => true, :show_to_followers => true, :profile_id => p.id) |
| ... | ... | @@ -2046,8 +2046,8 @@ class ArticleTest < ActiveSupport::TestCase |
| 2046 | 2046 | should 'display_filter do not show person private content to non friends passing nil as profile parameter' do |
| 2047 | 2047 | user = create_user('someuser').person |
| 2048 | 2048 | p = fast_create(Person) |
| 2049 | - assert !p.is_a_friend?(user) | |
| 2050 | - assert !user.is_admin? | |
| 2049 | + refute p.is_a_friend?(user) | |
| 2050 | + refute user.is_admin? | |
| 2051 | 2051 | Article.delete_all |
| 2052 | 2052 | fast_create(Article, :published => false, :profile_id => p.id) |
| 2053 | 2053 | assert_equal [], Article.display_filter(user, nil) |
| ... | ... | @@ -2056,8 +2056,8 @@ class ArticleTest < ActiveSupport::TestCase |
| 2056 | 2056 | should 'display_filter show person public content to non friends passing nil as profile parameter' do |
| 2057 | 2057 | user = create_user('someuser').person |
| 2058 | 2058 | p = fast_create(Person) |
| 2059 | - assert !p.is_a_friend?(user) | |
| 2060 | - assert !user.is_admin? | |
| 2059 | + refute p.is_a_friend?(user) | |
| 2060 | + refute user.is_admin? | |
| 2061 | 2061 | Article.delete_all |
| 2062 | 2062 | a1 = fast_create(Article, :profile_id => p.id) |
| 2063 | 2063 | a2 = fast_create(Article) |
| ... | ... | @@ -2067,7 +2067,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 2067 | 2067 | should 'display_filter do not show community private content to non members passing nil as profile parameter' do |
| 2068 | 2068 | user = create_user('someuser').person |
| 2069 | 2069 | p = fast_create(Community) |
| 2070 | - assert !user.is_member_of?(p) | |
| 2070 | + refute user.is_member_of?(p) | |
| 2071 | 2071 | Article.delete_all |
| 2072 | 2072 | fast_create(Article, :published => false, :profile_id => p.id) |
| 2073 | 2073 | assert_equal [], Article.display_filter(user, nil) |
| ... | ... | @@ -2076,7 +2076,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 2076 | 2076 | should 'display_filter show community public content to non members passing nil as profile parameter' do |
| 2077 | 2077 | user = create_user('someuser').person |
| 2078 | 2078 | p = fast_create(Community) |
| 2079 | - assert !user.is_member_of?(p) | |
| 2079 | + refute user.is_member_of?(p) | |
| 2080 | 2080 | Article.delete_all |
| 2081 | 2081 | a1 = fast_create(Article, :profile_id => p.id) |
| 2082 | 2082 | a2 = fast_create(Article) |
| ... | ... | @@ -2099,7 +2099,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 2099 | 2099 | should 'display_filter not show public content of private community for non members' do |
| 2100 | 2100 | user = create_user('someuser').person |
| 2101 | 2101 | p = fast_create(Community, :public_profile => false) |
| 2102 | - assert !user.is_member_of?(p) | |
| 2102 | + refute user.is_member_of?(p) | |
| 2103 | 2103 | user.stubs(:has_permission?).with(:view_private_content, p).returns(false) |
| 2104 | 2104 | Article.delete_all |
| 2105 | 2105 | a = fast_create(Article, :published => true, :profile_id => p.id) |
| ... | ... | @@ -2141,7 +2141,7 @@ class ArticleTest < ActiveSupport::TestCase |
| 2141 | 2141 | should 'display_filter not show public content of private person for non friends' do |
| 2142 | 2142 | user = create_user('someuser').person |
| 2143 | 2143 | p = fast_create(Person, :public_profile => false) |
| 2144 | - assert !user.is_a_friend?(p) | |
| 2144 | + refute user.is_a_friend?(p) | |
| 2145 | 2145 | user.stubs(:has_permission?).with(:view_private_content, p).returns(false) |
| 2146 | 2146 | Article.delete_all |
| 2147 | 2147 | a = fast_create(Article, :published => true, :profile_id => p.id) | ... | ... |
test/unit/block_test.rb
| ... | ... | @@ -238,11 +238,11 @@ class BlockTest < ActiveSupport::TestCase |
| 238 | 238 | block = MyBlock.new |
| 239 | 239 | |
| 240 | 240 | assert block.visible?({:value => 2}) |
| 241 | - assert !block.visible?({:value => 3}) | |
| 241 | + refute block.visible?({:value => 3}) | |
| 242 | 242 | end |
| 243 | 243 | |
| 244 | 244 | should 'not be embedable by default' do |
| 245 | - assert !Block.new.embedable? | |
| 245 | + refute Block.new.embedable? | |
| 246 | 246 | end |
| 247 | 247 | |
| 248 | 248 | should 'generate embed code' do |
| ... | ... | @@ -275,13 +275,13 @@ class BlockTest < ActiveSupport::TestCase |
| 275 | 275 | should 'do not display block to logged users for display_user = not_logged' do |
| 276 | 276 | block = Block.new |
| 277 | 277 | block.display_user = 'not_logged' |
| 278 | - assert !block.display_to_user?(User.new) | |
| 278 | + refute block.display_to_user?(User.new) | |
| 279 | 279 | end |
| 280 | 280 | |
| 281 | 281 | should 'do not display block to not logged users for display_user = logged' do |
| 282 | 282 | block = Block.new |
| 283 | 283 | block.display_user = 'logged' |
| 284 | - assert !block.display_to_user?(nil) | |
| 284 | + refute block.display_to_user?(nil) | |
| 285 | 285 | end |
| 286 | 286 | |
| 287 | 287 | should 'display block to not logged users for display_user = not_logged' do |
| ... | ... | @@ -293,7 +293,7 @@ class BlockTest < ActiveSupport::TestCase |
| 293 | 293 | should 'not be visible if display_to_user? is false' do |
| 294 | 294 | block = Block.new |
| 295 | 295 | block.expects(:display_to_user?).once.returns(false) |
| 296 | - assert !block.visible?({}) | |
| 296 | + refute block.visible?({}) | |
| 297 | 297 | end |
| 298 | 298 | |
| 299 | 299 | should 'accept user as parameter on cache_key without change its value' do |
| ... | ... | @@ -322,7 +322,7 @@ class BlockTest < ActiveSupport::TestCase |
| 322 | 322 | block = create(Block, :box_id => box.id) |
| 323 | 323 | block.display_user = 'followers' |
| 324 | 324 | block.save! |
| 325 | - assert !block.display_to_user?(user.person) | |
| 325 | + refute block.display_to_user?(user.person) | |
| 326 | 326 | end |
| 327 | 327 | |
| 328 | 328 | should 'display block to friends of person for display_user = friends' do |
| ... | ... | @@ -346,7 +346,7 @@ class BlockTest < ActiveSupport::TestCase |
| 346 | 346 | block = create(Block, :box_id => box.id) |
| 347 | 347 | block.display_user = 'followers' |
| 348 | 348 | block.save! |
| 349 | - assert !block.display_to_user?(person_friend) | |
| 349 | + refute block.display_to_user?(person_friend) | |
| 350 | 350 | end |
| 351 | 351 | |
| 352 | 352 | should 'get limit as a number when limit is string' do | ... | ... |
test/unit/blog_test.rb
| ... | ... | @@ -118,7 +118,7 @@ class BlogTest < ActiveSupport::TestCase |
| 118 | 118 | p = create_user('testuser').person |
| 119 | 119 | blog = build(Blog, :profile => p, :name => 'Blog test', :external_feed_builder => {:enabled => true}) |
| 120 | 120 | blog.save |
| 121 | - assert ! blog.valid? | |
| 121 | + refute blog.valid? | |
| 122 | 122 | end |
| 123 | 123 | |
| 124 | 124 | should 'remove external feed when removing blog' do |
| ... | ... | @@ -178,15 +178,15 @@ class BlogTest < ActiveSupport::TestCase |
| 178 | 178 | |
| 179 | 179 | blog.visualization_format = 'short' |
| 180 | 180 | blog.valid? |
| 181 | - assert !blog.errors[:visualization_format.to_s].present? | |
| 181 | + refute blog.errors[:visualization_format.to_s].present? | |
| 182 | 182 | |
| 183 | 183 | blog.visualization_format = 'full' |
| 184 | 184 | blog.valid? |
| 185 | - assert !blog.errors[:visualization_format.to_s].present? | |
| 185 | + refute blog.errors[:visualization_format.to_s].present? | |
| 186 | 186 | |
| 187 | 187 | blog.visualization_format = 'compact' |
| 188 | 188 | blog.valid? |
| 189 | - assert !blog.errors[:visualization_format.to_s].present? | |
| 189 | + refute blog.errors[:visualization_format.to_s].present? | |
| 190 | 190 | end |
| 191 | 191 | |
| 192 | 192 | should 'have posts' do |
| ... | ... | @@ -195,8 +195,8 @@ class BlogTest < ActiveSupport::TestCase |
| 195 | 195 | |
| 196 | 196 | should 'not display posts in current language by default' do |
| 197 | 197 | blog = Blog.new |
| 198 | - assert !blog.display_posts_in_current_language | |
| 199 | - assert !blog.display_posts_in_current_language? | |
| 198 | + refute blog.display_posts_in_current_language | |
| 199 | + refute blog.display_posts_in_current_language? | |
| 200 | 200 | end |
| 201 | 201 | |
| 202 | 202 | should 'update display posts in current language setting' do |
| ... | ... | @@ -205,8 +205,8 @@ class BlogTest < ActiveSupport::TestCase |
| 205 | 205 | blog = p.blog |
| 206 | 206 | blog.display_posts_in_current_language = false |
| 207 | 207 | assert blog.save! && blog.reload |
| 208 | - assert !blog.reload.display_posts_in_current_language | |
| 209 | - assert !blog.reload.display_posts_in_current_language? | |
| 208 | + refute blog.reload.display_posts_in_current_language | |
| 209 | + refute blog.reload.display_posts_in_current_language? | |
| 210 | 210 | end |
| 211 | 211 | |
| 212 | 212 | #FIXME This should be used until there is a migration to fix all blogs that |
| ... | ... | @@ -223,7 +223,7 @@ class BlogTest < ActiveSupport::TestCase |
| 223 | 223 | |
| 224 | 224 | should 'not accept uploads' do |
| 225 | 225 | folder = fast_create(Blog) |
| 226 | - assert !folder.accept_uploads? | |
| 226 | + refute folder.accept_uploads? | |
| 227 | 227 | end |
| 228 | 228 | |
| 229 | 229 | should 'know when blog has or when has no posts' do |
| ... | ... | @@ -231,7 +231,7 @@ class BlogTest < ActiveSupport::TestCase |
| 231 | 231 | blog = Blog.create!(:profile => p, :name => 'Blog test') |
| 232 | 232 | assert blog.empty? |
| 233 | 233 | fast_create(TextileArticle, :parent_id => blog.id) |
| 234 | - assert ! blog.empty? | |
| 234 | + refute blog.empty? | |
| 235 | 235 | end |
| 236 | 236 | |
| 237 | 237 | should 'set cover image' do | ... | ... |
test/unit/box_test.rb
| ... | ... | @@ -18,15 +18,15 @@ class BoxTest < ActiveSupport::TestCase |
| 18 | 18 | should 'list allowed blocks for center box' do |
| 19 | 19 | blocks = Box.new.tap { |b| b.position = 1 }.acceptable_blocks |
| 20 | 20 | |
| 21 | - assert !blocks.include?('.block') | |
| 22 | - assert !blocks.include?('.disabled-enterprise-message-block') | |
| 23 | - assert !blocks.include?('.featured-products-block') | |
| 24 | - assert !blocks.include?('.products-block') | |
| 25 | - assert !blocks.include?('.profile-info-block') | |
| 26 | - assert !blocks.include?('.profile-list-block') | |
| 27 | - assert !blocks.include?('.profile-search-block') | |
| 28 | - assert !blocks.include?('.slideshow-block') | |
| 29 | - assert !blocks.include?('.location-block') | |
| 21 | + refute blocks.include?('.block') | |
| 22 | + refute blocks.include?('.disabled-enterprise-message-block') | |
| 23 | + refute blocks.include?('.featured-products-block') | |
| 24 | + refute blocks.include?('.products-block') | |
| 25 | + refute blocks.include?('.profile-info-block') | |
| 26 | + refute blocks.include?('.profile-list-block') | |
| 27 | + refute blocks.include?('.profile-search-block') | |
| 28 | + refute blocks.include?('.slideshow-block') | |
| 29 | + refute blocks.include?('.location-block') | |
| 30 | 30 | |
| 31 | 31 | assert blocks.include?('.article-block') |
| 32 | 32 | assert blocks.include?('.blog-archives-block') |
| ... | ... | @@ -51,9 +51,9 @@ class BoxTest < ActiveSupport::TestCase |
| 51 | 51 | should 'list allowed blocks for box at position 2' do |
| 52 | 52 | blocks = Box.new.tap { |b| b.position = 2 }.acceptable_blocks |
| 53 | 53 | |
| 54 | - assert !blocks.include?('.main-block') | |
| 55 | - assert !blocks.include?('.block') | |
| 56 | - assert !blocks.include?('.profile-list-block') | |
| 54 | + refute blocks.include?('.main-block') | |
| 55 | + refute blocks.include?('.block') | |
| 56 | + refute blocks.include?('.profile-list-block') | |
| 57 | 57 | |
| 58 | 58 | assert blocks.include?('.article-block') |
| 59 | 59 | assert blocks.include?('.blog-archives-block') |
| ... | ... | @@ -129,7 +129,7 @@ class BoxTest < ActiveSupport::TestCase |
| 129 | 129 | assert blocks.include?('box-test_plugin-block') |
| 130 | 130 | |
| 131 | 131 | blocks = build(Box, :position => 1, :owner => Community.new).acceptable_blocks |
| 132 | - assert !blocks.include?('box-test_plugin-block') | |
| 132 | + refute blocks.include?('box-test_plugin-block') | |
| 133 | 133 | end |
| 134 | 134 | |
| 135 | 135 | should 'list only boxes with a postion greater than zero' do | ... | ... |
test/unit/boxes_helper_test.rb
| ... | ... | @@ -106,7 +106,7 @@ class BoxesHelperTest < ActionView::TestCase |
| 106 | 106 | end |
| 107 | 107 | |
| 108 | 108 | should 'add invisible CSS class name for invisible blocks' do |
| 109 | - assert !block_css_classes(build(Block, :display => 'always')).split.any? { |item| item == 'invisible-block'} | |
| 109 | + refute block_css_classes(build(Block, :display => 'always')).split.any? { |item| item == 'invisible-block'} | |
| 110 | 110 | assert block_css_classes(build(Block, :display => 'never')).split.any? { |item| item == 'invisible-block'} |
| 111 | 111 | end |
| 112 | 112 | ... | ... |
test/unit/category_test.rb
| ... | ... | @@ -17,7 +17,7 @@ class CategoryTest < ActiveSupport::TestCase |
| 17 | 17 | def test_mandatory_field_name |
| 18 | 18 | c = Category.new |
| 19 | 19 | c.name = 'product category for testing' |
| 20 | - assert !c.valid? | |
| 20 | + refute c.valid? | |
| 21 | 21 | assert c.errors[:environment_id.to_s].present? |
| 22 | 22 | end |
| 23 | 23 | |
| ... | ... | @@ -75,14 +75,14 @@ class CategoryTest < ActiveSupport::TestCase |
| 75 | 75 | sub_cat = build(Category, :name => 'subcategory_name') |
| 76 | 76 | sub_cat.stubs(:parent).returns(cat) |
| 77 | 77 | sub_cat.parent = cat |
| 78 | - assert !sub_cat.top_level? | |
| 78 | + refute sub_cat.top_level? | |
| 79 | 79 | end |
| 80 | 80 | |
| 81 | 81 | def test_leaf |
| 82 | 82 | cat = build(Category, :name => 'category_name') |
| 83 | 83 | sub_cat = build(Category, :name => 'subcategory_name') |
| 84 | 84 | cat.stubs(:children).returns([sub_cat]) |
| 85 | - assert !cat.leaf? | |
| 85 | + refute cat.leaf? | |
| 86 | 86 | end |
| 87 | 87 | |
| 88 | 88 | def test_not_leaf |
| ... | ... | @@ -132,7 +132,7 @@ class CategoryTest < ActiveSupport::TestCase |
| 132 | 132 | c1 = create(Category, :environment_id => @env.id) |
| 133 | 133 | c2 = build(Category, :slug => c1.slug, :environment_id => @env.id) |
| 134 | 134 | |
| 135 | - assert !c2.valid? | |
| 135 | + refute c2.valid? | |
| 136 | 136 | assert c2.errors[:slug.to_s].present? |
| 137 | 137 | end |
| 138 | 138 | ... | ... |
test/unit/certifier_test.rb
| ... | ... | @@ -14,7 +14,7 @@ class CertifierTest < ActiveSupport::TestCase |
| 14 | 14 | |
| 15 | 15 | should 'environment is mandatory' do |
| 16 | 16 | certifier = Certifier.new(:name => 'Certifier without environment') |
| 17 | - assert !certifier.valid? | |
| 17 | + refute certifier.valid? | |
| 18 | 18 | |
| 19 | 19 | certifier.environment = fast_create(Environment) |
| 20 | 20 | assert certifier.valid? |
| ... | ... | @@ -34,7 +34,7 @@ class CertifierTest < ActiveSupport::TestCase |
| 34 | 34 | should 'name is mandatory' do |
| 35 | 35 | env_one = fast_create(Environment) |
| 36 | 36 | certifier = env_one.certifiers.new |
| 37 | - assert !certifier.valid? | |
| 37 | + refute certifier.valid? | |
| 38 | 38 | |
| 39 | 39 | certifier.name = 'Certifier name' |
| 40 | 40 | assert certifier.valid? | ... | ... |
test/unit/change_password_test.rb
| ... | ... | @@ -16,7 +16,7 @@ class ChangePasswordTest < ActiveSupport::TestCase |
| 16 | 16 | change.status = Task::Status::FINISHED |
| 17 | 17 | change.password = 'right' |
| 18 | 18 | change.password_confirmation = 'wrong' |
| 19 | - assert !change.valid? | |
| 19 | + refute change.valid? | |
| 20 | 20 | assert change.errors[:password.to_s].present? |
| 21 | 21 | |
| 22 | 22 | ... | ... |
test/unit/comment_helper_test.rb
| ... | ... | @@ -71,7 +71,7 @@ class CommentHelperTest < ActiveSupport::TestCase |
| 71 | 71 | should 'do not return link for report abuse action when comment has no author' do |
| 72 | 72 | comment = Comment.new |
| 73 | 73 | link = link_for_report_abuse(comment) |
| 74 | - assert !link | |
| 74 | + refute link | |
| 75 | 75 | end |
| 76 | 76 | |
| 77 | 77 | should 'return link for mark comment as spam' do | ... | ... |
test/unit/comment_test.rb
| ... | ... | @@ -328,7 +328,7 @@ class CommentTest < ActiveSupport::TestCase |
| 328 | 328 | |
| 329 | 329 | should 'be able to reject a comment' do |
| 330 | 330 | c = Comment.new |
| 331 | - assert !c.rejected? | |
| 331 | + refute c.rejected? | |
| 332 | 332 | |
| 333 | 333 | c.reject! |
| 334 | 334 | assert c.rejected? |
| ... | ... | @@ -408,15 +408,15 @@ class CommentTest < ActiveSupport::TestCase |
| 408 | 408 | c = Comment.new |
| 409 | 409 | c.spam = true |
| 410 | 410 | assert c.spam? |
| 411 | - assert !c.ham? | |
| 411 | + refute c.ham? | |
| 412 | 412 | |
| 413 | 413 | c.spam = false |
| 414 | 414 | assert c.ham? |
| 415 | - assert !c.spam? | |
| 415 | + refute c.spam? | |
| 416 | 416 | |
| 417 | 417 | c.spam = nil |
| 418 | - assert !c.spam? | |
| 419 | - assert !c.ham? | |
| 418 | + refute c.spam? | |
| 419 | + refute c.ham? | |
| 420 | 420 | end |
| 421 | 421 | |
| 422 | 422 | should 'be able to select non-spam comments' do |
| ... | ... | @@ -547,7 +547,7 @@ class CommentTest < ActiveSupport::TestCase |
| 547 | 547 | article = Article.new |
| 548 | 548 | comment = build(Comment, :article => article) |
| 549 | 549 | |
| 550 | - assert !comment.need_moderation? | |
| 550 | + refute comment.need_moderation? | |
| 551 | 551 | end |
| 552 | 552 | |
| 553 | 553 | should 'not need moderation if the comment author is the article author' do |
| ... | ... | @@ -560,7 +560,7 @@ class CommentTest < ActiveSupport::TestCase |
| 560 | 560 | comment = build(Comment, :article => article) |
| 561 | 561 | comment.stubs(:author).returns(author) |
| 562 | 562 | |
| 563 | - assert !comment.need_moderation? | |
| 563 | + refute comment.need_moderation? | |
| 564 | 564 | end |
| 565 | 565 | |
| 566 | 566 | should 'need moderation if article is moderated and the comment has no author' do |
| ... | ... | @@ -589,7 +589,7 @@ class CommentTest < ActiveSupport::TestCase |
| 589 | 589 | should 'not be able to destroy comment without user' do |
| 590 | 590 | comment = Comment.new |
| 591 | 591 | |
| 592 | - assert !comment.can_be_destroyed_by?(nil) | |
| 592 | + refute comment.can_be_destroyed_by?(nil) | |
| 593 | 593 | end |
| 594 | 594 | |
| 595 | 595 | should 'not be able to destroy comment' do |
| ... | ... | @@ -599,7 +599,7 @@ class CommentTest < ActiveSupport::TestCase |
| 599 | 599 | comment = build(Comment, :article => article) |
| 600 | 600 | user.expects(:has_permission?).with(:moderate_comments, profile).returns(false) |
| 601 | 601 | |
| 602 | - assert !comment.can_be_destroyed_by?(user) | |
| 602 | + refute comment.can_be_destroyed_by?(user) | |
| 603 | 603 | end |
| 604 | 604 | |
| 605 | 605 | should 'be able to destroy comment if is the author' do |
| ... | ... | @@ -631,7 +631,7 @@ class CommentTest < ActiveSupport::TestCase |
| 631 | 631 | should 'not be able to mark comment as spam without user' do |
| 632 | 632 | comment = Comment.new |
| 633 | 633 | |
| 634 | - assert !comment.can_be_marked_as_spam_by?(nil) | |
| 634 | + refute comment.can_be_marked_as_spam_by?(nil) | |
| 635 | 635 | end |
| 636 | 636 | |
| 637 | 637 | should 'not be able to mark comment as spam' do |
| ... | ... | @@ -641,7 +641,7 @@ class CommentTest < ActiveSupport::TestCase |
| 641 | 641 | comment = build(Comment, :article => article) |
| 642 | 642 | user.expects(:has_permission?).with(:moderate_comments, profile).returns(false) |
| 643 | 643 | |
| 644 | - assert !comment.can_be_marked_as_spam_by?(user) | |
| 644 | + refute comment.can_be_marked_as_spam_by?(user) | |
| 645 | 645 | end |
| 646 | 646 | |
| 647 | 647 | should 'be able to mark comment as spam if is the profile' do |
| ... | ... | @@ -666,14 +666,14 @@ class CommentTest < ActiveSupport::TestCase |
| 666 | 666 | should 'not be able to update comment without user' do |
| 667 | 667 | comment = Comment.new |
| 668 | 668 | |
| 669 | - assert !comment.can_be_updated_by?(nil) | |
| 669 | + refute comment.can_be_updated_by?(nil) | |
| 670 | 670 | end |
| 671 | 671 | |
| 672 | 672 | should 'not be able to update comment' do |
| 673 | 673 | user = Person.new |
| 674 | 674 | comment = Comment.new |
| 675 | 675 | |
| 676 | - assert !comment.can_be_updated_by?(user) | |
| 676 | + refute comment.can_be_updated_by?(user) | |
| 677 | 677 | end |
| 678 | 678 | |
| 679 | 679 | should 'be able to update comment if is the author' do |
| ... | ... | @@ -714,10 +714,10 @@ class CommentTest < ActiveSupport::TestCase |
| 714 | 714 | should 'like a comment' do |
| 715 | 715 | comment = create_comment |
| 716 | 716 | person = create_user('voter').person |
| 717 | - assert !comment.voted_by?(person, true) | |
| 717 | + refute comment.voted_by?(person, true) | |
| 718 | 718 | person.vote_for(comment) |
| 719 | 719 | assert comment.voted_by?(person, true) |
| 720 | - assert !comment.voted_by?(person, false) | |
| 720 | + refute comment.voted_by?(person, false) | |
| 721 | 721 | end |
| 722 | 722 | |
| 723 | 723 | should 'count voters for' do | ... | ... |
test/unit/community_test.rb
| ... | ... | @@ -28,9 +28,9 @@ class CommunityTest < ActiveSupport::TestCase |
| 28 | 28 | should 'create default set of blocks' do |
| 29 | 29 | c = create(Community, :environment => Environment.default, :name => 'my new community') |
| 30 | 30 | |
| 31 | - assert !c.boxes[0].blocks.empty?, 'person must have blocks in area 1' | |
| 32 | - assert !c.boxes[1].blocks.empty?, 'person must have blocks in area 2' | |
| 33 | - assert !c.boxes[2].blocks.empty?, 'person must have blocks in area 3' | |
| 31 | + refute c.boxes[0].blocks.empty?, 'person must have blocks in area 1' | |
| 32 | + refute c.boxes[1].blocks.empty?, 'person must have blocks in area 2' | |
| 33 | + refute c.boxes[2].blocks.empty?, 'person must have blocks in area 3' | |
| 34 | 34 | end |
| 35 | 35 | |
| 36 | 36 | should 'create a default set of articles' do |
| ... | ... | @@ -82,7 +82,7 @@ class CommunityTest < ActiveSupport::TestCase |
| 82 | 82 | |
| 83 | 83 | c.destroy |
| 84 | 84 | relationships.each do |i| |
| 85 | - assert !RoleAssignment.exists?(i.id) | |
| 85 | + refute RoleAssignment.exists?(i.id) | |
| 86 | 86 | end |
| 87 | 87 | end |
| 88 | 88 | |
| ... | ... | @@ -118,24 +118,24 @@ class CommunityTest < ActiveSupport::TestCase |
| 118 | 118 | e = Environment.default |
| 119 | 119 | e.expects(:required_community_fields).returns(['contact_phone']).at_least_once |
| 120 | 120 | community = build(Community, :name => 'My community', :environment => e) |
| 121 | - assert ! community.valid? | |
| 121 | + refute community.valid? | |
| 122 | 122 | assert community.errors[:contact_phone.to_s].present? |
| 123 | 123 | |
| 124 | 124 | community.contact_phone = '99999' |
| 125 | 125 | community.valid? |
| 126 | - assert ! community.errors[:contact_phone.to_s].present? | |
| 126 | + refute community.errors[:contact_phone.to_s].present? | |
| 127 | 127 | end |
| 128 | 128 | |
| 129 | 129 | should 'not require fields if community is a template' do |
| 130 | 130 | e = Environment.default |
| 131 | 131 | e.expects(:required_community_fields).returns(['contact_phone']).at_least_once |
| 132 | 132 | community = build(Community, :name => 'My community', :environment => e) |
| 133 | - assert ! community.valid? | |
| 133 | + refute community.valid? | |
| 134 | 134 | assert community.errors[:contact_phone.to_s].present? |
| 135 | 135 | |
| 136 | 136 | community.is_template = true |
| 137 | 137 | community.valid? |
| 138 | - assert ! community.errors[:contact_phone.to_s].present? | |
| 138 | + refute community.errors[:contact_phone.to_s].present? | |
| 139 | 139 | end |
| 140 | 140 | |
| 141 | 141 | should 'return newest text articles as news' do |
| ... | ... | @@ -262,11 +262,11 @@ class CommunityTest < ActiveSupport::TestCase |
| 262 | 262 | p2 = fast_create(Person) |
| 263 | 263 | p3 = fast_create(Person) |
| 264 | 264 | |
| 265 | - assert !p1.is_member_of?(c) | |
| 265 | + refute p1.is_member_of?(c) | |
| 266 | 266 | c.add_member(p1) |
| 267 | 267 | assert p1.is_member_of?(c) |
| 268 | 268 | |
| 269 | - assert !p3.is_member_of?(c) | |
| 269 | + refute p3.is_member_of?(c) | |
| 270 | 270 | c.add_member(p3) |
| 271 | 271 | assert p3.is_member_of?(c) |
| 272 | 272 | |
| ... | ... | @@ -288,7 +288,7 @@ class CommunityTest < ActiveSupport::TestCase |
| 288 | 288 | process_delayed_job_queue |
| 289 | 289 | community.add_member(p3) |
| 290 | 290 | assert p1.is_member_of?(community) |
| 291 | - assert !p2.is_member_of?(community) | |
| 291 | + refute p2.is_member_of?(community) | |
| 292 | 292 | assert p3.is_member_of?(community) |
| 293 | 293 | process_delayed_job_queue |
| 294 | 294 | end |
| ... | ... | @@ -409,14 +409,14 @@ class CommunityTest < ActiveSupport::TestCase |
| 409 | 409 | |
| 410 | 410 | member = create_user('memberuser').person |
| 411 | 411 | c.add_member(member) |
| 412 | - assert !c.is_admin?(member) | |
| 412 | + refute c.is_admin?(member) | |
| 413 | 413 | end |
| 414 | 414 | |
| 415 | 415 | should 'a moderator user not be a community admin' do |
| 416 | 416 | c = fast_create(Community, :name => 'my test profile', :identifier => 'mytestprofile') |
| 417 | 417 | moderator = create_user('moderatoruser').person |
| 418 | 418 | c.add_moderator(moderator) |
| 419 | - assert !c.is_admin?(moderator) | |
| 419 | + refute c.is_admin?(moderator) | |
| 420 | 420 | end |
| 421 | 421 | |
| 422 | 422 | end | ... | ... |
test/unit/contact_test.rb
| ... | ... | @@ -4,16 +4,16 @@ class ContactTest < ActiveSupport::TestCase |
| 4 | 4 | |
| 5 | 5 | should 'validates required fields' do |
| 6 | 6 | contact = Contact.new |
| 7 | - assert !contact.valid? | |
| 7 | + refute contact.valid? | |
| 8 | 8 | |
| 9 | 9 | contact.subject = 'Hi' |
| 10 | - assert !contact.valid? | |
| 10 | + refute contact.valid? | |
| 11 | 11 | |
| 12 | 12 | contact.name = 'john' |
| 13 | - assert !contact.valid? | |
| 13 | + refute contact.valid? | |
| 14 | 14 | |
| 15 | 15 | contact.email = 'visitor@invalid.com' |
| 16 | - assert !contact.valid? | |
| 16 | + refute contact.valid? | |
| 17 | 17 | |
| 18 | 18 | contact.message = 'Hi, all' |
| 19 | 19 | assert contact.valid? |
| ... | ... | @@ -40,8 +40,8 @@ class ContactTest < ActiveSupport::TestCase |
| 40 | 40 | should 'not deliver message if contact is invalid' do |
| 41 | 41 | ent = fast_create(Enterprise, :name => 'my enterprise', :identifier => 'myent') |
| 42 | 42 | c = Contact.new(:name => 'john', :subject => 'hi', :message => 'hi, all', :dest => ent) |
| 43 | - assert !c.valid? | |
| 44 | - assert !c.deliver | |
| 43 | + refute c.valid? | |
| 44 | + refute c.deliver | |
| 45 | 45 | end |
| 46 | 46 | |
| 47 | 47 | should 'use sender name and environment noreply_email on from' do | ... | ... |
test/unit/create_community_test.rb
| ... | ... | @@ -23,7 +23,7 @@ class CreateCommunityTest < ActiveSupport::TestCase |
| 23 | 23 | assert task.errors[:requestor_id.to_s].present? |
| 24 | 24 | task.requestor = person |
| 25 | 25 | task.valid? |
| 26 | - assert !task.errors[:requestor_id.to_s].present? | |
| 26 | + refute task.errors[:requestor_id.to_s].present? | |
| 27 | 27 | end |
| 28 | 28 | |
| 29 | 29 | should 'actually create a community when finishing the task and associate the task requestor as its admin' do | ... | ... |
test/unit/create_enterprise_test.rb
| ... | ... | @@ -26,7 +26,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase |
| 26 | 26 | |
| 27 | 27 | task.foundation_year = 2006 |
| 28 | 28 | task.valid? |
| 29 | - assert !task.errors[:foundation_year.to_s].present? | |
| 29 | + refute task.errors[:foundation_year.to_s].present? | |
| 30 | 30 | end |
| 31 | 31 | |
| 32 | 32 | should 'require a requestor' do |
| ... | ... | @@ -37,7 +37,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase |
| 37 | 37 | assert task.errors[:requestor_id.to_s].present? |
| 38 | 38 | task.requestor = create_user('testuser').person |
| 39 | 39 | task.valid? |
| 40 | - assert !task.errors[:requestor_id.to_s].present? | |
| 40 | + refute task.errors[:requestor_id.to_s].present? | |
| 41 | 41 | end |
| 42 | 42 | |
| 43 | 43 | should 'require a target (validator organization)' do |
| ... | ... | @@ -49,7 +49,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase |
| 49 | 49 | task.target = Organization.create!(:name => "My organization", :identifier => 'validator_organization') |
| 50 | 50 | |
| 51 | 51 | task.valid? |
| 52 | - assert !task.errors[:target_id.to_s].present? | |
| 52 | + refute task.errors[:target_id.to_s].present? | |
| 53 | 53 | end |
| 54 | 54 | |
| 55 | 55 | should 'require that the informed target (validator organization) actually validates for the chosen region' do |
| ... | ... | @@ -69,7 +69,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase |
| 69 | 69 | region.validators << validator |
| 70 | 70 | |
| 71 | 71 | task.valid? |
| 72 | - assert !task.errors[:target.to_s].present? | |
| 72 | + refute task.errors[:target.to_s].present? | |
| 73 | 73 | end |
| 74 | 74 | |
| 75 | 75 | should 'cancel task when rejected ' do |
| ... | ... | @@ -84,7 +84,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase |
| 84 | 84 | task.reject_explanation = nil |
| 85 | 85 | |
| 86 | 86 | task.valid? |
| 87 | - assert !task.errors[:reject_explanation.to_s].present? | |
| 87 | + refute task.errors[:reject_explanation.to_s].present? | |
| 88 | 88 | |
| 89 | 89 | task.status = Task::Status::CANCELLED |
| 90 | 90 | task.valid? |
| ... | ... | @@ -92,7 +92,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase |
| 92 | 92 | |
| 93 | 93 | task.reject_explanation = 'bla bla bla' |
| 94 | 94 | task.valid? |
| 95 | - assert !task.errors[:reject_explanation.to_s].present? | |
| 95 | + refute task.errors[:reject_explanation.to_s].present? | |
| 96 | 96 | end |
| 97 | 97 | |
| 98 | 98 | should 'finish task when approved' do |
| ... | ... | @@ -130,7 +130,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase |
| 130 | 130 | |
| 131 | 131 | task.finish |
| 132 | 132 | |
| 133 | - assert !enterprise.new_record? | |
| 133 | + refute enterprise.new_record? | |
| 134 | 134 | assert_equal person.user, enterprise.user |
| 135 | 135 | assert_equal environment, enterprise.environment |
| 136 | 136 | |
| ... | ... | @@ -167,7 +167,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase |
| 167 | 167 | |
| 168 | 168 | task.finish |
| 169 | 169 | |
| 170 | - assert !enterprise.new_record? | |
| 170 | + refute enterprise.new_record? | |
| 171 | 171 | assert_equal person.user, enterprise.user |
| 172 | 172 | assert_equal environment, enterprise.environment |
| 173 | 173 | |
| ... | ... | @@ -203,7 +203,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase |
| 203 | 203 | :requestor_id => person.id, |
| 204 | 204 | }) |
| 205 | 205 | |
| 206 | - assert !task.valid? && task.valid_before_selecting_target? | |
| 206 | + refute task.valid? && task.valid_before_selecting_target? | |
| 207 | 207 | |
| 208 | 208 | task.target = validator |
| 209 | 209 | assert task.valid? | ... | ... |
test/unit/disabled_enterprise_message_block_test.rb
test/unit/domain_test.rb
| ... | ... | @@ -22,7 +22,7 @@ class DomainTest < ActiveSupport::TestCase |
| 22 | 22 | should 'allow domains with dot' do |
| 23 | 23 | domain = build(Domain, :name => 'test.org') |
| 24 | 24 | domain.valid? |
| 25 | - assert !domain.errors[:name.to_s].present? | |
| 25 | + refute domain.errors[:name.to_s].present? | |
| 26 | 26 | end |
| 27 | 27 | |
| 28 | 28 | should 'not allow domains with upper cased letters' do |
| ... | ... | @@ -34,13 +34,13 @@ class DomainTest < ActiveSupport::TestCase |
| 34 | 34 | should 'allow domains with hyphen' do |
| 35 | 35 | domain = build(Domain, :name => 'test-domain.org') |
| 36 | 36 | domain.valid? |
| 37 | - assert !domain.errors[:name.to_s].present? | |
| 37 | + refute domain.errors[:name.to_s].present? | |
| 38 | 38 | end |
| 39 | 39 | |
| 40 | 40 | should 'allow domains with underscore' do |
| 41 | 41 | domain = build(Domain, :name => 'test_domain.org') |
| 42 | 42 | domain.valid? |
| 43 | - assert !domain.errors[:name.to_s].present? | |
| 43 | + refute domain.errors[:name.to_s].present? | |
| 44 | 44 | end |
| 45 | 45 | |
| 46 | 46 | def test_owner |
| ... | ... | @@ -63,7 +63,7 @@ class DomainTest < ActiveSupport::TestCase |
| 63 | 63 | |
| 64 | 64 | d.name = 'example.net' |
| 65 | 65 | d.valid? |
| 66 | - assert !d.errors[:name.to_s].present? | |
| 66 | + refute d.errors[:name.to_s].present? | |
| 67 | 67 | end |
| 68 | 68 | |
| 69 | 69 | def test_find_by_name |
| ... | ... | @@ -71,8 +71,8 @@ class DomainTest < ActiveSupport::TestCase |
| 71 | 71 | fast_create(Domain, :name => 'example.net') |
| 72 | 72 | d1 = Domain.find_by_name('example.net') |
| 73 | 73 | d2 = Domain.find_by_name('www.example.net') |
| 74 | - assert !d1.nil? | |
| 75 | - assert !d2.nil? | |
| 74 | + refute d1.nil? | |
| 75 | + refute d2.nil? | |
| 76 | 76 | assert d1 == d2 |
| 77 | 77 | end |
| 78 | 78 | |
| ... | ... | @@ -81,7 +81,7 @@ class DomainTest < ActiveSupport::TestCase |
| 81 | 81 | assert create(Domain, :name => 'example.net') |
| 82 | 82 | |
| 83 | 83 | d = build(Domain, :name => 'example.net') |
| 84 | - assert !d.valid? | |
| 84 | + refute d.valid? | |
| 85 | 85 | assert d.errors[:name.to_s].present? |
| 86 | 86 | end |
| 87 | 87 | ... | ... |
test/unit/email_activation_test.rb
| ... | ... | @@ -24,7 +24,7 @@ class EmailActivationTest < ActiveSupport::TestCase |
| 24 | 24 | |
| 25 | 25 | should 'enable user email when finish' do |
| 26 | 26 | ze = create_user('zezinho', :environment_id => Environment.default.id) |
| 27 | - assert !ze.enable_email | |
| 27 | + refute ze.enable_email | |
| 28 | 28 | task = fast_create(EmailActivation, :requestor_id => ze.person.id, :target_id => Environment.default.id) |
| 29 | 29 | task.finish |
| 30 | 30 | ze.reload |
| ... | ... | @@ -33,7 +33,7 @@ class EmailActivationTest < ActiveSupport::TestCase |
| 33 | 33 | |
| 34 | 34 | should 'deliver email after enabling mailbox' do |
| 35 | 35 | ze = create_user('zezinho', :environment_id => Environment.default.id, :email => 'ze@example.com') |
| 36 | - assert !ze.enable_email | |
| 36 | + refute ze.enable_email | |
| 37 | 37 | task = EmailActivation.create!(:requestor => ze.person, :target => Environment.default) |
| 38 | 38 | task.finish |
| 39 | 39 | |
| ... | ... | @@ -46,7 +46,7 @@ class EmailActivationTest < ActiveSupport::TestCase |
| 46 | 46 | assert task.save! |
| 47 | 47 | |
| 48 | 48 | another_task = EmailActivation.new(:requestor => ze.person, :target => Environment.default) |
| 49 | - assert !another_task.save, "Should not be able to save another task" | |
| 49 | + refute another_task.save, "Should not be able to save another task" | |
| 50 | 50 | end |
| 51 | 51 | |
| 52 | 52 | should 'deliver activation email notification' do | ... | ... |
test/unit/enterprise_activation_test.rb
| ... | ... | @@ -26,7 +26,7 @@ class EnterpriseActivationTest < ActiveSupport::TestCase |
| 26 | 26 | ent = Enterprise.create!(:name => 'my enterprise', :identifier => 'myent') |
| 27 | 27 | t.enterprise = ent |
| 28 | 28 | t.valid? |
| 29 | - assert !t.errors[:enterprise].any?, "must validate after enterprise is set" | |
| 29 | + refute t.errors[:enterprise].any?, "must validate after enterprise is set" | |
| 30 | 30 | end |
| 31 | 31 | |
| 32 | 32 | should 'activate enterprise when finished' do | ... | ... |
test/unit/enterprise_test.rb
| ... | ... | @@ -25,15 +25,15 @@ class EnterpriseTest < ActiveSupport::TestCase |
| 25 | 25 | |
| 26 | 26 | p.identifier = 'rightformat2007' |
| 27 | 27 | p.valid? |
| 28 | - assert ! p.errors[:identifier.to_s].present? | |
| 28 | + refute p.errors[:identifier.to_s].present? | |
| 29 | 29 | |
| 30 | 30 | p.identifier = 'rightformat' |
| 31 | 31 | p.valid? |
| 32 | - assert ! p.errors[:identifier.to_s].present? | |
| 32 | + refute p.errors[:identifier.to_s].present? | |
| 33 | 33 | |
| 34 | 34 | p.identifier = 'right_format' |
| 35 | 35 | p.valid? |
| 36 | - assert ! p.errors[:identifier.to_s].present? | |
| 36 | + refute p.errors[:identifier.to_s].present? | |
| 37 | 37 | end |
| 38 | 38 | |
| 39 | 39 | def test_has_domains |
| ... | ... | @@ -83,9 +83,9 @@ class EnterpriseTest < ActiveSupport::TestCase |
| 83 | 83 | should 'create default set of blocks' do |
| 84 | 84 | e = create(Enterprise, :name => 'my new community', :identifier => 'mynewcommunity') |
| 85 | 85 | |
| 86 | - assert !e.boxes[0].blocks.empty?, 'enterprise must have blocks in area 1' | |
| 87 | - assert !e.boxes[1].blocks.empty?, 'enterprise must have blocks in area 2' | |
| 88 | - assert !e.boxes[2].blocks.empty?, 'enterprise must have blocks in area 3' | |
| 86 | + refute e.boxes[0].blocks.empty?, 'enterprise must have blocks in area 1' | |
| 87 | + refute e.boxes[1].blocks.empty?, 'enterprise must have blocks in area 2' | |
| 88 | + refute e.boxes[2].blocks.empty?, 'enterprise must have blocks in area 3' | |
| 89 | 89 | end |
| 90 | 90 | |
| 91 | 91 | should 'allow to add new members if has no members' do |
| ... | ... | @@ -147,7 +147,7 @@ class EnterpriseTest < ActiveSupport::TestCase |
| 147 | 147 | ent.data[:blocked] = true |
| 148 | 148 | ent.save |
| 149 | 149 | ent.unblock |
| 150 | - assert !Enterprise.find(ent.id).blocked? | |
| 150 | + refute Enterprise.find(ent.id).blocked? | |
| 151 | 151 | end |
| 152 | 152 | |
| 153 | 153 | should 'enable and make user admin' do |
| ... | ... | @@ -302,29 +302,29 @@ class EnterpriseTest < ActiveSupport::TestCase |
| 302 | 302 | e = Environment.default |
| 303 | 303 | e.expects(:required_enterprise_fields).returns(['contact_phone']).at_least_once |
| 304 | 304 | enterprise = build(Enterprise, :environment => e) |
| 305 | - assert ! enterprise.valid? | |
| 305 | + refute enterprise.valid? | |
| 306 | 306 | assert enterprise.errors[:contact_phone.to_s].present? |
| 307 | 307 | |
| 308 | 308 | enterprise.contact_phone = '99999' |
| 309 | 309 | enterprise.valid? |
| 310 | - assert ! enterprise.errors[:contact_phone.to_s].present? | |
| 310 | + refute enterprise.errors[:contact_phone.to_s].present? | |
| 311 | 311 | end |
| 312 | 312 | |
| 313 | 313 | should 'not require fields if enterprise is a template' do |
| 314 | 314 | e = Environment.default |
| 315 | 315 | e.expects(:required_enterprise_fields).returns(['contact_phone']).at_least_once |
| 316 | 316 | enterprise = build(Enterprise, :environment => e) |
| 317 | - assert ! enterprise.valid? | |
| 317 | + refute enterprise.valid? | |
| 318 | 318 | assert enterprise.errors[:contact_phone.to_s].present? |
| 319 | 319 | |
| 320 | 320 | enterprise.is_template = true |
| 321 | 321 | enterprise.valid? |
| 322 | - assert ! enterprise.errors[:contact_phone.to_s].present? | |
| 322 | + refute enterprise.errors[:contact_phone.to_s].present? | |
| 323 | 323 | end |
| 324 | 324 | |
| 325 | 325 | should 'enable contact' do |
| 326 | 326 | enterprise = build(Enterprise, :enable_contact_us => false) |
| 327 | - assert !enterprise.enable_contact? | |
| 327 | + refute enterprise.enable_contact? | |
| 328 | 328 | enterprise.enable_contact_us = true |
| 329 | 329 | assert enterprise.enable_contact? |
| 330 | 330 | end |
| ... | ... | @@ -370,7 +370,7 @@ class EnterpriseTest < ActiveSupport::TestCase |
| 370 | 370 | e.disable('enterprises_are_validated_when_created') |
| 371 | 371 | e.save |
| 372 | 372 | enterprise = create(Enterprise, :name => 'test enteprise', :identifier => 'test_ent2') |
| 373 | - assert !enterprise.validated | |
| 373 | + refute enterprise.validated | |
| 374 | 374 | end |
| 375 | 375 | |
| 376 | 376 | should 'have inactive_template when creating enterprise and feature is enabled' do |
| ... | ... | @@ -437,11 +437,11 @@ class EnterpriseTest < ActiveSupport::TestCase |
| 437 | 437 | p2 = fast_create(Person) |
| 438 | 438 | p3 = fast_create(Person) |
| 439 | 439 | |
| 440 | - assert !p1.is_member_of?(e) | |
| 440 | + refute p1.is_member_of?(e) | |
| 441 | 441 | e.add_member(p1) |
| 442 | 442 | assert p1.is_member_of?(e) |
| 443 | 443 | |
| 444 | - assert !p3.is_member_of?(e) | |
| 444 | + refute p3.is_member_of?(e) | |
| 445 | 445 | e.add_member(p3) |
| 446 | 446 | assert p3.is_member_of?(e) |
| 447 | 447 | |
| ... | ... | @@ -514,14 +514,14 @@ class EnterpriseTest < ActiveSupport::TestCase |
| 514 | 514 | |
| 515 | 515 | member = create_user('memberuser').person |
| 516 | 516 | c.add_member(member) |
| 517 | - assert !c.is_admin?(member) | |
| 517 | + refute c.is_admin?(member) | |
| 518 | 518 | end |
| 519 | 519 | |
| 520 | 520 | should 'a moderator user not be a community admin' do |
| 521 | 521 | c = fast_create(Enterprise, :name => 'my test profile', :identifier => 'mytestprofile') |
| 522 | 522 | moderator = create_user('moderatoruser').person |
| 523 | 523 | c.add_moderator(moderator) |
| 524 | - assert !c.is_admin?(moderator) | |
| 524 | + refute c.is_admin?(moderator) | |
| 525 | 525 | end |
| 526 | 526 | |
| 527 | 527 | ... | ... |
test/unit/environment_mailing_test.rb
| ... | ... | @@ -20,7 +20,7 @@ class EnvironmentMailingTest < ActiveSupport::TestCase |
| 20 | 20 | |
| 21 | 21 | mailing.source_id = environment.id |
| 22 | 22 | mailing.valid? |
| 23 | - assert !mailing.errors[:source_id].any? | |
| 23 | + refute mailing.errors[:source_id].any? | |
| 24 | 24 | end |
| 25 | 25 | |
| 26 | 26 | should 'return environment name' do |
| ... | ... | @@ -95,7 +95,7 @@ class EnvironmentMailingTest < ActiveSupport::TestCase |
| 95 | 95 | mailing = create_mailing(environment, :person => person_1) |
| 96 | 96 | process_delayed_job_queue |
| 97 | 97 | |
| 98 | - assert !mailing.mailing_sents.find_by_person_id(recipient.id) | |
| 98 | + refute mailing.mailing_sents.find_by_person_id(recipient.id) | |
| 99 | 99 | end |
| 100 | 100 | |
| 101 | 101 | def new_mailing(environment) | ... | ... |
test/unit/environment_test.rb
| ... | ... | @@ -11,7 +11,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 11 | 11 | |
| 12 | 12 | vc2 = build(Environment, :name => 'Another Test Community') |
| 13 | 13 | vc2.is_default = true |
| 14 | - assert !vc2.valid? | |
| 14 | + refute vc2.valid? | |
| 15 | 15 | assert vc2.errors[:is_default.to_s].present? |
| 16 | 16 | |
| 17 | 17 | assert_equal vc, Environment.default |
| ... | ... | @@ -38,7 +38,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 38 | 38 | v.enable('feature1', false) |
| 39 | 39 | assert v.enabled?('feature1') |
| 40 | 40 | v.disable('feature1', false) |
| 41 | - assert !v.enabled?('feature1') | |
| 41 | + refute v.enabled?('feature1') | |
| 42 | 42 | end |
| 43 | 43 | |
| 44 | 44 | def test_enabled_features |
| ... | ... | @@ -50,7 +50,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 50 | 50 | |
| 51 | 51 | def test_enabled_features_no_features_enabled |
| 52 | 52 | v = fast_create(Environment) |
| 53 | - assert !v.enabled?('feature1') && !v.enabled?('feature2') && !v.enabled?('feature3') | |
| 53 | + refute v.enabled?('feature1') && !v.enabled?('feature2') && !v.enabled?('feature3') | |
| 54 | 54 | end |
| 55 | 55 | |
| 56 | 56 | def test_default_enabled_features_are_enabled |
| ... | ... | @@ -66,7 +66,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 66 | 66 | assert v.errors[:name.to_s].present? |
| 67 | 67 | v.name = 'blablabla' |
| 68 | 68 | v.valid? |
| 69 | - assert !v.errors[:name.to_s].present? | |
| 69 | + refute v.errors[:name.to_s].present? | |
| 70 | 70 | end |
| 71 | 71 | |
| 72 | 72 | def test_terms_of_use |
| ... | ... | @@ -84,12 +84,12 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 84 | 84 | v.terms_of_use = "" |
| 85 | 85 | assert v.save |
| 86 | 86 | v.reload |
| 87 | - assert !v.has_terms_of_use? | |
| 87 | + refute v.has_terms_of_use? | |
| 88 | 88 | end |
| 89 | 89 | |
| 90 | 90 | def test_has_terms_of_use |
| 91 | 91 | v = Environment.new |
| 92 | - assert !v.has_terms_of_use? | |
| 92 | + refute v.has_terms_of_use? | |
| 93 | 93 | v.terms_of_use = 'some terms of use' |
| 94 | 94 | assert v.has_terms_of_use? |
| 95 | 95 | end |
| ... | ... | @@ -105,11 +105,11 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 105 | 105 | |
| 106 | 106 | def test_has_terms_of_enterprise_use |
| 107 | 107 | v = Environment.new |
| 108 | - assert !v.has_terms_of_enterprise_use? | |
| 108 | + refute v.has_terms_of_enterprise_use? | |
| 109 | 109 | v.terms_of_enterprise_use = 'some terms of enterprise use' |
| 110 | 110 | assert v.has_terms_of_enterprise_use? |
| 111 | 111 | v.terms_of_enterprise_use = '' |
| 112 | - assert !v.has_terms_of_enterprise_use? | |
| 112 | + refute v.has_terms_of_enterprise_use? | |
| 113 | 113 | end |
| 114 | 114 | |
| 115 | 115 | def test_should_list_top_level_categories |
| ... | ... | @@ -122,7 +122,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 122 | 122 | assert_equal 2, cats.size |
| 123 | 123 | assert cats.include?(cat1) |
| 124 | 124 | assert cats.include?(cat2) |
| 125 | - assert !cats.include?(subcat) | |
| 125 | + refute cats.include?(subcat) | |
| 126 | 126 | end |
| 127 | 127 | |
| 128 | 128 | def test_should_list_all_categories |
| ... | ... | @@ -157,18 +157,18 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 157 | 157 | should 'list displayable categories' do |
| 158 | 158 | env = fast_create(Environment) |
| 159 | 159 | cat1 = create(Category, :environment => env, :name => 'category one', :display_color => 'ffa500') |
| 160 | - assert ! cat1.new_record? | |
| 160 | + refute cat1.new_record? | |
| 161 | 161 | |
| 162 | 162 | # subcategories should be ignored |
| 163 | 163 | subcat1 = create(Category, :environment => env, :name => 'subcategory one', :parent_id => cat1.id) |
| 164 | - assert ! subcat1.new_record? | |
| 164 | + refute subcat1.new_record? | |
| 165 | 165 | |
| 166 | 166 | cat2 = create(Category, :environment => env, :name => 'category two') |
| 167 | - assert !cat2.new_record? | |
| 167 | + refute cat2.new_record? | |
| 168 | 168 | |
| 169 | 169 | assert_equal 1, env.display_categories.size |
| 170 | 170 | assert env.display_categories.include?(cat1) |
| 171 | - assert !env.display_categories.include?(cat2) | |
| 171 | + refute env.display_categories.include?(cat2) | |
| 172 | 172 | end |
| 173 | 173 | |
| 174 | 174 | should 'have regions' do |
| ... | ... | @@ -192,7 +192,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 192 | 192 | |
| 193 | 193 | env.contact_email = 'test@example.com' |
| 194 | 194 | env.valid? |
| 195 | - assert !env.errors[:contact_email.to_s].present? | |
| 195 | + refute env.errors[:contact_email.to_s].present? | |
| 196 | 196 | end |
| 197 | 197 | |
| 198 | 198 | should 'notify contact email' do |
| ... | ... | @@ -512,10 +512,10 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 512 | 512 | assert_kind_of Person, e.person_default_template |
| 513 | 513 | |
| 514 | 514 | # the templates must be private |
| 515 | - assert !e.enterprise_default_template.visible? | |
| 516 | - assert !e.inactive_enterprise_template.visible? | |
| 517 | - assert !e.community_default_template.visible? | |
| 518 | - assert !e.person_default_template.visible? | |
| 515 | + refute e.enterprise_default_template.visible? | |
| 516 | + refute e.inactive_enterprise_template.visible? | |
| 517 | + refute e.community_default_template.visible? | |
| 518 | + refute e.person_default_template.visible? | |
| 519 | 519 | end |
| 520 | 520 | |
| 521 | 521 | should 'person_templates return all templates of person' do |
| ... | ... | @@ -710,7 +710,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 710 | 710 | |
| 711 | 711 | p2 = fast_create(Person, :is_template => true, :environment_id => env.id) |
| 712 | 712 | env.person_default_template= p2.id |
| 713 | - assert !env.is_default_template?(p1) | |
| 713 | + refute env.is_default_template?(p1) | |
| 714 | 714 | end |
| 715 | 715 | |
| 716 | 716 | should 'is_default_template? method identify a community default template as default' do |
| ... | ... | @@ -722,7 +722,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 722 | 722 | |
| 723 | 723 | c2 = fast_create(Community, :is_template => true, :environment_id => env.id) |
| 724 | 724 | env.community_default_template= c2.id |
| 725 | - assert !env.is_default_template?(c1) | |
| 725 | + refute env.is_default_template?(c1) | |
| 726 | 726 | end |
| 727 | 727 | |
| 728 | 728 | should 'is_default_template? method identify a enterprise default template as default' do |
| ... | ... | @@ -734,7 +734,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 734 | 734 | |
| 735 | 735 | e2 = fast_create(Enterprise, :is_template => true, :environment_id => env.id) |
| 736 | 736 | env.enterprise_default_template= e2.id |
| 737 | - assert !env.is_default_template?(e1) | |
| 737 | + refute env.is_default_template?(e1) | |
| 738 | 738 | end |
| 739 | 739 | |
| 740 | 740 | should 'have a layout template' do |
| ... | ... | @@ -772,7 +772,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 772 | 772 | env.custom_person_fields = { 'birth_date' => {'required' => 'true', 'active' => 'true'}, 'cell_phone' => {'required' => 'true', 'active' => 'true'}} |
| 773 | 773 | expected_hash = {'cell_phone' => {'required' => 'true', 'active' => 'true', 'signup' => 'true'}} |
| 774 | 774 | assert(env.custom_person_fields.merge(expected_hash) == env.custom_person_fields) |
| 775 | - assert ! env.custom_person_fields.keys.include?('birth_date') | |
| 775 | + refute env.custom_person_fields.keys.include?('birth_date') | |
| 776 | 776 | end |
| 777 | 777 | |
| 778 | 778 | should 'add schooling_status if custom_person_fields has schooling' do |
| ... | ... | @@ -782,7 +782,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 782 | 782 | env.custom_person_fields = { 'schooling' => {'required' => 'true', 'active' => 'true'}} |
| 783 | 783 | expected_hash = {'schooling' => {'required' => 'true', 'active' => 'true', 'signup' => 'true'}, 'schooling_status' => {'required' => 'true', 'signup' => 'true', 'active' => 'true'}} |
| 784 | 784 | assert(env.custom_person_fields.merge(expected_hash) == env.custom_person_fields) |
| 785 | - assert ! env.custom_person_fields.keys.include?('birth_date') | |
| 785 | + refute env.custom_person_fields.keys.include?('birth_date') | |
| 786 | 786 | end |
| 787 | 787 | |
| 788 | 788 | should 'return person_fields status' do |
| ... | ... | @@ -846,7 +846,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 846 | 846 | |
| 847 | 847 | env.custom_enterprise_fields = { 'contact_email' => {'required' => 'true', 'active' => 'true'}, 'contact_person' => {'required' => 'true', 'active' => 'true'}} |
| 848 | 848 | assert_equal({'contact_person' => {'required' => 'true', 'signup' => 'true', 'active' => 'true'}}, env.custom_enterprise_fields) |
| 849 | - assert ! env.custom_enterprise_fields.keys.include?('contact_email') | |
| 849 | + refute env.custom_enterprise_fields.keys.include?('contact_email') | |
| 850 | 850 | end |
| 851 | 851 | |
| 852 | 852 | should 'return enteprise_fields status' do |
| ... | ... | @@ -889,7 +889,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 889 | 889 | |
| 890 | 890 | env.custom_community_fields = { 'contact_email' => {'required' => 'true', 'active' => 'true'}, 'contact_person' => {'required' => 'true', 'active' => 'true'}} |
| 891 | 891 | assert_equal({'contact_person' => {'required' => 'true', 'signup' => 'true', 'active' => 'true'}}, env.custom_community_fields) |
| 892 | - assert ! env.custom_community_fields.keys.include?('contact_email') | |
| 892 | + refute env.custom_community_fields.keys.include?('contact_email') | |
| 893 | 893 | end |
| 894 | 894 | |
| 895 | 895 | should 'return community_fields status' do |
| ... | ... | @@ -1165,7 +1165,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 1165 | 1165 | should "terms of use not be an blank string" do |
| 1166 | 1166 | v = fast_create(Environment) |
| 1167 | 1167 | v.terms_of_use = ' ' |
| 1168 | - assert !v.has_terms_of_use? | |
| 1168 | + refute v.has_terms_of_use? | |
| 1169 | 1169 | end |
| 1170 | 1170 | |
| 1171 | 1171 | should 'have currency unit attribute' do |
| ... | ... | @@ -1410,7 +1410,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 1410 | 1410 | |
| 1411 | 1411 | environment.reports_lower_bound = 5 |
| 1412 | 1412 | environment.valid? |
| 1413 | - assert !environment.errors[:reports_lower_bound.to_s].present? | |
| 1413 | + refute environment.errors[:reports_lower_bound.to_s].present? | |
| 1414 | 1414 | end |
| 1415 | 1415 | |
| 1416 | 1416 | should 'be able to enable or disable a plugin with the class or class name' do |
| ... | ... | @@ -1424,7 +1424,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 1424 | 1424 | |
| 1425 | 1425 | environment.disable_plugin(Plugin.to_s) |
| 1426 | 1426 | environment.reload |
| 1427 | - assert !environment.plugin_enabled?(Plugin) | |
| 1427 | + refute environment.plugin_enabled?(Plugin) | |
| 1428 | 1428 | end |
| 1429 | 1429 | |
| 1430 | 1430 | should 'activate on database all available plugins' do |
| ... | ... | @@ -1492,7 +1492,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 1492 | 1492 | Environment.login_redirection_options.keys.each do |redirection| |
| 1493 | 1493 | environment.redirection_after_login = redirection |
| 1494 | 1494 | environment.save |
| 1495 | - assert !environment.errors[:redirection_after_login.to_s].present? | |
| 1495 | + refute environment.errors[:redirection_after_login.to_s].present? | |
| 1496 | 1496 | end |
| 1497 | 1497 | end |
| 1498 | 1498 | |
| ... | ... | @@ -1513,7 +1513,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 1513 | 1513 | Environment.signup_redirection_options.keys.each do |redirection| |
| 1514 | 1514 | environment.redirection_after_signup = redirection |
| 1515 | 1515 | environment.save |
| 1516 | - assert !environment.errors[:redirection_after_signup.to_s].present? | |
| 1516 | + refute environment.errors[:redirection_after_signup.to_s].present? | |
| 1517 | 1517 | end |
| 1518 | 1518 | end |
| 1519 | 1519 | |
| ... | ... | @@ -1537,14 +1537,14 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 1537 | 1537 | |
| 1538 | 1538 | should 'not consider signup welcome text if not defined' do |
| 1539 | 1539 | env = Environment.default |
| 1540 | - assert !env.has_signup_welcome_text? | |
| 1540 | + refute env.has_signup_welcome_text? | |
| 1541 | 1541 | end |
| 1542 | 1542 | |
| 1543 | 1543 | should 'not consider signup welcome text if nil' do |
| 1544 | 1544 | env = Environment.default |
| 1545 | 1545 | |
| 1546 | 1546 | env.signup_welcome_text = nil |
| 1547 | - assert !env.has_signup_welcome_text? | |
| 1547 | + refute env.has_signup_welcome_text? | |
| 1548 | 1548 | end |
| 1549 | 1549 | |
| 1550 | 1550 | should 'not consider signup welcome text if body is nil' do |
| ... | ... | @@ -1553,7 +1553,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 1553 | 1553 | env.signup_welcome_text = { |
| 1554 | 1554 | :subject => 'Welcome to the environment', |
| 1555 | 1555 | } |
| 1556 | - assert !env.has_signup_welcome_text? | |
| 1556 | + refute env.has_signup_welcome_text? | |
| 1557 | 1557 | end |
| 1558 | 1558 | |
| 1559 | 1559 | should 'consider signup welcome text if subject is nil but body is defined' do |
| ... | ... | @@ -1604,7 +1604,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 1604 | 1604 | |
| 1605 | 1605 | environment.default_language = 'en' |
| 1606 | 1606 | environment.valid? |
| 1607 | - assert !environment.errors[:default_language.to_s].present? | |
| 1607 | + refute environment.errors[:default_language.to_s].present? | |
| 1608 | 1608 | end |
| 1609 | 1609 | |
| 1610 | 1610 | should 'define default locale or use the config default locale' do |
| ... | ... | @@ -1627,7 +1627,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 1627 | 1627 | |
| 1628 | 1628 | environment.languages = ['en'] |
| 1629 | 1629 | environment.valid? |
| 1630 | - assert !environment.errors[:languages.to_s].present? | |
| 1630 | + refute environment.errors[:languages.to_s].present? | |
| 1631 | 1631 | end |
| 1632 | 1632 | |
| 1633 | 1633 | should 'define locales or use the config locales' do |
| ... | ... | @@ -1655,14 +1655,14 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 1655 | 1655 | |
| 1656 | 1656 | should 'not consider custom welcome screen text if not defined' do |
| 1657 | 1657 | env = Environment.default |
| 1658 | - assert !env.has_custom_welcome_screen? | |
| 1658 | + refute env.has_custom_welcome_screen? | |
| 1659 | 1659 | end |
| 1660 | 1660 | |
| 1661 | 1661 | should 'not consider custom welcome screen text if nil' do |
| 1662 | 1662 | env = Environment.default |
| 1663 | 1663 | |
| 1664 | 1664 | env.signup_welcome_screen_body = nil |
| 1665 | - assert !env.has_custom_welcome_screen? | |
| 1665 | + refute env.has_custom_welcome_screen? | |
| 1666 | 1666 | end |
| 1667 | 1667 | |
| 1668 | 1668 | should 'consider signup welcome screen if body is defined' do |
| ... | ... | @@ -1699,7 +1699,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 1699 | 1699 | should 'has_license be false if there is no license in enviroment' do |
| 1700 | 1700 | e = fast_create(Environment) |
| 1701 | 1701 | |
| 1702 | - assert !e.has_license? | |
| 1702 | + refute e.has_license? | |
| 1703 | 1703 | end |
| 1704 | 1704 | |
| 1705 | 1705 | should 'validates_inclusion_of date format' do |
| ... | ... | @@ -1711,23 +1711,23 @@ class EnvironmentTest < ActiveSupport::TestCase |
| 1711 | 1711 | |
| 1712 | 1712 | environment.date_format = "numbers_with_year" |
| 1713 | 1713 | environment.valid? |
| 1714 | - assert !environment.errors[:date_format.to_s].present? | |
| 1714 | + refute environment.errors[:date_format.to_s].present? | |
| 1715 | 1715 | |
| 1716 | 1716 | environment.date_format = "numbers" |
| 1717 | 1717 | environment.valid? |
| 1718 | - assert !environment.errors[:date_format.to_s].present? | |
| 1718 | + refute environment.errors[:date_format.to_s].present? | |
| 1719 | 1719 | |
| 1720 | 1720 | environment.date_format = "month_name_with_year" |
| 1721 | 1721 | environment.valid? |
| 1722 | - assert !environment.errors[:date_format.to_s].present? | |
| 1722 | + refute environment.errors[:date_format.to_s].present? | |
| 1723 | 1723 | |
| 1724 | 1724 | environment.date_format = "month_name" |
| 1725 | 1725 | environment.valid? |
| 1726 | - assert !environment.errors[:date_format.to_s].present? | |
| 1726 | + refute environment.errors[:date_format.to_s].present? | |
| 1727 | 1727 | |
| 1728 | 1728 | environment.date_format = "past_time" |
| 1729 | 1729 | environment.valid? |
| 1730 | - assert !environment.errors[:date_format.to_s].present? | |
| 1730 | + refute environment.errors[:date_format.to_s].present? | |
| 1731 | 1731 | end |
| 1732 | 1732 | |
| 1733 | 1733 | end | ... | ... |
test/unit/event_test.rb
| ... | ... | @@ -47,7 +47,7 @@ class EventTest < ActiveSupport::TestCase |
| 47 | 47 | assert e.errors[:start_date.to_s].present? |
| 48 | 48 | e.start_date = Date.today |
| 49 | 49 | e.valid? |
| 50 | - assert !e.errors[:start_date.to_s].present? | |
| 50 | + refute e.errors[:start_date.to_s].present? | |
| 51 | 51 | end |
| 52 | 52 | |
| 53 | 53 | should 'have a end date' do |
| ... | ... | @@ -67,7 +67,7 @@ class EventTest < ActiveSupport::TestCase |
| 67 | 67 | |
| 68 | 68 | e.end_date = Date.new(2008,01,05) |
| 69 | 69 | e.valid? |
| 70 | - assert !e.errors[:start_date.to_s].present? | |
| 70 | + refute e.errors[:start_date.to_s].present? | |
| 71 | 71 | end |
| 72 | 72 | |
| 73 | 73 | should 'find by range of dates' do |
| ... | ... | @@ -223,8 +223,8 @@ class EventTest < ActiveSupport::TestCase |
| 223 | 223 | assert month_events.include?(current_month_event_1) |
| 224 | 224 | assert month_events.include?(current_month_event_2) |
| 225 | 225 | |
| 226 | - assert !month_events.include?(last_month_event) | |
| 227 | - assert !month_events.include?(next_month_event) | |
| 226 | + refute month_events.include?(last_month_event) | |
| 227 | + refute month_events.include?(next_month_event) | |
| 228 | 228 | end |
| 229 | 229 | |
| 230 | 230 | should 'event by month ordered by start date'do |
| ... | ... | @@ -339,7 +339,7 @@ class EventTest < ActiveSupport::TestCase |
| 339 | 339 | |
| 340 | 340 | event = Event.new(:profile => profile) |
| 341 | 341 | |
| 342 | - assert !event.translatable? | |
| 342 | + refute event.translatable? | |
| 343 | 343 | end |
| 344 | 344 | |
| 345 | 345 | should 'be translatable if there is languages on environment' do |
| ... | ... | @@ -348,7 +348,7 @@ class EventTest < ActiveSupport::TestCase |
| 348 | 348 | profile = fast_create(Person, :environment_id => environment.id) |
| 349 | 349 | event = fast_create(Event, :profile_id => profile.id) |
| 350 | 350 | |
| 351 | - assert !event.translatable? | |
| 351 | + refute event.translatable? | |
| 352 | 352 | |
| 353 | 353 | |
| 354 | 354 | environment.languages = ['en','pt','fr'] | ... | ... |
test/unit/external_feed_test.rb
| ... | ... | @@ -21,7 +21,7 @@ class ExternalFeedTest < ActiveSupport::TestCase |
| 21 | 21 | blog = create_blog |
| 22 | 22 | e = create(:external_feed, blog: blog) |
| 23 | 23 | assert e.add_item('Article title', 'http://orig.link.invalid', Time.now, 'Content for external post') |
| 24 | - assert !e.add_item('Article title', 'http://orig.link.invalid', Time.now, 'Content for external post') | |
| 24 | + refute e.add_item('Article title', 'http://orig.link.invalid', Time.now, 'Content for external post') | |
| 25 | 25 | assert_equal 1, e.blog.posts.size |
| 26 | 26 | end |
| 27 | 27 | |
| ... | ... | @@ -61,7 +61,7 @@ class ExternalFeedTest < ActiveSupport::TestCase |
| 61 | 61 | |
| 62 | 62 | should 'require address if enabled' do |
| 63 | 63 | e = build(ExternalFeed, :enabled => true, :address => nil) |
| 64 | - assert !e.valid? | |
| 64 | + refute e.valid? | |
| 65 | 65 | assert e.errors[:address].present? |
| 66 | 66 | end |
| 67 | 67 | ... | ... |
test/unit/feed_handler_test.rb
| ... | ... | @@ -104,13 +104,13 @@ class FeedHandlerTest < ActiveSupport::TestCase |
| 104 | 104 | |
| 105 | 105 | # in the first 4 errors, we are ok |
| 106 | 106 | 4.times { handler.process(container) } |
| 107 | - assert !container.error_message.blank?, 'should set the error message for the first <max_errors> errors (%s)' % container_class | |
| 107 | + refute container.error_message.blank?, 'should set the error message for the first <max_errors> errors (%s)' % container_class | |
| 108 | 108 | assert container.enabled, 'must keep container enabled during the first <max_errors> errors (%s)' % container_class |
| 109 | 109 | |
| 110 | 110 | # 5 errors it too much |
| 111 | 111 | handler.process(container) |
| 112 | - assert !container.error_message.blank?, 'must set error message in container after <max_errors> errors (%s)' % container_class | |
| 113 | - assert !container.enabled, 'must disable continer after <max_errors> errors (%s)' % container_class | |
| 112 | + refute container.error_message.blank?, 'must set error message in container after <max_errors> errors (%s)' % container_class | |
| 113 | + refute container.enabled, 'must disable continer after <max_errors> errors (%s)' % container_class | |
| 114 | 114 | end |
| 115 | 115 | |
| 116 | 116 | should "reenable after <disabled_period> (#{container_class})" do | ... | ... |
test/unit/forum_test.rb
| ... | ... | @@ -107,7 +107,7 @@ class ForumTest < ActiveSupport::TestCase |
| 107 | 107 | |
| 108 | 108 | should 'not accept uploads' do |
| 109 | 109 | folder = fast_create(Forum) |
| 110 | - assert !folder.accept_uploads? | |
| 110 | + refute folder.accept_uploads? | |
| 111 | 111 | end |
| 112 | 112 | |
| 113 | 113 | should 'be notifiable' do |
| ... | ... | @@ -180,7 +180,7 @@ class ForumTest < ActiveSupport::TestCase |
| 180 | 180 | forum = Forum.new(:profile => person) |
| 181 | 181 | |
| 182 | 182 | assert forum.can_create_topic?(person) |
| 183 | - assert !forum.can_create_topic?(someone) | |
| 183 | + refute forum.can_create_topic?(someone) | |
| 184 | 184 | end |
| 185 | 185 | |
| 186 | 186 | should 'always allow topic creation to profile admins' do |
| ... | ... | @@ -192,7 +192,7 @@ class ForumTest < ActiveSupport::TestCase |
| 192 | 192 | forum = Forum.new(:profile => profile) |
| 193 | 193 | |
| 194 | 194 | assert forum.can_create_topic?(admin) |
| 195 | - assert !forum.can_create_topic?(someone) | |
| 195 | + refute forum.can_create_topic?(someone) | |
| 196 | 196 | end |
| 197 | 197 | |
| 198 | 198 | should 'always allow topic creation to environment admins' do |
| ... | ... | @@ -205,7 +205,7 @@ class ForumTest < ActiveSupport::TestCase |
| 205 | 205 | forum = Forum.new(:profile => profile) |
| 206 | 206 | |
| 207 | 207 | assert forum.can_create_topic?(admin) |
| 208 | - assert !forum.can_create_topic?(someone) | |
| 208 | + refute forum.can_create_topic?(someone) | |
| 209 | 209 | end |
| 210 | 210 | |
| 211 | 211 | should 'allow only person friends to create topics when topic_creation is related' do |
| ... | ... | @@ -217,7 +217,7 @@ class ForumTest < ActiveSupport::TestCase |
| 217 | 217 | forum = Forum.new(:profile => person, :topic_creation => 'related') |
| 218 | 218 | |
| 219 | 219 | assert forum.can_create_topic?(friend) |
| 220 | - assert !forum.can_create_topic?(someone) | |
| 220 | + refute forum.can_create_topic?(someone) | |
| 221 | 221 | end |
| 222 | 222 | |
| 223 | 223 | should 'allow only group members to create topics when topic_creation is related' do |
| ... | ... | @@ -229,7 +229,7 @@ class ForumTest < ActiveSupport::TestCase |
| 229 | 229 | forum = Forum.new(:profile => organization, :topic_creation => 'related') |
| 230 | 230 | |
| 231 | 231 | assert forum.can_create_topic?(member) |
| 232 | - assert !forum.can_create_topic?(someone) | |
| 232 | + refute forum.can_create_topic?(someone) | |
| 233 | 233 | end |
| 234 | 234 | |
| 235 | 235 | should 'allow every user to create topics when topic_creation is users' do |
| ... | ... | @@ -238,6 +238,6 @@ class ForumTest < ActiveSupport::TestCase |
| 238 | 238 | forum = Forum.new(:profile => profile, :topic_creation => 'users') |
| 239 | 239 | |
| 240 | 240 | assert forum.can_create_topic?(user) |
| 241 | - assert !forum.can_create_topic?(nil) | |
| 241 | + refute forum.can_create_topic?(nil) | |
| 242 | 242 | end |
| 243 | 243 | end | ... | ... |
test/unit/image_test.rb
| ... | ... | @@ -47,7 +47,7 @@ class ImageTest < ActiveSupport::TestCase |
| 47 | 47 | end |
| 48 | 48 | |
| 49 | 49 | should 'return false by default in thumbnails_processed' do |
| 50 | - assert !Image.new.thumbnails_processed | |
| 50 | + refute Image.new.thumbnails_processed | |
| 51 | 51 | end |
| 52 | 52 | |
| 53 | 53 | should 'set thumbnails_processed to true' do | ... | ... |
test/unit/input_test.rb
| ... | ... | @@ -11,7 +11,7 @@ class InputTest < ActiveSupport::TestCase |
| 11 | 11 | |
| 12 | 12 | input.product_category = product_category |
| 13 | 13 | input.valid? |
| 14 | - assert !input.errors[:product_category.to_s].present? | |
| 14 | + refute input.errors[:product_category.to_s].present? | |
| 15 | 15 | end |
| 16 | 16 | |
| 17 | 17 | should 'require product' do |
| ... | ... | @@ -24,7 +24,7 @@ class InputTest < ActiveSupport::TestCase |
| 24 | 24 | |
| 25 | 25 | input.product = product |
| 26 | 26 | input.valid? |
| 27 | - assert !input.errors[:product.to_s].present? | |
| 27 | + refute input.errors[:product.to_s].present? | |
| 28 | 28 | end |
| 29 | 29 | |
| 30 | 30 | should 'store inputs ordered by position' do |
| ... | ... | @@ -64,7 +64,7 @@ class InputTest < ActiveSupport::TestCase |
| 64 | 64 | |
| 65 | 65 | should 'dont have price details when price related fields was not filled' do |
| 66 | 66 | input = Input.new |
| 67 | - assert !input.has_price_details? | |
| 67 | + refute input.has_price_details? | |
| 68 | 68 | end |
| 69 | 69 | |
| 70 | 70 | should 'has price details if price_per_unit filled' do |
| ... | ... | @@ -79,7 +79,7 @@ class InputTest < ActiveSupport::TestCase |
| 79 | 79 | |
| 80 | 80 | should 'not have price details if only unit is filled' do |
| 81 | 81 | input = build(Input, :unit => Unit.new) |
| 82 | - assert !input.has_price_details? | |
| 82 | + refute input.has_price_details? | |
| 83 | 83 | end |
| 84 | 84 | |
| 85 | 85 | should 'accept price_per_unit in american\'s or brazilian\'s currency format' do | ... | ... |
test/unit/invite_friend_test.rb
| ... | ... | @@ -116,10 +116,10 @@ class InviteFriendTest < ActiveSupport::TestCase |
| 116 | 116 | p = create_user('testuser1').person |
| 117 | 117 | |
| 118 | 118 | task1 = InviteFriend.new(:person => p, :friend => p, :message => 'click here: <url>') |
| 119 | - assert !task1.save | |
| 119 | + refute task1.save | |
| 120 | 120 | |
| 121 | 121 | task2 = InviteFriend.new(:person => p, :friend_name => 'Myself', :friend_email => p.user.email, :message => 'click here: <url>') |
| 122 | - assert !task2.save | |
| 122 | + refute task2.save | |
| 123 | 123 | end |
| 124 | 124 | |
| 125 | 125 | should 'have target notification description' do | ... | ... |
test/unit/invite_member_test.rb
| ... | ... | @@ -107,10 +107,10 @@ class InviteMemberTest < ActiveSupport::TestCase |
| 107 | 107 | p = create_user('testuser1').person |
| 108 | 108 | |
| 109 | 109 | task1 = build(InviteMember, :person => p, :friend => p, :message => 'click here: <url>') |
| 110 | - assert !task1.save | |
| 110 | + refute task1.save | |
| 111 | 111 | |
| 112 | 112 | task2 = build(InviteMember, :person => p, :friend_name => 'Myself', :friend_email => p.user.email, :message => 'click here: <url>') |
| 113 | - assert !task2.save | |
| 113 | + refute task2.save | |
| 114 | 114 | end |
| 115 | 115 | |
| 116 | 116 | should 'have target notification description' do | ... | ... |
test/unit/license_test.rb
| ... | ... | @@ -10,8 +10,8 @@ class LicenseTest < ActiveSupport::TestCase |
| 10 | 10 | license.name = 'GPLv3' |
| 11 | 11 | license.environment = Environment.default |
| 12 | 12 | license.valid? |
| 13 | - assert !license.errors[:name].any? | |
| 14 | - assert !license.errors[:environment].any? | |
| 13 | + refute license.errors[:name].any? | |
| 14 | + refute license.errors[:environment].any? | |
| 15 | 15 | end |
| 16 | 16 | |
| 17 | 17 | should 'fill in slug before creation' do | ... | ... |
test/unit/mailing_test.rb
| ... | ... | @@ -27,7 +27,7 @@ class MailingTest < ActiveSupport::TestCase |
| 27 | 27 | |
| 28 | 28 | mailing.source_id = Environment.default.id |
| 29 | 29 | mailing.valid? |
| 30 | - assert !mailing.errors[:source_id.to_s].present? | |
| 30 | + refute mailing.errors[:source_id.to_s].present? | |
| 31 | 31 | end |
| 32 | 32 | |
| 33 | 33 | should 'require subject' do |
| ... | ... | @@ -37,7 +37,7 @@ class MailingTest < ActiveSupport::TestCase |
| 37 | 37 | |
| 38 | 38 | mailing.subject = 'Hello :)' |
| 39 | 39 | mailing.valid? |
| 40 | - assert !mailing.errors[:subject.to_s].present? | |
| 40 | + refute mailing.errors[:subject.to_s].present? | |
| 41 | 41 | end |
| 42 | 42 | |
| 43 | 43 | should 'require body' do |
| ... | ... | @@ -47,7 +47,7 @@ class MailingTest < ActiveSupport::TestCase |
| 47 | 47 | |
| 48 | 48 | mailing.body = 'We have some news!' |
| 49 | 49 | mailing.valid? |
| 50 | - assert !mailing.errors[:body.to_s].present? | |
| 50 | + refute mailing.errors[:body.to_s].present? | |
| 51 | 51 | end |
| 52 | 52 | |
| 53 | 53 | should 'return source' do | ... | ... |
test/unit/main_block_test.rb
| ... | ... | @@ -26,7 +26,7 @@ class MainBlockTest < ActiveSupport::TestCase |
| 26 | 26 | env = Environment.new |
| 27 | 27 | block = MainBlock.new(:display => 'never') |
| 28 | 28 | block.stubs(:owner).returns(env) |
| 29 | - assert !block.visible? | |
| 29 | + refute block.visible? | |
| 30 | 30 | end |
| 31 | 31 | |
| 32 | 32 | should 'guarantee main block is always visible to everybody' do | ... | ... |
test/unit/moderate_user_registration_test.rb
| ... | ... | @@ -15,7 +15,7 @@ class ModerateUserRegistrationTest < ActiveSupport::TestCase |
| 15 | 15 | t.email = user.email |
| 16 | 16 | t.target= environment |
| 17 | 17 | t.save! |
| 18 | - assert !user.activated? | |
| 18 | + refute user.activated? | |
| 19 | 19 | t.perform |
| 20 | 20 | assert environment.users.find_by_id(user.id).activated? |
| 21 | 21 | end | ... | ... |
test/unit/multi_tenancy.rb
| ... | ... | @@ -31,7 +31,7 @@ class MultiTenancyTest < ActiveSupport::TestCase |
| 31 | 31 | def test_multitenancy_is_off_if_it_is_not_a_hosted_environment_and_there_is_no_mapping |
| 32 | 32 | Noosfero::MultiTenancy.expects(:mapping).returns({}) |
| 33 | 33 | Noosfero::MultiTenancy.expects(:is_hosted_environment?).returns(false) |
| 34 | - assert !Noosfero::MultiTenancy.on? | |
| 34 | + refute Noosfero::MultiTenancy.on? | |
| 35 | 35 | end |
| 36 | 36 | |
| 37 | 37 | def test_set_schema_by_host |
| ... | ... | @@ -54,7 +54,7 @@ class MultiTenancyTest < ActiveSupport::TestCase |
| 54 | 54 | |
| 55 | 55 | def test_if_is_not_hosted_environment |
| 56 | 56 | YAML.expects(:load_file).returns(db_config) |
| 57 | - assert !Noosfero::MultiTenancy.send(:is_hosted_environment?) | |
| 57 | + refute Noosfero::MultiTenancy.send(:is_hosted_environment?) | |
| 58 | 58 | end |
| 59 | 59 | |
| 60 | 60 | private | ... | ... |
test/unit/national_region_test.rb
| ... | ... | @@ -27,7 +27,7 @@ class NationalRegionTest < ActiveSupport::TestCase |
| 27 | 27 | |
| 28 | 28 | found_regions = NationalRegion.search_city('Santo %', true) |
| 29 | 29 | |
| 30 | - assert !(found_regions.length != 3) | |
| 30 | + refute (found_regions.length != 3) | |
| 31 | 31 | |
| 32 | 32 | found_regions.each do |region| |
| 33 | 33 | assert city_names.find_index(region.city) >= 0 |
| ... | ... | @@ -60,7 +60,7 @@ class NationalRegionTest < ActiveSupport::TestCase |
| 60 | 60 | |
| 61 | 61 | found_regions = NationalRegion.search_state('Rio %', true) |
| 62 | 62 | |
| 63 | - assert !(found_regions.length != 3) | |
| 63 | + refute (found_regions.length != 3) | |
| 64 | 64 | |
| 65 | 65 | found_regions.each do |region| |
| 66 | 66 | assert state_names.find_index(region.state) >= 0 | ... | ... |
test/unit/notify_activity_to_profiles_job_test.rb
| ... | ... | @@ -28,7 +28,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase |
| 28 | 28 | person = fast_create(Person) |
| 29 | 29 | community = fast_create(Community) |
| 30 | 30 | action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :verb => 'create_article') |
| 31 | - assert !NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) | |
| 31 | + refute NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) | |
| 32 | 32 | p1, p2, m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) |
| 33 | 33 | fast_create(Friendship, :person_id => person.id, :friend_id => p1.id) |
| 34 | 34 | fast_create(Friendship, :person_id => person.id, :friend_id => p2.id) |
| ... | ... | @@ -50,7 +50,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase |
| 50 | 50 | person = fast_create(Person) |
| 51 | 51 | community = fast_create(Community) |
| 52 | 52 | action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :target_id => community.id, :verb => 'create_article') |
| 53 | - assert !NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) | |
| 53 | + refute NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) | |
| 54 | 54 | m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) |
| 55 | 55 | fast_create(RoleAssignment, :accessor_id => m1.id, :role_id => 3, :resource_id => community.id) |
| 56 | 56 | fast_create(RoleAssignment, :accessor_id => m2.id, :role_id => 3, :resource_id => community.id) |
| ... | ... | @@ -70,7 +70,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase |
| 70 | 70 | person = fast_create(Person) |
| 71 | 71 | community = fast_create(Community) |
| 72 | 72 | action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :target_id => community.id, :verb => 'create_article') |
| 73 | - assert !NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) | |
| 73 | + refute NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) | |
| 74 | 74 | p1, p2, m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) |
| 75 | 75 | fast_create(Friendship, :person_id => person.id, :friend_id => p1.id) |
| 76 | 76 | fast_create(Friendship, :person_id => person.id, :friend_id => p2.id) |
| ... | ... | @@ -92,7 +92,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase |
| 92 | 92 | person = fast_create(Person) |
| 93 | 93 | private_community = fast_create(Community, :public_profile => false) |
| 94 | 94 | action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :target_id => private_community.id, :verb => 'create_article') |
| 95 | - assert !NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) | |
| 95 | + refute NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) | |
| 96 | 96 | p1, p2, m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) |
| 97 | 97 | fast_create(Friendship, :person_id => person.id, :friend_id => p1.id) |
| 98 | 98 | fast_create(Friendship, :person_id => person.id, :friend_id => p2.id) |
| ... | ... | @@ -117,7 +117,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase |
| 117 | 117 | person = fast_create(Person) |
| 118 | 118 | community = fast_create(Community) |
| 119 | 119 | action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :target_id => community.id, :verb => 'join_community') |
| 120 | - assert !NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) | |
| 120 | + refute NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) | |
| 121 | 121 | p1, p2, m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) |
| 122 | 122 | fast_create(Friendship, :person_id => person.id, :friend_id => p1.id) |
| 123 | 123 | fast_create(Friendship, :person_id => person.id, :friend_id => p2.id) | ... | ... |
test/unit/organization_mailing_test.rb
| ... | ... | @@ -22,7 +22,7 @@ class OrganizationMailingTest < ActiveSupport::TestCase |
| 22 | 22 | |
| 23 | 23 | mailing.source_id = community.id |
| 24 | 24 | mailing.valid? |
| 25 | - assert !mailing.errors[:source_id.to_s].present? | |
| 25 | + refute mailing.errors[:source_id.to_s].present? | |
| 26 | 26 | end |
| 27 | 27 | |
| 28 | 28 | should 'return community name' do |
| ... | ... | @@ -115,7 +115,7 @@ class OrganizationMailingTest < ActiveSupport::TestCase |
| 115 | 115 | mailing = create(OrganizationMailing, :source => community, :subject => 'Hello', :body => 'We have some news', :person => person) |
| 116 | 116 | process_delayed_job_queue |
| 117 | 117 | |
| 118 | - assert !mailing.mailing_sents.find_by_person_id(recipient.id) | |
| 118 | + refute mailing.mailing_sents.find_by_person_id(recipient.id) | |
| 119 | 119 | end |
| 120 | 120 | |
| 121 | 121 | protected | ... | ... |
test/unit/organization_test.rb
| ... | ... | @@ -80,11 +80,11 @@ class OrganizationTest < ActiveSupport::TestCase |
| 80 | 80 | should 'validate contact_email if filled' do |
| 81 | 81 | org = Organization.new |
| 82 | 82 | org.valid? |
| 83 | - assert !org.errors[:contact_email.to_s].present? | |
| 83 | + refute org.errors[:contact_email.to_s].present? | |
| 84 | 84 | |
| 85 | 85 | org.contact_email = '' |
| 86 | 86 | org.valid? |
| 87 | - assert !org.errors[:contact_email.to_s].present? | |
| 87 | + refute org.errors[:contact_email.to_s].present? | |
| 88 | 88 | |
| 89 | 89 | |
| 90 | 90 | org.contact_email = 'invalid-email' |
| ... | ... | @@ -93,7 +93,7 @@ class OrganizationTest < ActiveSupport::TestCase |
| 93 | 93 | |
| 94 | 94 | org.contact_email = 'someone@somedomain.com' |
| 95 | 95 | org.valid? |
| 96 | - assert !org.errors[:contact_email.to_s].present? | |
| 96 | + refute org.errors[:contact_email.to_s].present? | |
| 97 | 97 | end |
| 98 | 98 | |
| 99 | 99 | should 'list contact_email plus admin emails as "notification emails"' do |
| ... | ... | @@ -191,7 +191,7 @@ class OrganizationTest < ActiveSupport::TestCase |
| 191 | 191 | |
| 192 | 192 | org.foundation_year = 2007 |
| 193 | 193 | org.valid? |
| 194 | - assert ! org.errors[:foundation_year.to_s].present? | |
| 194 | + refute org.errors[:foundation_year.to_s].present? | |
| 195 | 195 | end |
| 196 | 196 | |
| 197 | 197 | should 'has closed' do |
| ... | ... | @@ -245,7 +245,7 @@ class OrganizationTest < ActiveSupport::TestCase |
| 245 | 245 | |
| 246 | 246 | should 'be closed if organization is not public' do |
| 247 | 247 | organization = fast_create(Organization) |
| 248 | - assert !organization.closed | |
| 248 | + refute organization.closed | |
| 249 | 249 | |
| 250 | 250 | organization.public_profile = false |
| 251 | 251 | organization.save! |
| ... | ... | @@ -278,11 +278,11 @@ class OrganizationTest < ActiveSupport::TestCase |
| 278 | 278 | p2 = fast_create(Person) |
| 279 | 279 | p3 = fast_create(Person) |
| 280 | 280 | |
| 281 | - assert !p1.is_member_of?(o) | |
| 281 | + refute p1.is_member_of?(o) | |
| 282 | 282 | o.add_member(p1) |
| 283 | 283 | assert p1.is_member_of?(o) |
| 284 | 284 | |
| 285 | - assert !p3.is_member_of?(o) | |
| 285 | + refute p3.is_member_of?(o) | |
| 286 | 286 | o.add_member(p3) |
| 287 | 287 | assert p3.is_member_of?(o) |
| 288 | 288 | |
| ... | ... | @@ -380,7 +380,7 @@ class OrganizationTest < ActiveSupport::TestCase |
| 380 | 380 | |
| 381 | 381 | organization.cnpj = '94.132.024/0001-48' |
| 382 | 382 | organization.valid? |
| 383 | - assert !organization.errors[:cnpj.to_s].present? | |
| 383 | + refute organization.errors[:cnpj.to_s].present? | |
| 384 | 384 | end |
| 385 | 385 | |
| 386 | 386 | should 'get members by role' do |
| ... | ... | @@ -429,7 +429,7 @@ class OrganizationTest < ActiveSupport::TestCase |
| 429 | 429 | assert organization.visible |
| 430 | 430 | |
| 431 | 431 | organization.disable |
| 432 | - assert !organization.visible | |
| 432 | + refute organization.visible | |
| 433 | 433 | end |
| 434 | 434 | |
| 435 | 435 | should 'increase members_count on new membership' do |
| ... | ... | @@ -467,14 +467,14 @@ class OrganizationTest < ActiveSupport::TestCase |
| 467 | 467 | |
| 468 | 468 | member = create_user('memberuser').person |
| 469 | 469 | c.add_member(member) |
| 470 | - assert !c.is_admin?(member) | |
| 470 | + refute c.is_admin?(member) | |
| 471 | 471 | end |
| 472 | 472 | |
| 473 | 473 | should 'a moderator user not be a community admin' do |
| 474 | 474 | c = fast_create(Organization, :name => 'my test profile', :identifier => 'mytestprofile') |
| 475 | 475 | moderator = create_user('moderatoruser').person |
| 476 | 476 | c.add_moderator(moderator) |
| 477 | - assert !c.is_admin?(moderator) | |
| 477 | + refute c.is_admin?(moderator) | |
| 478 | 478 | end |
| 479 | 479 | |
| 480 | 480 | end | ... | ... |
test/unit/person_notifier_test.rb
| ... | ... | @@ -184,11 +184,11 @@ class PersonNotifierTest < ActiveSupport::TestCase |
| 184 | 184 | |
| 185 | 185 | should 'exists? method in NotifyAllJob return false if there is no instance of this class created' do |
| 186 | 186 | Delayed::Job.enqueue(PersonNotifier::NotifyJob.new) |
| 187 | - assert !PersonNotifier::NotifyAllJob.exists? | |
| 187 | + refute PersonNotifier::NotifyAllJob.exists? | |
| 188 | 188 | end |
| 189 | 189 | |
| 190 | 190 | should 'exists? method in NotifyAllJob return false if there is no jobs created' do |
| 191 | - assert !PersonNotifier::NotifyAllJob.exists? | |
| 191 | + refute PersonNotifier::NotifyAllJob.exists? | |
| 192 | 192 | end |
| 193 | 193 | |
| 194 | 194 | should 'exists? method in NotifyAllJob return true if there is at least one instance of this class' do |
| ... | ... | @@ -222,7 +222,7 @@ class PersonNotifierTest < ActiveSupport::TestCase |
| 222 | 222 | |
| 223 | 223 | process_delayed_job_queue |
| 224 | 224 | jobs = PersonNotifier::NotifyJob.find(@member.id) |
| 225 | - assert !jobs.select {|j| !j.failed? && j.last_error.nil? }.empty? | |
| 225 | + refute jobs.select {|j| !j.failed? && j.last_error.nil? }.empty? | |
| 226 | 226 | end |
| 227 | 227 | |
| 228 | 228 | should 'render image tags for both internal and external src' do | ... | ... |
test/unit/person_test.rb
| ... | ... | @@ -6,9 +6,9 @@ class PersonTest < ActiveSupport::TestCase |
| 6 | 6 | |
| 7 | 7 | def test_person_must_come_from_the_creation_of_an_user |
| 8 | 8 | p = build(Person, :environment => Environment.default, :name => 'John', :identifier => 'john') |
| 9 | - assert !p.valid? | |
| 9 | + refute p.valid? | |
| 10 | 10 | p.user = create_user('john', :email => 'john@doe.org', :password => 'dhoe', :password_confirmation => 'dhoe') |
| 11 | - assert !p.valid? | |
| 11 | + refute p.valid? | |
| 12 | 12 | p = create_user('johnz', :email => 'johnz@doe.org', :password => 'dhoe', :password_confirmation => 'dhoe').person |
| 13 | 13 | assert p.valid? |
| 14 | 14 | end |
| ... | ... | @@ -59,7 +59,7 @@ class PersonTest < ActiveSupport::TestCase |
| 59 | 59 | |
| 60 | 60 | p2 = build(Person, :environment => Environment.default) |
| 61 | 61 | p2.user = u |
| 62 | - assert !p2.valid? | |
| 62 | + refute p2.valid? | |
| 63 | 63 | assert p2.errors[:user_id.to_s].present? |
| 64 | 64 | end |
| 65 | 65 | |
| ... | ... | @@ -86,7 +86,7 @@ class PersonTest < ActiveSupport::TestCase |
| 86 | 86 | assert p.define_roles([r2], e) |
| 87 | 87 | p = Person.find(p.id) |
| 88 | 88 | assert p.role_assignments.any? {|ra| ra.role == r2} |
| 89 | - assert !p.role_assignments.any? {|ra| ra.role == r1} | |
| 89 | + refute p.role_assignments.any? {|ra| ra.role == r1} | |
| 90 | 90 | end |
| 91 | 91 | |
| 92 | 92 | should 'report that the user has the permission' do |
| ... | ... | @@ -97,7 +97,7 @@ class PersonTest < ActiveSupport::TestCase |
| 97 | 97 | p = Person.find(p.id) |
| 98 | 98 | assert e.reload |
| 99 | 99 | assert p.has_permission?('edit_profile', e) |
| 100 | - assert !p.has_permission?('destroy_profile', e) | |
| 100 | + refute p.has_permission?('destroy_profile', e) | |
| 101 | 101 | end |
| 102 | 102 | |
| 103 | 103 | should 'get an email address from the associated user instance' do |
| ... | ... | @@ -144,7 +144,7 @@ class PersonTest < ActiveSupport::TestCase |
| 144 | 144 | other = create_user('user', :email => 'other@example.com', :environment => other_env).person |
| 145 | 145 | other.email = 'user@example.com' |
| 146 | 146 | other.valid? |
| 147 | - assert !other.errors[:email.to_s].present? | |
| 147 | + refute other.errors[:email.to_s].present? | |
| 148 | 148 | end |
| 149 | 149 | |
| 150 | 150 | should 'be an admin if have permission of environment administration' do |
| ... | ... | @@ -152,7 +152,7 @@ class PersonTest < ActiveSupport::TestCase |
| 152 | 152 | env = fast_create(Environment) |
| 153 | 153 | person = create_user('just_another_person').person |
| 154 | 154 | env.affiliate(person, role) |
| 155 | - assert ! person.is_admin?(env) | |
| 155 | + refute person.is_admin?(env) | |
| 156 | 156 | role.update_attributes(:permissions => ['view_environment_admin_panel']) |
| 157 | 157 | person = Person.find(person.id) |
| 158 | 158 | assert person.is_admin?(env) |
| ... | ... | @@ -172,7 +172,7 @@ class PersonTest < ActiveSupport::TestCase |
| 172 | 172 | |
| 173 | 173 | person = Person.find(person.id) |
| 174 | 174 | assert person.is_admin?(env1) |
| 175 | - assert !person.is_admin?(env2) | |
| 175 | + refute person.is_admin?(env2) | |
| 176 | 176 | end |
| 177 | 177 | |
| 178 | 178 | should 'create a default set of articles' do |
| ... | ... | @@ -187,9 +187,9 @@ class PersonTest < ActiveSupport::TestCase |
| 187 | 187 | should 'create a default set of blocks' do |
| 188 | 188 | p = create(User).person |
| 189 | 189 | |
| 190 | - assert !p.boxes[0].blocks.empty?, 'person must have blocks in area 1' | |
| 191 | - assert !p.boxes[1].blocks.empty?, 'person must have blocks in area 2' | |
| 192 | - assert !p.boxes[2].blocks.empty?, 'person must have blocks in area 3' | |
| 190 | + refute p.boxes[0].blocks.empty?, 'person must have blocks in area 1' | |
| 191 | + refute p.boxes[1].blocks.empty?, 'person must have blocks in area 2' | |
| 192 | + refute p.boxes[2].blocks.empty?, 'person must have blocks in area 3' | |
| 193 | 193 | end |
| 194 | 194 | |
| 195 | 195 | should 'link to all articles created by default' do |
| ... | ... | @@ -317,7 +317,7 @@ class PersonTest < ActiveSupport::TestCase |
| 317 | 317 | |
| 318 | 318 | should 'required name' do |
| 319 | 319 | person = Person.new |
| 320 | - assert !person.valid? | |
| 320 | + refute person.valid? | |
| 321 | 321 | assert person.errors[:name].present? |
| 322 | 322 | end |
| 323 | 323 | |
| ... | ... | @@ -325,7 +325,7 @@ class PersonTest < ActiveSupport::TestCase |
| 325 | 325 | p1 = create_user('testuser1').person |
| 326 | 326 | p2 = create_user('testuser2').person |
| 327 | 327 | create(AddFriend, person: p1, friend: p2).finish |
| 328 | - assert !p1.already_request_friendship?(p2) | |
| 328 | + refute p1.already_request_friendship?(p2) | |
| 329 | 329 | create(AddFriend, person: p1, friend: p2) |
| 330 | 330 | assert p1.already_request_friendship?(p2) |
| 331 | 331 | end |
| ... | ... | @@ -394,7 +394,7 @@ class PersonTest < ActiveSupport::TestCase |
| 394 | 394 | p1 = create_user('user_with_tasks').person |
| 395 | 395 | c1 = fast_create(Community) |
| 396 | 396 | c1.tasks << Task.new |
| 397 | - assert !c1.tasks.pending.empty? | |
| 397 | + refute c1.tasks.pending.empty? | |
| 398 | 398 | c1.add_admin(p1) |
| 399 | 399 | |
| 400 | 400 | c2 = fast_create(Community) |
| ... | ... | @@ -463,12 +463,12 @@ class PersonTest < ActiveSupport::TestCase |
| 463 | 463 | e = Environment.default |
| 464 | 464 | e.expects(:required_person_fields).returns(['cell_phone']).at_least_once |
| 465 | 465 | person = build(Person, :environment => e) |
| 466 | - assert ! person.valid? | |
| 466 | + refute person.valid? | |
| 467 | 467 | assert person.errors[:cell_phone.to_s].present? |
| 468 | 468 | |
| 469 | 469 | person.cell_phone = '99999' |
| 470 | 470 | person.valid? |
| 471 | - assert ! person.errors[:cell_phone.to_s].present? | |
| 471 | + refute person.errors[:cell_phone.to_s].present? | |
| 472 | 472 | end |
| 473 | 473 | |
| 474 | 474 | should 'require custom_area_of_study if area_of_study is others' do |
| ... | ... | @@ -476,12 +476,12 @@ class PersonTest < ActiveSupport::TestCase |
| 476 | 476 | e.expects(:required_person_fields).returns(['area_of_study', 'custom_area_of_study']).at_least_once |
| 477 | 477 | |
| 478 | 478 | person = build(Person, :environment => e, :area_of_study => 'Others') |
| 479 | - assert !person.valid? | |
| 479 | + refute person.valid? | |
| 480 | 480 | assert person.errors[:custom_area_of_study.to_s].present? |
| 481 | 481 | |
| 482 | 482 | person.custom_area_of_study = 'Customized area of study' |
| 483 | 483 | person.valid? |
| 484 | - assert ! person.errors[:custom_area_of_study.to_s].present? | |
| 484 | + refute person.errors[:custom_area_of_study.to_s].present? | |
| 485 | 485 | end |
| 486 | 486 | |
| 487 | 487 | should 'not require custom_area_of_study if area_of_study is not others' do |
| ... | ... | @@ -490,7 +490,7 @@ class PersonTest < ActiveSupport::TestCase |
| 490 | 490 | |
| 491 | 491 | person = build(Person, :environment => e, :area_of_study => 'Agrometeorology') |
| 492 | 492 | person.valid? |
| 493 | - assert ! person.errors[:custom_area_of_study.to_s].present? | |
| 493 | + refute person.errors[:custom_area_of_study.to_s].present? | |
| 494 | 494 | end |
| 495 | 495 | |
| 496 | 496 | should 'require custom_formation if formation is others' do |
| ... | ... | @@ -498,12 +498,12 @@ class PersonTest < ActiveSupport::TestCase |
| 498 | 498 | e.expects(:required_person_fields).returns(['formation', 'custom_formation']).at_least_once |
| 499 | 499 | |
| 500 | 500 | person = build(Person, :environment => e, :formation => 'Others') |
| 501 | - assert !person.valid? | |
| 501 | + refute person.valid? | |
| 502 | 502 | assert person.errors[:custom_formation.to_s].present? |
| 503 | 503 | |
| 504 | 504 | person.custom_formation = 'Customized formation' |
| 505 | 505 | person.valid? |
| 506 | - assert ! person.errors[:custom_formation.to_s].present? | |
| 506 | + refute person.errors[:custom_formation.to_s].present? | |
| 507 | 507 | end |
| 508 | 508 | |
| 509 | 509 | should 'not require custom_formation if formation is not others' do |
| ... | ... | @@ -511,20 +511,20 @@ class PersonTest < ActiveSupport::TestCase |
| 511 | 511 | e.expects(:required_person_fields).returns(['formation']).at_least_once |
| 512 | 512 | |
| 513 | 513 | person = build(Person, :environment => e, :formation => 'Agrometeorology') |
| 514 | - assert !person.valid? | |
| 515 | - assert ! person.errors[:custom_formation.to_s].present? | |
| 514 | + refute person.valid? | |
| 515 | + refute person.errors[:custom_formation.to_s].present? | |
| 516 | 516 | end |
| 517 | 517 | |
| 518 | 518 | should 'not require fields if person is a template' do |
| 519 | 519 | e = Environment.default |
| 520 | 520 | e.expects(:required_person_fields).returns(['cell_phone']).at_least_once |
| 521 | 521 | person = build(Person, :environment => e) |
| 522 | - assert ! person.valid? | |
| 522 | + refute person.valid? | |
| 523 | 523 | assert person.errors[:cell_phone.to_s].present? |
| 524 | 524 | |
| 525 | 525 | person.is_template = true |
| 526 | 526 | person.valid? |
| 527 | - assert ! person.errors[:cell_phone.to_s].present? | |
| 527 | + refute person.errors[:cell_phone.to_s].present? | |
| 528 | 528 | end |
| 529 | 529 | |
| 530 | 530 | should 'identify when person is a friend' do |
| ... | ... | @@ -538,7 +538,7 @@ class PersonTest < ActiveSupport::TestCase |
| 538 | 538 | should 'identify when person isnt a friend' do |
| 539 | 539 | p1 = create_user('testuser1').person |
| 540 | 540 | p2 = create_user('testuser2').person |
| 541 | - assert !p1.is_a_friend?(p2) | |
| 541 | + refute p1.is_a_friend?(p2) | |
| 542 | 542 | end |
| 543 | 543 | |
| 544 | 544 | should 'refuse join community' do |
| ... | ... | @@ -547,7 +547,7 @@ class PersonTest < ActiveSupport::TestCase |
| 547 | 547 | |
| 548 | 548 | assert p.ask_to_join?(c) |
| 549 | 549 | p.refuse_join(c) |
| 550 | - assert !p.ask_to_join?(c) | |
| 550 | + refute p.ask_to_join?(c) | |
| 551 | 551 | end |
| 552 | 552 | |
| 553 | 553 | should 'not ask to join for a member' do |
| ... | ... | @@ -555,7 +555,7 @@ class PersonTest < ActiveSupport::TestCase |
| 555 | 555 | c = fast_create(Community) |
| 556 | 556 | c.add_member(p) |
| 557 | 557 | |
| 558 | - assert !p.ask_to_join?(c) | |
| 558 | + refute p.ask_to_join?(c) | |
| 559 | 559 | end |
| 560 | 560 | |
| 561 | 561 | should 'not ask to join if already asked' do |
| ... | ... | @@ -563,7 +563,7 @@ class PersonTest < ActiveSupport::TestCase |
| 563 | 563 | c = fast_create(Community) |
| 564 | 564 | create(AddMember, :person => p, :organization => c) |
| 565 | 565 | |
| 566 | - assert !p.ask_to_join?(c) | |
| 566 | + refute p.ask_to_join?(c) | |
| 567 | 567 | end |
| 568 | 568 | |
| 569 | 569 | should 'ask to join if community is not public' do |
| ... | ... | @@ -577,7 +577,7 @@ class PersonTest < ActiveSupport::TestCase |
| 577 | 577 | person = fast_create(Person) |
| 578 | 578 | community = fast_create(Community, :visible => false) |
| 579 | 579 | |
| 580 | - assert !person.ask_to_join?(community) | |
| 580 | + refute person.ask_to_join?(community) | |
| 581 | 581 | end |
| 582 | 582 | |
| 583 | 583 | should 'save organization_website with http' do |
| ... | ... | @@ -606,7 +606,7 @@ class PersonTest < ActiveSupport::TestCase |
| 606 | 606 | p2 = create_user('testuser2').person |
| 607 | 607 | assert p1.add_friend(p2) |
| 608 | 608 | assert Profile['testuser1'].is_a_friend?(p2) |
| 609 | - assert !Profile['testuser1'].add_friend(p2) | |
| 609 | + refute Profile['testuser1'].add_friend(p2) | |
| 610 | 610 | end |
| 611 | 611 | |
| 612 | 612 | should 'not raise exception when validates person without e-mail' do |
| ... | ... | @@ -614,7 +614,7 @@ class PersonTest < ActiveSupport::TestCase |
| 614 | 614 | person.user.email = nil |
| 615 | 615 | |
| 616 | 616 | assert_nothing_raised ActiveRecord::RecordInvalid do |
| 617 | - assert !person.save | |
| 617 | + refute person.save | |
| 618 | 618 | end |
| 619 | 619 | end |
| 620 | 620 | |
| ... | ... | @@ -766,11 +766,11 @@ class PersonTest < ActiveSupport::TestCase |
| 766 | 766 | p2 = fast_create(Person) |
| 767 | 767 | p3 = fast_create(Person) |
| 768 | 768 | |
| 769 | - assert !p1.is_member_of?(c) | |
| 769 | + refute p1.is_member_of?(c) | |
| 770 | 770 | c.add_member(p1) |
| 771 | 771 | assert p1.is_member_of?(c) |
| 772 | 772 | |
| 773 | - assert !p3.is_member_of?(c) | |
| 773 | + refute p3.is_member_of?(c) | |
| 774 | 774 | c.add_member(p3) |
| 775 | 775 | assert p3.is_member_of?(c) |
| 776 | 776 | |
| ... | ... | @@ -786,11 +786,11 @@ class PersonTest < ActiveSupport::TestCase |
| 786 | 786 | p2 = fast_create(Person) |
| 787 | 787 | p3 = fast_create(Person) |
| 788 | 788 | |
| 789 | - assert !p1.is_member_of?(e) | |
| 789 | + refute p1.is_member_of?(e) | |
| 790 | 790 | e.add_member(p1) |
| 791 | 791 | assert p1.is_member_of?(e) |
| 792 | 792 | |
| 793 | - assert !p3.is_member_of?(e) | |
| 793 | + refute p3.is_member_of?(e) | |
| 794 | 794 | e.add_member(p3) |
| 795 | 795 | assert p3.is_member_of?(e) |
| 796 | 796 | |
| ... | ... | @@ -843,7 +843,7 @@ class PersonTest < ActiveSupport::TestCase |
| 843 | 843 | |
| 844 | 844 | p1.add_friend(p2) |
| 845 | 845 | assert p1.is_a_friend?(p2) |
| 846 | - assert !p1.is_a_friend?(p3) | |
| 846 | + refute p1.is_a_friend?(p3) | |
| 847 | 847 | p1.add_friend(p4) |
| 848 | 848 | assert p1.is_a_friend?(p4) |
| 849 | 849 | |
| ... | ... | @@ -867,7 +867,7 @@ class PersonTest < ActiveSupport::TestCase |
| 867 | 867 | |
| 868 | 868 | p1.add_friend(p2) |
| 869 | 869 | assert p1.is_a_friend?(p2) |
| 870 | - assert !p1.is_a_friend?(p3) | |
| 870 | + refute p1.is_a_friend?(p3) | |
| 871 | 871 | p1.add_friend(p4) |
| 872 | 872 | assert p1.is_a_friend?(p4) |
| 873 | 873 | |
| ... | ... | @@ -886,7 +886,7 @@ class PersonTest < ActiveSupport::TestCase |
| 886 | 886 | |
| 887 | 887 | p1.add_friend(p2) |
| 888 | 888 | assert p1.is_a_friend?(p2) |
| 889 | - assert !p1.is_a_friend?(p3) | |
| 889 | + refute p1.is_a_friend?(p3) | |
| 890 | 890 | p1.add_friend(p4) |
| 891 | 891 | assert p1.is_a_friend?(p4) |
| 892 | 892 | |
| ... | ... | @@ -913,7 +913,7 @@ class PersonTest < ActiveSupport::TestCase |
| 913 | 913 | assert p1.is_member_of?(community) |
| 914 | 914 | community.add_member(p3) |
| 915 | 915 | assert p3.is_member_of?(community) |
| 916 | - assert !p2.is_member_of?(community) | |
| 916 | + refute p2.is_member_of?(community) | |
| 917 | 917 | process_delayed_job_queue |
| 918 | 918 | |
| 919 | 919 | action_tracker = fast_create(ActionTracker::Record, :verb => 'create_article') |
| ... | ... | @@ -943,7 +943,7 @@ class PersonTest < ActiveSupport::TestCase |
| 943 | 943 | assert p3.is_member_of?(community) |
| 944 | 944 | community.add_member(p4) |
| 945 | 945 | assert p4.is_member_of?(community) |
| 946 | - assert !p2.is_member_of?(community) | |
| 946 | + refute p2.is_member_of?(community) | |
| 947 | 947 | |
| 948 | 948 | action_tracker = fast_create(ActionTracker::Record) |
| 949 | 949 | article = mock() |
| ... | ... | @@ -990,14 +990,14 @@ class PersonTest < ActiveSupport::TestCase |
| 990 | 990 | p1, p2 = fast_create(Person), fast_create(Person) |
| 991 | 991 | s = fast_create(Scrap, :sender_id => p1.id, :receiver_id => p1.id) |
| 992 | 992 | assert p1.can_control_scrap?(s) |
| 993 | - assert !p2.can_control_scrap?(s) | |
| 993 | + refute p2.can_control_scrap?(s) | |
| 994 | 994 | end |
| 995 | 995 | |
| 996 | 996 | should "control activity or not" do |
| 997 | 997 | p1, p2 = fast_create(Person), fast_create(Person) |
| 998 | 998 | a = fast_create(ActionTracker::Record, :user_id => p2.id) |
| 999 | 999 | n = fast_create(ActionTrackerNotification, :profile_id => p2.id, :action_tracker_id => a.id) |
| 1000 | - assert !p1.reload.can_control_activity?(a) | |
| 1000 | + refute p1.reload.can_control_activity?(a) | |
| 1001 | 1001 | assert p2.reload.can_control_activity?(a) |
| 1002 | 1002 | end |
| 1003 | 1003 | |
| ... | ... | @@ -1121,7 +1121,7 @@ class PersonTest < ActiveSupport::TestCase |
| 1121 | 1121 | organization.add_admin(person) |
| 1122 | 1122 | |
| 1123 | 1123 | assert person.is_last_admin_leaving?(organization, []) |
| 1124 | - assert !person.is_last_admin_leaving?(organization, [Role.find_by_key('profile_admin')]) | |
| 1124 | + refute person.is_last_admin_leaving?(organization, [Role.find_by_key('profile_admin')]) | |
| 1125 | 1125 | end |
| 1126 | 1126 | |
| 1127 | 1127 | should 'return unique members of a community' do |
| ... | ... | @@ -1226,7 +1226,7 @@ class PersonTest < ActiveSupport::TestCase |
| 1226 | 1226 | should 'check if person already reported profile' do |
| 1227 | 1227 | person = create_user('some-user').person |
| 1228 | 1228 | profile = fast_create(Profile) |
| 1229 | - assert !person.already_reported?(profile) | |
| 1229 | + refute person.already_reported?(profile) | |
| 1230 | 1230 | |
| 1231 | 1231 | person.register_report(build(AbuseReport, :reason => 'some reason'), profile) |
| 1232 | 1232 | person.reload |
| ... | ... | @@ -1240,7 +1240,7 @@ class PersonTest < ActiveSupport::TestCase |
| 1240 | 1240 | |
| 1241 | 1241 | person.disable |
| 1242 | 1242 | |
| 1243 | - assert !person.visible | |
| 1243 | + refute person.visible | |
| 1244 | 1244 | assert_not_equal password, person.user.password |
| 1245 | 1245 | end |
| 1246 | 1246 | |
| ... | ... | @@ -1334,7 +1334,7 @@ class PersonTest < ActiveSupport::TestCase |
| 1334 | 1334 | person = create_user('person').person |
| 1335 | 1335 | |
| 1336 | 1336 | assert abuser.abuser? |
| 1337 | - assert !person.abuser? | |
| 1337 | + refute person.abuser? | |
| 1338 | 1338 | end |
| 1339 | 1339 | |
| 1340 | 1340 | should 'be able to retrieve abusers and non abusers' do |
| ... | ... | @@ -1661,19 +1661,19 @@ class PersonTest < ActiveSupport::TestCase |
| 1661 | 1661 | comment = fast_create(Comment) |
| 1662 | 1662 | person = fast_create(Person) |
| 1663 | 1663 | |
| 1664 | - assert !person.voted_for?(comment) | |
| 1664 | + refute person.voted_for?(comment) | |
| 1665 | 1665 | person.vote_for(comment) |
| 1666 | 1666 | assert person.voted_for?(comment) |
| 1667 | - assert !person.voted_against?(comment) | |
| 1667 | + refute person.voted_against?(comment) | |
| 1668 | 1668 | end |
| 1669 | 1669 | |
| 1670 | 1670 | should 'vote against a comment' do |
| 1671 | 1671 | comment = fast_create(Comment) |
| 1672 | 1672 | person = fast_create(Person) |
| 1673 | 1673 | |
| 1674 | - assert !person.voted_against?(comment) | |
| 1674 | + refute person.voted_against?(comment) | |
| 1675 | 1675 | person.vote_against(comment) |
| 1676 | - assert !person.voted_for?(comment) | |
| 1676 | + refute person.voted_for?(comment) | |
| 1677 | 1677 | assert person.voted_against?(comment) |
| 1678 | 1678 | end |
| 1679 | 1679 | |
| ... | ... | @@ -1682,7 +1682,7 @@ class PersonTest < ActiveSupport::TestCase |
| 1682 | 1682 | person = fast_create(Person) |
| 1683 | 1683 | |
| 1684 | 1684 | assert person.vote_against(comment) |
| 1685 | - assert !person.vote_against(comment) | |
| 1685 | + refute person.vote_against(comment) | |
| 1686 | 1686 | end |
| 1687 | 1687 | |
| 1688 | 1688 | should 'do not vote for a comment twice' do |
| ... | ... | @@ -1690,7 +1690,7 @@ class PersonTest < ActiveSupport::TestCase |
| 1690 | 1690 | person = fast_create(Person) |
| 1691 | 1691 | |
| 1692 | 1692 | assert person.vote_for(comment) |
| 1693 | - assert !person.vote_for(comment) | |
| 1693 | + refute person.vote_for(comment) | |
| 1694 | 1694 | end |
| 1695 | 1695 | |
| 1696 | 1696 | should 'not vote against a voted for comment' do |
| ... | ... | @@ -1700,7 +1700,7 @@ class PersonTest < ActiveSupport::TestCase |
| 1700 | 1700 | person.vote_for(comment) |
| 1701 | 1701 | person.vote_against(comment) |
| 1702 | 1702 | assert person.voted_for?(comment) |
| 1703 | - assert !person.voted_against?(comment) | |
| 1703 | + refute person.voted_against?(comment) | |
| 1704 | 1704 | end |
| 1705 | 1705 | |
| 1706 | 1706 | should 'not vote for a voted against comment' do |
| ... | ... | @@ -1709,7 +1709,7 @@ class PersonTest < ActiveSupport::TestCase |
| 1709 | 1709 | |
| 1710 | 1710 | person.vote_against(comment) |
| 1711 | 1711 | person.vote_for(comment) |
| 1712 | - assert !person.voted_for?(comment) | |
| 1712 | + refute person.voted_for?(comment) | |
| 1713 | 1713 | assert person.voted_against?(comment) |
| 1714 | 1714 | end |
| 1715 | 1715 | |
| ... | ... | @@ -1720,7 +1720,7 @@ class PersonTest < ActiveSupport::TestCase |
| 1720 | 1720 | person.vote_for(comment) |
| 1721 | 1721 | assert person.voted_for?(comment) |
| 1722 | 1722 | person.votes.for_voteable(comment).destroy_all |
| 1723 | - assert !person.voted_for?(comment) | |
| 1723 | + refute person.voted_for?(comment) | |
| 1724 | 1724 | end |
| 1725 | 1725 | |
| 1726 | 1726 | should 'count comments voted' do |
| ... | ... | @@ -1751,19 +1751,19 @@ class PersonTest < ActiveSupport::TestCase |
| 1751 | 1751 | article = fast_create(Article) |
| 1752 | 1752 | person = fast_create(Person) |
| 1753 | 1753 | |
| 1754 | - assert !person.voted_for?(article) | |
| 1754 | + refute person.voted_for?(article) | |
| 1755 | 1755 | person.vote_for(article) |
| 1756 | 1756 | assert person.voted_for?(article) |
| 1757 | - assert !person.voted_against?(article) | |
| 1757 | + refute person.voted_against?(article) | |
| 1758 | 1758 | end |
| 1759 | 1759 | |
| 1760 | 1760 | should 'vote against a article' do |
| 1761 | 1761 | article = fast_create(Article) |
| 1762 | 1762 | person = fast_create(Person) |
| 1763 | 1763 | |
| 1764 | - assert !person.voted_against?(article) | |
| 1764 | + refute person.voted_against?(article) | |
| 1765 | 1765 | person.vote_against(article) |
| 1766 | - assert !person.voted_for?(article) | |
| 1766 | + refute person.voted_for?(article) | |
| 1767 | 1767 | assert person.voted_against?(article) |
| 1768 | 1768 | end |
| 1769 | 1769 | ... | ... |
test/unit/product_categories_block_test.rb
| ... | ... | @@ -11,7 +11,7 @@ class ProductCategoriesBlockTest < ActiveSupport::TestCase |
| 11 | 11 | assert block.visible? |
| 12 | 12 | |
| 13 | 13 | block.box.environment.disable('products_for_enterprises') |
| 14 | - assert !block.visible? | |
| 14 | + refute block.visible? | |
| 15 | 15 | end |
| 16 | 16 | |
| 17 | 17 | should 'have display option to show only on catalog' do |
| ... | ... | @@ -29,7 +29,7 @@ class ProductCategoriesBlockTest < ActiveSupport::TestCase |
| 29 | 29 | block.box = box |
| 30 | 30 | block.box.environment.enable('products_for_enterprises') |
| 31 | 31 | |
| 32 | - assert !block.visible?(:params => {:controller => 'any_other'}) | |
| 32 | + refute block.visible?(:params => {:controller => 'any_other'}) | |
| 33 | 33 | assert block.visible?(:params => {:controller => 'catalog'}) |
| 34 | 34 | end |
| 35 | 35 | end | ... | ... |
test/unit/product_test.rb
| ... | ... | @@ -130,7 +130,7 @@ class ProductTest < ActiveSupport::TestCase |
| 130 | 130 | e1.public_profile = false |
| 131 | 131 | e1.save!; p1.reload; |
| 132 | 132 | |
| 133 | - assert !p1.public? | |
| 133 | + refute p1.public? | |
| 134 | 134 | end |
| 135 | 135 | |
| 136 | 136 | should 'accept prices in american\'s or brazilian\'s currency format' do |
| ... | ... | @@ -267,7 +267,7 @@ class ProductTest < ActiveSupport::TestCase |
| 267 | 267 | |
| 268 | 268 | should 'has basic info if filled unit, price or discount' do |
| 269 | 269 | product = Product.new |
| 270 | - assert !product.has_basic_info? | |
| 270 | + refute product.has_basic_info? | |
| 271 | 271 | |
| 272 | 272 | product = build(Product, :unit => Unit.new) |
| 273 | 273 | assert product.has_basic_info? |
| ... | ... | @@ -349,7 +349,7 @@ class ProductTest < ActiveSupport::TestCase |
| 349 | 349 | product = fast_create(Product, :price => 30.0) |
| 350 | 350 | |
| 351 | 351 | first = fast_create(Input, :product_id => product.id, :product_category_id => fast_create(ProductCategory).id, :price_per_unit => 20.0, :amount_used => 1) |
| 352 | - assert !Product.find(product.id).price_described? | |
| 352 | + refute Product.find(product.id).price_described? | |
| 353 | 353 | |
| 354 | 354 | second = fast_create(Input, :product_id => product.id, :product_category_id => fast_create(ProductCategory).id, :price_per_unit => 10.0, :amount_used => 1) |
| 355 | 355 | assert Product.find(product.id).price_described? |
| ... | ... | @@ -375,7 +375,7 @@ class ProductTest < ActiveSupport::TestCase |
| 375 | 375 | cost = fast_create(ProductionCost, :owner_id => Environment.default.id, :owner_type => 'Environment') |
| 376 | 376 | cost2 = fast_create(ProductionCost, :owner_id => Environment.default.id, :owner_type => 'Environment') |
| 377 | 377 | price_detail = product.price_details.create(:production_cost_id => cost.id, :price => 10) |
| 378 | - assert !product.price_details.empty? | |
| 378 | + refute product.price_details.empty? | |
| 379 | 379 | |
| 380 | 380 | product.update_price_details([{:production_cost_id => cost.id, :price => 20}, {:production_cost_id => cost2.id, :price => 30}]) |
| 381 | 381 | assert_equal 20, product.price_details.find_by_production_cost_id(cost.id).price | ... | ... |
test/unit/production_cost_test.rb
| ... | ... | @@ -9,7 +9,7 @@ class ProductionCostTest < ActiveSupport::TestCase |
| 9 | 9 | |
| 10 | 10 | p.name = 'Taxes' |
| 11 | 11 | p.valid? |
| 12 | - assert !p.errors[:name.to_s].present? | |
| 12 | + refute p.errors[:name.to_s].present? | |
| 13 | 13 | end |
| 14 | 14 | |
| 15 | 15 | should 'not validates name if it is blank' do |
| ... | ... | @@ -28,7 +28,7 @@ class ProductionCostTest < ActiveSupport::TestCase |
| 28 | 28 | |
| 29 | 29 | p.name = 'a'*30 |
| 30 | 30 | p.valid? |
| 31 | - assert !p.errors[:name.to_s].present? | |
| 31 | + refute p.errors[:name.to_s].present? | |
| 32 | 32 | end |
| 33 | 33 | |
| 34 | 34 | should 'not have duplicated name on same environment' do |
| ... | ... | @@ -58,7 +58,7 @@ class ProductionCostTest < ActiveSupport::TestCase |
| 58 | 58 | |
| 59 | 59 | cost2.valid? |
| 60 | 60 | |
| 61 | - assert !cost2.errors[:name.to_s].present? | |
| 61 | + refute cost2.errors[:name.to_s].present? | |
| 62 | 62 | end |
| 63 | 63 | |
| 64 | 64 | should 'allow duplicated name on different enterprises' do |
| ... | ... | @@ -70,7 +70,7 @@ class ProductionCostTest < ActiveSupport::TestCase |
| 70 | 70 | |
| 71 | 71 | cost2.valid? |
| 72 | 72 | |
| 73 | - assert !cost2.errors[:name.to_s].present? | |
| 73 | + refute cost2.errors[:name.to_s].present? | |
| 74 | 74 | end |
| 75 | 75 | |
| 76 | 76 | should 'be associated to an environment as owner' do |
| ... | ... | @@ -80,7 +80,7 @@ class ProductionCostTest < ActiveSupport::TestCase |
| 80 | 80 | |
| 81 | 81 | p.owner = Environment.default |
| 82 | 82 | p.valid? |
| 83 | - assert !p.errors[:owner.to_s].present? | |
| 83 | + refute p.errors[:owner.to_s].present? | |
| 84 | 84 | end |
| 85 | 85 | |
| 86 | 86 | should 'be associated to an enterprise as owner' do |
| ... | ... | @@ -91,7 +91,7 @@ class ProductionCostTest < ActiveSupport::TestCase |
| 91 | 91 | |
| 92 | 92 | p.owner = enterprise |
| 93 | 93 | p.valid? |
| 94 | - assert !p.errors[:owner.to_s].present? | |
| 94 | + refute p.errors[:owner.to_s].present? | |
| 95 | 95 | end |
| 96 | 96 | |
| 97 | 97 | should 'create a production cost on an enterprise' do | ... | ... |
test/unit/profile_test.rb
| ... | ... | @@ -19,19 +19,19 @@ class ProfileTest < ActiveSupport::TestCase |
| 19 | 19 | |
| 20 | 20 | p.identifier = 'rightformat2007' |
| 21 | 21 | p.valid? |
| 22 | - assert ! p.errors[:identifier.to_s].present? | |
| 22 | + refute p.errors[:identifier.to_s].present? | |
| 23 | 23 | |
| 24 | 24 | p.identifier = 'rightformat' |
| 25 | 25 | p.valid? |
| 26 | - assert ! p.errors[:identifier.to_s].present? | |
| 26 | + refute p.errors[:identifier.to_s].present? | |
| 27 | 27 | |
| 28 | 28 | p.identifier = 'right_format' |
| 29 | 29 | p.valid? |
| 30 | - assert ! p.errors[:identifier.to_s].present? | |
| 30 | + refute p.errors[:identifier.to_s].present? | |
| 31 | 31 | |
| 32 | 32 | p.identifier = 'identifier-with-dashes' |
| 33 | 33 | p.valid? |
| 34 | - assert ! p.errors[:identifier.to_s].present?, 'Profile should accept identifier with dashes' | |
| 34 | + refute p.errors[:identifier.to_s].present?, 'Profile should accept identifier with dashes' | |
| 35 | 35 | end |
| 36 | 36 | |
| 37 | 37 | def test_has_domains |
| ... | ... | @@ -63,11 +63,11 @@ class ProfileTest < ActiveSupport::TestCase |
| 63 | 63 | should 'set default environment for users created' do |
| 64 | 64 | user = create_user 'mytestuser' |
| 65 | 65 | assert_equal 'mytestuser', user.login |
| 66 | - assert !user.new_record? | |
| 66 | + refute user.new_record? | |
| 67 | 67 | |
| 68 | 68 | p = user.person |
| 69 | 69 | |
| 70 | - assert !p.new_record? | |
| 70 | + refute p.new_record? | |
| 71 | 71 | assert_equal 'mytestuser', p.identifier |
| 72 | 72 | e = p.environment |
| 73 | 73 | assert_equal Environment.default, e |
| ... | ... | @@ -84,7 +84,7 @@ class ProfileTest < ActiveSupport::TestCase |
| 84 | 84 | assert p.errors[:name.to_s].present? |
| 85 | 85 | p.name = 'a very unprobable name' |
| 86 | 86 | p.valid? |
| 87 | - assert !p.errors[:name.to_s].present? | |
| 87 | + refute p.errors[:name.to_s].present? | |
| 88 | 88 | end |
| 89 | 89 | |
| 90 | 90 | def test_can_have_affiliated_people |
| ... | ... | @@ -178,7 +178,7 @@ class ProfileTest < ActiveSupport::TestCase |
| 178 | 178 | top = profile.top_level_articles |
| 179 | 179 | assert top.include?(p1) |
| 180 | 180 | assert top.include?(p2) |
| 181 | - assert !top.include?(child) | |
| 181 | + refute top.include?(child) | |
| 182 | 182 | end |
| 183 | 183 | |
| 184 | 184 | should 'be able to optionally reload the list of top level articles' do |
| ... | ... | @@ -420,15 +420,15 @@ class ProfileTest < ActiveSupport::TestCase |
| 420 | 420 | should 'not advertise articles created together with the profile' do |
| 421 | 421 | Profile.any_instance.stubs(:default_set_of_articles).returns([Article.new(:name => 'home'), RssFeed.new(:name => 'feed')]) |
| 422 | 422 | profile = create(Profile) |
| 423 | - assert !profile.articles.find_by_path('home').advertise? | |
| 424 | - assert !profile.articles.find_by_path('feed').advertise? | |
| 423 | + refute profile.articles.find_by_path('home').advertise? | |
| 424 | + refute profile.articles.find_by_path('feed').advertise? | |
| 425 | 425 | end |
| 426 | 426 | |
| 427 | 427 | should 'advertise article after update' do |
| 428 | 428 | Profile.any_instance.stubs(:default_set_of_articles).returns([Article.new(:name => 'home')]) |
| 429 | 429 | profile = create(Profile) |
| 430 | 430 | article = profile.articles.find_by_path('home') |
| 431 | - assert !article.advertise? | |
| 431 | + refute article.advertise? | |
| 432 | 432 | article.name = 'Changed name' |
| 433 | 433 | article.save! |
| 434 | 434 | assert article.advertise? |
| ... | ... | @@ -482,7 +482,7 @@ class ProfileTest < ActiveSupport::TestCase |
| 482 | 482 | end |
| 483 | 483 | |
| 484 | 484 | should 'not display private profile to unauthenticated user' do |
| 485 | - assert !Profile.new(:public_profile => false).display_info_to?(nil) | |
| 485 | + refute Profile.new(:public_profile => false).display_info_to?(nil) | |
| 486 | 486 | end |
| 487 | 487 | |
| 488 | 488 | should 'display private profile for its owner' do |
| ... | ... | @@ -640,11 +640,11 @@ class ProfileTest < ActiveSupport::TestCase |
| 640 | 640 | end |
| 641 | 641 | |
| 642 | 642 | should 'not accept product category as category' do |
| 643 | - assert !Profile.new.accept_category?(ProductCategory.new) | |
| 643 | + refute Profile.new.accept_category?(ProductCategory.new) | |
| 644 | 644 | end |
| 645 | 645 | |
| 646 | 646 | should 'not accept region as a category' do |
| 647 | - assert !Profile.new.accept_category?(Region.new) | |
| 647 | + refute Profile.new.accept_category?(Region.new) | |
| 648 | 648 | end |
| 649 | 649 | |
| 650 | 650 | should 'query region for location' do |
| ... | ... | @@ -886,7 +886,7 @@ class ProfileTest < ActiveSupport::TestCase |
| 886 | 886 | p2 = fast_create(Profile, :public_profile => false) |
| 887 | 887 | |
| 888 | 888 | assert p1.public? |
| 889 | - assert !p2.public? | |
| 889 | + refute p2.public? | |
| 890 | 890 | end |
| 891 | 891 | |
| 892 | 892 | should 'remove member with many roles' do |
| ... | ... | @@ -964,7 +964,7 @@ class ProfileTest < ActiveSupport::TestCase |
| 964 | 964 | |
| 965 | 965 | a_copy = p.articles[0] |
| 966 | 966 | |
| 967 | - assert !a_copy.advertise | |
| 967 | + refute a_copy.advertise | |
| 968 | 968 | end |
| 969 | 969 | |
| 970 | 970 | should 'copy set of boxes from profile template' do |
| ... | ... | @@ -1115,7 +1115,7 @@ class ProfileTest < ActiveSupport::TestCase |
| 1115 | 1115 | template.boxes[0].blocks << b |
| 1116 | 1116 | |
| 1117 | 1117 | p = create(Profile) |
| 1118 | - assert !b[:title].blank? | |
| 1118 | + refute b[:title].blank? | |
| 1119 | 1119 | |
| 1120 | 1120 | p.copy_blocks_from(template) |
| 1121 | 1121 | |
| ... | ... | @@ -1130,7 +1130,7 @@ class ProfileTest < ActiveSupport::TestCase |
| 1130 | 1130 | template.boxes[0].blocks << b |
| 1131 | 1131 | |
| 1132 | 1132 | p = create(Profile) |
| 1133 | - assert !b[:title].blank? | |
| 1133 | + refute b[:title].blank? | |
| 1134 | 1134 | |
| 1135 | 1135 | p.copy_blocks_from(template) |
| 1136 | 1136 | |
| ... | ... | @@ -1205,7 +1205,7 @@ class ProfileTest < ActiveSupport::TestCase |
| 1205 | 1205 | p1 = fast_create(Profile, :identifier => 'mytestprofile', :environment_id => env.id) |
| 1206 | 1206 | p2 = build(Profile, :identifier => 'mytestprofile', :environment => env) |
| 1207 | 1207 | |
| 1208 | - assert !p2.valid? | |
| 1208 | + refute p2.valid? | |
| 1209 | 1209 | assert p2.errors[:identifier] |
| 1210 | 1210 | assert_equal p1.environment, p2.environment |
| 1211 | 1211 | end |
| ... | ... | @@ -1227,7 +1227,7 @@ class ProfileTest < ActiveSupport::TestCase |
| 1227 | 1227 | |
| 1228 | 1228 | should 'not has blog' do |
| 1229 | 1229 | p = fast_create(Profile) |
| 1230 | - assert !p.has_blog? | |
| 1230 | + refute p.has_blog? | |
| 1231 | 1231 | end |
| 1232 | 1232 | |
| 1233 | 1233 | should 'get nil when no blog' do |
| ... | ... | @@ -1369,14 +1369,14 @@ class ProfileTest < ActiveSupport::TestCase |
| 1369 | 1369 | child = profile.articles.create!(:name => 'child', :parent => p1) |
| 1370 | 1370 | profile.reload |
| 1371 | 1371 | assert_equivalent [p1, p2], profile.folders |
| 1372 | - assert !profile.folders.include?(child) | |
| 1372 | + refute profile.folders.include?(child) | |
| 1373 | 1373 | end |
| 1374 | 1374 | |
| 1375 | 1375 | should 'profile is invalid when image not valid' do |
| 1376 | 1376 | profile = build(Profile, :image_builder => {:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')}) |
| 1377 | 1377 | profile.image.expects(:valid?).returns(false).at_least_once |
| 1378 | 1378 | profile.image.errors.add(:size, "fake error") |
| 1379 | - assert !profile.valid? | |
| 1379 | + refute profile.valid? | |
| 1380 | 1380 | end |
| 1381 | 1381 | |
| 1382 | 1382 | should 'profile be valid when image is empty' do |
| ... | ... | @@ -1411,7 +1411,7 @@ class ProfileTest < ActiveSupport::TestCase |
| 1411 | 1411 | template.is_template = true |
| 1412 | 1412 | template.save! |
| 1413 | 1413 | profile.valid? |
| 1414 | - assert !profile.errors[:template.to_s].present? | |
| 1414 | + refute profile.errors[:template.to_s].present? | |
| 1415 | 1415 | end |
| 1416 | 1416 | |
| 1417 | 1417 | should 'be able to have a template' do |
| ... | ... | @@ -1802,7 +1802,7 @@ class ProfileTest < ActiveSupport::TestCase |
| 1802 | 1802 | |
| 1803 | 1803 | should 'not have forum' do |
| 1804 | 1804 | p = fast_create(Profile) |
| 1805 | - assert !p.has_forum? | |
| 1805 | + refute p.has_forum? | |
| 1806 | 1806 | end |
| 1807 | 1807 | |
| 1808 | 1808 | should 'get nil when no forum' do |
| ... | ... | @@ -1839,7 +1839,7 @@ class ProfileTest < ActiveSupport::TestCase |
| 1839 | 1839 | should 'know if url is the profile homepage' do |
| 1840 | 1840 | profile = fast_create(Profile) |
| 1841 | 1841 | |
| 1842 | - assert !profile.is_on_homepage?("/#{profile.identifier}/any_page") | |
| 1842 | + refute profile.is_on_homepage?("/#{profile.identifier}/any_page") | |
| 1843 | 1843 | assert profile.is_on_homepage?("/#{profile.identifier}") |
| 1844 | 1844 | end |
| 1845 | 1845 | |
| ... | ... | @@ -1851,7 +1851,7 @@ class ProfileTest < ActiveSupport::TestCase |
| 1851 | 1851 | profile.home_page = homepage |
| 1852 | 1852 | profile.save |
| 1853 | 1853 | |
| 1854 | - assert !profile.is_on_homepage?("/#{profile.identifier}/#{not_homepage.slug}",not_homepage) | |
| 1854 | + refute profile.is_on_homepage?("/#{profile.identifier}/#{not_homepage.slug}",not_homepage) | |
| 1855 | 1855 | assert profile.is_on_homepage?("/#{profile.identifier}/#{homepage.slug}", homepage) |
| 1856 | 1856 | end |
| 1857 | 1857 | |
| ... | ... | @@ -1958,7 +1958,7 @@ class ProfileTest < ActiveSupport::TestCase |
| 1958 | 1958 | |
| 1959 | 1959 | def assert_invalid_identifier(id) |
| 1960 | 1960 | profile = Profile.new(:identifier => id) |
| 1961 | - assert !profile.valid? | |
| 1961 | + refute profile.valid? | |
| 1962 | 1962 | assert profile.errors[:identifier.to_s].present? |
| 1963 | 1963 | end |
| 1964 | 1964 | |
| ... | ... | @@ -1987,7 +1987,7 @@ class ProfileTest < ActiveSupport::TestCase |
| 1987 | 1987 | Environment.login_redirection_options.keys.each do |redirection| |
| 1988 | 1988 | profile.redirection_after_login = redirection |
| 1989 | 1989 | profile.save |
| 1990 | - assert !profile.errors[:redirection_after_login.to_s].present? | |
| 1990 | + refute profile.errors[:redirection_after_login.to_s].present? | |
| 1991 | 1991 | end |
| 1992 | 1992 | end |
| 1993 | 1993 | |
| ... | ... | @@ -2009,7 +2009,7 @@ class ProfileTest < ActiveSupport::TestCase |
| 2009 | 2009 | profile = fast_create(Profile) |
| 2010 | 2010 | profile.stubs(:active_fields).returns(['field']) |
| 2011 | 2011 | profile.stubs(:public_fields).returns([]) |
| 2012 | - assert !profile.may_display_field_to?('field', nil) | |
| 2012 | + refute profile.may_display_field_to?('field', nil) | |
| 2013 | 2013 | end |
| 2014 | 2014 | |
| 2015 | 2015 | should 'not display field if field is active but not public and user is not friend' do |
| ... | ... | @@ -2018,7 +2018,7 @@ class ProfileTest < ActiveSupport::TestCase |
| 2018 | 2018 | profile.expects(:public_fields).returns([]) |
| 2019 | 2019 | user = mock |
| 2020 | 2020 | user.expects(:is_a_friend?).with(profile).returns(false) |
| 2021 | - assert !profile.may_display_field_to?('field', user) | |
| 2021 | + refute profile.may_display_field_to?('field', user) | |
| 2022 | 2022 | end |
| 2023 | 2023 | |
| 2024 | 2024 | should 'display field if field is active and not public but user is profile owner' do |
| ... | ... | @@ -2057,7 +2057,7 @@ class ProfileTest < ActiveSupport::TestCase |
| 2057 | 2057 | assert profile.may_display_location_to?(user) |
| 2058 | 2058 | |
| 2059 | 2059 | profile.stubs(:may_display_field_to?).with(Profile::LOCATION_FIELDS[0], user).returns(false) |
| 2060 | - assert !profile.may_display_location_to?(user) | |
| 2060 | + refute profile.may_display_location_to?(user) | |
| 2061 | 2061 | end |
| 2062 | 2062 | |
| 2063 | 2063 | should 'destroy profile if its environment is destroyed' do |
| ... | ... | @@ -2099,13 +2099,13 @@ class ProfileTest < ActiveSupport::TestCase |
| 2099 | 2099 | end |
| 2100 | 2100 | |
| 2101 | 2101 | should 'not copy rss_feed' do |
| 2102 | - assert !fast_create(Profile).copy_article?(fast_create(RssFeed)) | |
| 2102 | + refute fast_create(Profile).copy_article?(fast_create(RssFeed)) | |
| 2103 | 2103 | end |
| 2104 | 2104 | |
| 2105 | 2105 | should 'not copy template welcome_page' do |
| 2106 | 2106 | template = fast_create(Person, :is_template => true) |
| 2107 | 2107 | welcome_page = fast_create(TinyMceArticle, :slug => 'welcome-page', :profile_id => template.id) |
| 2108 | - assert !template.copy_article?(welcome_page) | |
| 2108 | + refute template.copy_article?(welcome_page) | |
| 2109 | 2109 | end |
| 2110 | 2110 | |
| 2111 | 2111 | should 'return nil on welcome_page_content if template has no welcome page' do | ... | ... |
test/unit/qualifier_test.rb
| ... | ... | @@ -5,7 +5,7 @@ class QualifierTest < ActiveSupport::TestCase |
| 5 | 5 | |
| 6 | 6 | should 'environment is mandatory' do |
| 7 | 7 | qualifier = Qualifier.new(:name => 'Qualifier without environment') |
| 8 | - assert !qualifier.valid? | |
| 8 | + refute qualifier.valid? | |
| 9 | 9 | |
| 10 | 10 | qualifier.environment = fast_create(Environment) |
| 11 | 11 | assert qualifier.valid? |
| ... | ... | @@ -25,7 +25,7 @@ class QualifierTest < ActiveSupport::TestCase |
| 25 | 25 | should 'name is mandatory' do |
| 26 | 26 | env_one = fast_create(Environment) |
| 27 | 27 | qualifier = env_one.qualifiers.build |
| 28 | - assert !qualifier.valid? | |
| 28 | + refute qualifier.valid? | |
| 29 | 29 | |
| 30 | 30 | qualifier.name = 'Qualifier name' |
| 31 | 31 | assert qualifier.valid? | ... | ... |
test/unit/region_test.rb
| ... | ... | @@ -26,7 +26,7 @@ class RegionTest < ActiveSupport::TestCase |
| 26 | 26 | should 'has no validator' do |
| 27 | 27 | env = fast_create(Environment) |
| 28 | 28 | region = fast_create(Region, :environment_id => env.id, :name => 'My Region') |
| 29 | - assert !region.has_validator? | |
| 29 | + refute region.has_validator? | |
| 30 | 30 | end |
| 31 | 31 | |
| 32 | 32 | should 'list regions with validators' do | ... | ... |
test/unit/rss_feed_test.rb
| ... | ... | @@ -15,7 +15,7 @@ class RssFeedTest < ActiveSupport::TestCase |
| 15 | 15 | :search => 'parent_and_children', |
| 16 | 16 | } |
| 17 | 17 | feed.valid? |
| 18 | - assert !feed.errors['body'.to_s].present? | |
| 18 | + refute feed.errors['body'.to_s].present? | |
| 19 | 19 | end |
| 20 | 20 | |
| 21 | 21 | should 'alias body as "settings"' do |
| ... | ... | @@ -172,11 +172,11 @@ class RssFeedTest < ActiveSupport::TestCase |
| 172 | 172 | |
| 173 | 173 | feed.include = 'parent_and_children' |
| 174 | 174 | feed.valid? |
| 175 | - assert !feed.errors[:include.to_s].present? | |
| 175 | + refute feed.errors[:include.to_s].present? | |
| 176 | 176 | |
| 177 | 177 | feed.include = 'all' |
| 178 | 178 | feed.valid? |
| 179 | - assert !feed.errors[:include.to_s].present? | |
| 179 | + refute feed.errors[:include.to_s].present? | |
| 180 | 180 | end |
| 181 | 181 | |
| 182 | 182 | should 'provide proper short description' do |
| ... | ... | @@ -194,7 +194,7 @@ class RssFeedTest < ActiveSupport::TestCase |
| 194 | 194 | should 'advertise is false before create' do |
| 195 | 195 | profile = create_user('testuser').person |
| 196 | 196 | feed = create(RssFeed, :name => 'testfeed', :profile => profile) |
| 197 | - assert !feed.advertise? | |
| 197 | + refute feed.advertise? | |
| 198 | 198 | end |
| 199 | 199 | |
| 200 | 200 | should 'can display hits' do | ... | ... |
test/unit/scope_tool.rb
| ... | ... | @@ -23,9 +23,9 @@ class ScopeToolTest < ActiveSupport::TestCase |
| 23 | 23 | assert orgs.include? ent2 |
| 24 | 24 | orgs = orgs.visible |
| 25 | 25 | assert orgs.include? cmm1 |
| 26 | - assert !orgs.include?(cmm2) | |
| 26 | + refute orgs.include?(cmm2) | |
| 27 | 27 | assert orgs.include? ent1 |
| 28 | - assert !orgs.include?(ent2) | |
| 28 | + refute orgs.include?(ent2) | |
| 29 | 29 | end |
| 30 | 30 | |
| 31 | 31 | end | ... | ... |
test/unit/scrap_test.rb
| ... | ... | @@ -19,7 +19,7 @@ class ScrapTest < ActiveSupport::TestCase |
| 19 | 19 | |
| 20 | 20 | s.content = 'some content' |
| 21 | 21 | s.valid? |
| 22 | - assert !s.errors[:content.to_s].present? | |
| 22 | + refute s.errors[:content.to_s].present? | |
| 23 | 23 | end |
| 24 | 24 | |
| 25 | 25 | should "have the sender" do |
| ... | ... | @@ -29,7 +29,7 @@ class ScrapTest < ActiveSupport::TestCase |
| 29 | 29 | |
| 30 | 30 | s.sender_id = 1 |
| 31 | 31 | s.valid? |
| 32 | - assert !s.errors[:sender_id.to_s].present? | |
| 32 | + refute s.errors[:sender_id.to_s].present? | |
| 33 | 33 | end |
| 34 | 34 | |
| 35 | 35 | should "have the receiver" do |
| ... | ... | @@ -39,7 +39,7 @@ class ScrapTest < ActiveSupport::TestCase |
| 39 | 39 | |
| 40 | 40 | s.receiver_id = 1 |
| 41 | 41 | s.valid? |
| 42 | - assert !s.errors[:receiver_id.to_s].present? | |
| 42 | + refute s.errors[:receiver_id.to_s].present? | |
| 43 | 43 | end |
| 44 | 44 | |
| 45 | 45 | should "be associated to Person as sender" do |
| ... | ... | @@ -258,7 +258,7 @@ class ScrapTest < ActiveSupport::TestCase |
| 258 | 258 | should 'strip html before validate' do |
| 259 | 259 | s, r = create_user.person, create_user.person |
| 260 | 260 | s = build Scrap, :sender => s, :receiver => r, :content => "<p><b></b></p>" |
| 261 | - assert !s.valid? | |
| 261 | + refute s.valid? | |
| 262 | 262 | s.content = "<p>Test</p>" |
| 263 | 263 | assert s.valid? |
| 264 | 264 | end | ... | ... |
test/unit/search_helper_test.rb
| ... | ... | @@ -14,14 +14,14 @@ class SearchHelperTest < ActiveSupport::TestCase |
| 14 | 14 | |
| 15 | 15 | stubs(:params).returns({:action => 'products', :display => 'map'}) |
| 16 | 16 | @results = {:products => [1,2]} |
| 17 | - assert !multiple_search? | |
| 17 | + refute multiple_search? | |
| 18 | 18 | end |
| 19 | 19 | |
| 20 | 20 | should 'return whether on a map search' do |
| 21 | 21 | stubs(:params).returns({:action => 'index', :display => 'map'}) |
| 22 | 22 | @results = {:articles => [1,2], :products => [1,2]} |
| 23 | 23 | @query = '' |
| 24 | - assert !map_search? | |
| 24 | + refute map_search? | |
| 25 | 25 | |
| 26 | 26 | stubs(:params).returns({:action => 'products', :display => 'map'}) |
| 27 | 27 | @results = {:products => [1,2]} | ... | ... |
test/unit/search_term_occurrence_test.rb
| ... | ... | @@ -10,7 +10,7 @@ class SearchTermOccurrenceTest < ActiveSupport::TestCase |
| 10 | 10 | |
| 11 | 11 | should 'have term' do |
| 12 | 12 | search_term_occurrence = SearchTermOccurrence.new |
| 13 | - assert !search_term_occurrence.valid? | |
| 13 | + refute search_term_occurrence.valid? | |
| 14 | 14 | assert search_term_occurrence.errors.has_key?(:search_term) |
| 15 | 15 | end |
| 16 | 16 | ... | ... |
test/unit/search_term_test.rb
| ... | ... | @@ -3,13 +3,13 @@ require 'test_helper' |
| 3 | 3 | class SearchTermTest < ActiveSupport::TestCase |
| 4 | 4 | should 'have term' do |
| 5 | 5 | search_term = SearchTerm.new |
| 6 | - assert !search_term.valid? | |
| 6 | + refute search_term.valid? | |
| 7 | 7 | assert search_term.errors.has_key?(:term) |
| 8 | 8 | end |
| 9 | 9 | |
| 10 | 10 | should 'have context' do |
| 11 | 11 | search_term = SearchTerm.new |
| 12 | - assert !search_term.valid? | |
| 12 | + refute search_term.valid? | |
| 13 | 13 | assert search_term.errors.has_key?(:context) |
| 14 | 14 | end |
| 15 | 15 | |
| ... | ... | @@ -21,12 +21,12 @@ class SearchTermTest < ActiveSupport::TestCase |
| 21 | 21 | |
| 22 | 22 | search_term.asset = 'alternate_universe' |
| 23 | 23 | search_term.valid? |
| 24 | - assert !search_term.errors.has_key?(:term) | |
| 24 | + refute search_term.errors.has_key?(:term) | |
| 25 | 25 | |
| 26 | 26 | search_term.asset = 'universe' |
| 27 | 27 | search_term.context = fast_create(Profile) |
| 28 | 28 | search_term.valid? |
| 29 | - assert !search_term.errors.has_key?(:term) | |
| 29 | + refute search_term.errors.has_key?(:term) | |
| 30 | 30 | end |
| 31 | 31 | |
| 32 | 32 | should 'create a search term' do | ... | ... |
test/unit/suggest_article_test.rb
| ... | ... | @@ -13,28 +13,28 @@ class SuggestArticleTest < ActiveSupport::TestCase |
| 13 | 13 | |
| 14 | 14 | should 'have the article_name' do |
| 15 | 15 | t = SuggestArticle.new |
| 16 | - assert !t.article_object.errors[:name].present? | |
| 16 | + refute t.article_object.errors[:name].present? | |
| 17 | 17 | t.article_object.valid? |
| 18 | 18 | assert t.article_object.errors[:name].present? |
| 19 | 19 | end |
| 20 | 20 | |
| 21 | 21 | should 'have the email' do |
| 22 | 22 | t = SuggestArticle.new |
| 23 | - assert !t.errors[:email.to_s].present? | |
| 23 | + refute t.errors[:email.to_s].present? | |
| 24 | 24 | t.valid? |
| 25 | 25 | assert t.errors[:email.to_s].present? |
| 26 | 26 | end |
| 27 | 27 | |
| 28 | 28 | should 'have the name' do |
| 29 | 29 | t = SuggestArticle.new |
| 30 | - assert !t.errors[:name.to_s].present? | |
| 30 | + refute t.errors[:name.to_s].present? | |
| 31 | 31 | t.valid? |
| 32 | 32 | assert t.errors[:name.to_s].present? |
| 33 | 33 | end |
| 34 | 34 | |
| 35 | 35 | should 'have the target_id' do |
| 36 | 36 | t = SuggestArticle.new |
| 37 | - assert !t.errors[:target_id.to_s].present? | |
| 37 | + refute t.errors[:target_id.to_s].present? | |
| 38 | 38 | t.valid? |
| 39 | 39 | assert t.errors[:target_id.to_s].present? |
| 40 | 40 | end |
| ... | ... | @@ -42,7 +42,7 @@ class SuggestArticleTest < ActiveSupport::TestCase |
| 42 | 42 | should 'have the article' do |
| 43 | 43 | t = SuggestArticle.new |
| 44 | 44 | assert t.respond_to?(:article_object) |
| 45 | - assert !t.errors[:article_object].present? | |
| 45 | + refute t.errors[:article_object].present? | |
| 46 | 46 | t.valid? |
| 47 | 47 | assert t.errors[:article_object].present? |
| 48 | 48 | end | ... | ... |
test/unit/task_mailer_test.rb
| ... | ... | @@ -31,7 +31,7 @@ class TaskMailerTest < ActiveSupport::TestCase |
| 31 | 31 | task.expects(:environment).returns(environment).at_least_once |
| 32 | 32 | |
| 33 | 33 | task.send(:send_notification, :finished).deliver |
| 34 | - assert !ActionMailer::Base.deliveries.empty? | |
| 34 | + refute ActionMailer::Base.deliveries.empty? | |
| 35 | 35 | end |
| 36 | 36 | |
| 37 | 37 | should 'be able to send a "task cancelled" message' do |
| ... | ... | @@ -54,7 +54,7 @@ class TaskMailerTest < ActiveSupport::TestCase |
| 54 | 54 | task.expects(:environment).returns(environment).at_least_once |
| 55 | 55 | |
| 56 | 56 | task.send(:send_notification, :cancelled).deliver |
| 57 | - assert !ActionMailer::Base.deliveries.empty? | |
| 57 | + refute ActionMailer::Base.deliveries.empty? | |
| 58 | 58 | end |
| 59 | 59 | |
| 60 | 60 | should 'be able to send a "task created" message' do |
| ... | ... | @@ -78,7 +78,7 @@ class TaskMailerTest < ActiveSupport::TestCase |
| 78 | 78 | task.expects(:environment).returns(environment).at_least_once |
| 79 | 79 | |
| 80 | 80 | task.send(:send_notification, :created).deliver |
| 81 | - assert !ActionMailer::Base.deliveries.empty? | |
| 81 | + refute ActionMailer::Base.deliveries.empty? | |
| 82 | 82 | end |
| 83 | 83 | |
| 84 | 84 | should 'be able to send a "target notification" message' do |
| ... | ... | @@ -88,7 +88,7 @@ class TaskMailerTest < ActiveSupport::TestCase |
| 88 | 88 | task.expects(:target_notification_description).returns('the task') |
| 89 | 89 | |
| 90 | 90 | TaskMailer.target_notification(task, 'the message').deliver |
| 91 | - assert !ActionMailer::Base.deliveries.empty? | |
| 91 | + refute ActionMailer::Base.deliveries.empty? | |
| 92 | 92 | end |
| 93 | 93 | |
| 94 | 94 | should 'be able to send a "invitation notification" message' do |
| ... | ... | @@ -121,7 +121,7 @@ class TaskMailerTest < ActiveSupport::TestCase |
| 121 | 121 | assert_equal "Hello friend name, my name invite you, please follow this link: http://example.com/account/signup?invitation_code=123456", mail.body.to_s |
| 122 | 122 | |
| 123 | 123 | mail.deliver |
| 124 | - assert !ActionMailer::Base.deliveries.empty? | |
| 124 | + refute ActionMailer::Base.deliveries.empty? | |
| 125 | 125 | end |
| 126 | 126 | |
| 127 | 127 | should 'use environment name and no-reply email' do | ... | ... |
test/unit/task_test.rb
| ... | ... | @@ -114,7 +114,7 @@ class TaskTest < ActiveSupport::TestCase |
| 114 | 114 | task1 = Task.create! |
| 115 | 115 | task2 = build(Task, :code => task1.code) |
| 116 | 116 | |
| 117 | - assert !task2.valid? | |
| 117 | + refute task2.valid? | |
| 118 | 118 | assert task2.errors[:code.to_s].present? |
| 119 | 119 | end |
| 120 | 120 | |
| ... | ... | @@ -391,15 +391,15 @@ class TaskTest < ActiveSupport::TestCase |
| 391 | 391 | t = Task.new |
| 392 | 392 | t.spam = true |
| 393 | 393 | assert t.spam? |
| 394 | - assert !t.ham? | |
| 394 | + refute t.ham? | |
| 395 | 395 | |
| 396 | 396 | t.spam = false |
| 397 | 397 | assert t.ham? |
| 398 | - assert !t.spam? | |
| 398 | + refute t.spam? | |
| 399 | 399 | |
| 400 | 400 | t.spam = nil |
| 401 | - assert !t.spam? | |
| 402 | - assert !t.ham? | |
| 401 | + refute t.spam? | |
| 402 | + refute t.ham? | |
| 403 | 403 | end |
| 404 | 404 | |
| 405 | 405 | should 'be able to select non-spam tasks' do | ... | ... |
test/unit/text_article_test.rb
| ... | ... | @@ -92,7 +92,7 @@ class TextArticleTest < ActiveSupport::TestCase |
| 92 | 92 | |
| 93 | 93 | text = TextArticle.new(:profile => profile) |
| 94 | 94 | |
| 95 | - assert !text.translatable? | |
| 95 | + refute text.translatable? | |
| 96 | 96 | end |
| 97 | 97 | |
| 98 | 98 | should 'be translatable if there is languages on environment' do |
| ... | ... | @@ -101,7 +101,7 @@ class TextArticleTest < ActiveSupport::TestCase |
| 101 | 101 | profile = fast_create(Person, :environment_id => environment.id) |
| 102 | 102 | text = fast_create(TextArticle, :profile_id => profile.id) |
| 103 | 103 | |
| 104 | - assert !text.translatable? | |
| 104 | + refute text.translatable? | |
| 105 | 105 | |
| 106 | 106 | environment.languages = ['en','pt','fr'] |
| 107 | 107 | environment.save | ... | ... |
test/unit/theme_test.rb
| ... | ... | @@ -167,7 +167,7 @@ class ThemeTest < ActiveSupport::TestCase |
| 167 | 167 | [Theme.find(t2.id), Theme.find(t1.id)].each do |theme| |
| 168 | 168 | assert Theme.approved_themes(profile).include?(theme) |
| 169 | 169 | end |
| 170 | - assert ! Theme.approved_themes(profile).include?(Theme.find(t3.id)) | |
| 170 | + refute Theme.approved_themes(profile).include?(Theme.find(t3.id)) | |
| 171 | 171 | end |
| 172 | 172 | |
| 173 | 173 | should 'not list non theme files or dirs inside themes dir' do |
| ... | ... | @@ -188,7 +188,7 @@ class ThemeTest < ActiveSupport::TestCase |
| 188 | 188 | end |
| 189 | 189 | |
| 190 | 190 | should 'not be public by default' do |
| 191 | - assert ! Theme.new('test').public | |
| 191 | + refute Theme.new('test').public | |
| 192 | 192 | end |
| 193 | 193 | |
| 194 | 194 | should 'not crash with nil or invalid owner_type' do | ... | ... |
test/unit/translatable_content_test.rb
| ... | ... | @@ -18,7 +18,7 @@ class TranslatableContentTest < ActiveSupport::TestCase |
| 18 | 18 | |
| 19 | 19 | should 'not be translatable if parent is a forum' do |
| 20 | 20 | content.parent = Forum.new |
| 21 | - assert !content.translatable? | |
| 21 | + refute content.translatable? | |
| 22 | 22 | end |
| 23 | 23 | |
| 24 | 24 | should 'be translatable if parent is not a forum' do | ... | ... |
test/unit/uploaded_file_test.rb
| ... | ... | @@ -74,7 +74,7 @@ class UploadedFileTest < ActiveSupport::TestCase |
| 74 | 74 | should 'not upload files bigger than max_size' do |
| 75 | 75 | f = build(UploadedFile, :profile => @profile, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')) |
| 76 | 76 | f.expects(:size).returns(UploadedFile.attachment_options[:max_size] + 1024) |
| 77 | - assert !f.valid? | |
| 77 | + refute f.valid? | |
| 78 | 78 | end |
| 79 | 79 | |
| 80 | 80 | should 'upload files smaller than max_size' do |
| ... | ... | @@ -175,7 +175,7 @@ class UploadedFileTest < ActiveSupport::TestCase |
| 175 | 175 | end |
| 176 | 176 | |
| 177 | 177 | should 'return false by default in thumbnails_processed' do |
| 178 | - assert !UploadedFile.new.thumbnails_processed | |
| 178 | + refute UploadedFile.new.thumbnails_processed | |
| 179 | 179 | end |
| 180 | 180 | |
| 181 | 181 | should 'set thumbnails_processed to true' do | ... | ... |
test/unit/user_test.rb
| ... | ... | @@ -10,7 +10,7 @@ class UserTest < ActiveSupport::TestCase |
| 10 | 10 | def test_should_create_user |
| 11 | 11 | assert_difference 'User.count' do |
| 12 | 12 | user = new_user |
| 13 | - assert !user.new_record?, "#{user.errors.full_messages.to_sentence}" | |
| 13 | + refute user.new_record?, "#{user.errors.full_messages.to_sentence}" | |
| 14 | 14 | end |
| 15 | 15 | end |
| 16 | 16 | |
| ... | ... | @@ -110,15 +110,15 @@ class UserTest < ActiveSupport::TestCase |
| 110 | 110 | |
| 111 | 111 | u.login = 'rightformat2007' |
| 112 | 112 | u.valid? |
| 113 | - assert ! u.errors[:login.to_s].present? | |
| 113 | + refute u.errors[:login.to_s].present? | |
| 114 | 114 | |
| 115 | 115 | u.login = 'rightformat' |
| 116 | 116 | u.valid? |
| 117 | - assert ! u.errors[:login.to_s].present? | |
| 117 | + refute u.errors[:login.to_s].present? | |
| 118 | 118 | |
| 119 | 119 | u.login = 'right_format' |
| 120 | 120 | u.valid? |
| 121 | - assert ! u.errors[:login.to_s].present? | |
| 121 | + refute u.errors[:login.to_s].present? | |
| 122 | 122 | end |
| 123 | 123 | |
| 124 | 124 | def test_should_change_password |
| ... | ... | @@ -126,7 +126,7 @@ class UserTest < ActiveSupport::TestCase |
| 126 | 126 | assert_nothing_raised do |
| 127 | 127 | user.change_password!('test', 'newpass', 'newpass') |
| 128 | 128 | end |
| 129 | - assert !user.authenticated?('test') | |
| 129 | + refute user.authenticated?('test') | |
| 130 | 130 | assert user.authenticated?('newpass') |
| 131 | 131 | end |
| 132 | 132 | |
| ... | ... | @@ -135,7 +135,7 @@ class UserTest < ActiveSupport::TestCase |
| 135 | 135 | assert_raise User::IncorrectPassword do |
| 136 | 136 | user.change_password!('wrong', 'newpass', 'newpass') |
| 137 | 137 | end |
| 138 | - assert !user.authenticated?('newpass') | |
| 138 | + refute user.authenticated?('newpass') | |
| 139 | 139 | assert user.authenticated?('test') |
| 140 | 140 | end |
| 141 | 141 | |
| ... | ... | @@ -144,7 +144,7 @@ class UserTest < ActiveSupport::TestCase |
| 144 | 144 | assert_raise ActiveRecord::RecordInvalid do |
| 145 | 145 | user.force_change_password!('newpass', 'newpasswrong') |
| 146 | 146 | end |
| 147 | - assert !user.authenticated?('newpass') | |
| 147 | + refute user.authenticated?('newpass') | |
| 148 | 148 | assert user.authenticated?('test') |
| 149 | 149 | end |
| 150 | 150 | |
| ... | ... | @@ -158,7 +158,7 @@ class UserTest < ActiveSupport::TestCase |
| 158 | 158 | |
| 159 | 159 | def test_should_create_person_when_creating_user |
| 160 | 160 | count = Person.count |
| 161 | - assert !Person.find_by_identifier('lalala') | |
| 161 | + refute Person.find_by_identifier('lalala') | |
| 162 | 162 | new_user(:login => 'lalala', :email => 'lalala@example.com') |
| 163 | 163 | assert Person.find_by_identifier('lalala') |
| 164 | 164 | end |
| ... | ... | @@ -174,7 +174,7 @@ class UserTest < ActiveSupport::TestCase |
| 174 | 174 | user = new_user(:login => 'lalala', :email => 'lalala@example.com') |
| 175 | 175 | assert Person.find_by_identifier('lalala') |
| 176 | 176 | user.destroy |
| 177 | - assert !Person.find_by_identifier('lalala') | |
| 177 | + refute Person.find_by_identifier('lalala') | |
| 178 | 178 | end |
| 179 | 179 | |
| 180 | 180 | def test_should_encrypt_password_with_salted_sha1 |
| ... | ... | @@ -291,7 +291,7 @@ class UserTest < ActiveSupport::TestCase |
| 291 | 291 | |
| 292 | 292 | should 'enable email' do |
| 293 | 293 | user = create_user('cooler') |
| 294 | - assert !user.enable_email | |
| 294 | + refute user.enable_email | |
| 295 | 295 | assert user.enable_email! |
| 296 | 296 | assert user.enable_email |
| 297 | 297 | end |
| ... | ... | @@ -307,7 +307,7 @@ class UserTest < ActiveSupport::TestCase |
| 307 | 307 | user = create_user('cooler') |
| 308 | 308 | user.expects(:environment).returns(nil) |
| 309 | 309 | EmailActivation.create!(:requestor => user.person, :target => Environment.default) |
| 310 | - assert !user.email_activation_pending? | |
| 310 | + refute user.email_activation_pending? | |
| 311 | 311 | end |
| 312 | 312 | |
| 313 | 313 | should 'has moderate registration pending' do |
| ... | ... | @@ -318,7 +318,7 @@ class UserTest < ActiveSupport::TestCase |
| 318 | 318 | |
| 319 | 319 | should 'not has moderate registration pending if not have a pending task' do |
| 320 | 320 | user = create_user('cooler') |
| 321 | - assert !user.moderate_registration_pending? | |
| 321 | + refute user.moderate_registration_pending? | |
| 322 | 322 | end |
| 323 | 323 | |
| 324 | 324 | should 'be able to use [] operator to find users by login' do |
| ... | ... | @@ -527,7 +527,7 @@ class UserTest < ActiveSupport::TestCase |
| 527 | 527 | user = new_user |
| 528 | 528 | assert_not_nil user.activation_code |
| 529 | 529 | assert_nil user.activated_at |
| 530 | - assert !user.person.visible | |
| 530 | + refute user.person.visible | |
| 531 | 531 | end |
| 532 | 532 | |
| 533 | 533 | should 'activate an user' do |
| ... | ... | @@ -540,7 +540,7 @@ class UserTest < ActiveSupport::TestCase |
| 540 | 540 | |
| 541 | 541 | should 'return if the user is activated' do |
| 542 | 542 | user = new_user |
| 543 | - assert !user.activated? | |
| 543 | + refute user.activated? | |
| 544 | 544 | user.activate |
| 545 | 545 | assert user.activated? |
| 546 | 546 | end |
| ... | ... | @@ -573,7 +573,7 @@ class UserTest < ActiveSupport::TestCase |
| 573 | 573 | user.activate |
| 574 | 574 | assert user.deactivate |
| 575 | 575 | assert_nil user.activated_at |
| 576 | - assert !user.person.visible | |
| 576 | + refute user.person.visible | |
| 577 | 577 | end |
| 578 | 578 | |
| 579 | 579 | should 'return if the user is deactivated' do |
| ... | ... | @@ -581,7 +581,7 @@ class UserTest < ActiveSupport::TestCase |
| 581 | 581 | user.activate |
| 582 | 582 | assert user.activated? |
| 583 | 583 | user.deactivate |
| 584 | - assert !user.activated? | |
| 584 | + refute user.activated? | |
| 585 | 585 | end |
| 586 | 586 | |
| 587 | 587 | should 'activate right after creation when confirmation is not required' do |
| ... | ... | @@ -595,7 +595,7 @@ class UserTest < ActiveSupport::TestCase |
| 595 | 595 | should 'cancel activation if user has no person associated' do |
| 596 | 596 | user = new_user |
| 597 | 597 | user.stubs(:person).returns(nil) |
| 598 | - assert !user.activate | |
| 598 | + refute user.activate | |
| 599 | 599 | end |
| 600 | 600 | |
| 601 | 601 | should 'be able to skip the password requirement' do | ... | ... |
test/unit/validation_info_test.rb
| ... | ... | @@ -8,7 +8,7 @@ class ValidationInfoTest < ActiveSupport::TestCase |
| 8 | 8 | assert info.errors[:validation_methodology].any? |
| 9 | 9 | info.validation_methodology = 'lalala' |
| 10 | 10 | info.valid? |
| 11 | - assert !info.errors[:validation_methodology].any? | |
| 11 | + refute info.errors[:validation_methodology].any? | |
| 12 | 12 | end |
| 13 | 13 | |
| 14 | 14 | should 'refer to and validate the presence of an organization' do | ... | ... |