diff --git a/plugins/breadcrumbs/test/functional/profile_design_controller_test.rb b/plugins/breadcrumbs/test/functional/profile_design_controller_test.rb index 94dc8bb..a326824 100644 --- a/plugins/breadcrumbs/test/functional/profile_design_controller_test.rb +++ b/plugins/breadcrumbs/test/functional/profile_design_controller_test.rb @@ -37,8 +37,8 @@ class ProfileDesignControllerTest < ActionController::TestCase post :save, :id => @block.id, :profile => @profile.identifier, :block => {:title => 'breadcrumbs', :show_cms_action => false, :show_profile => false} @block.reload assert_equal 'breadcrumbs', @block.title - assert !@block.show_profile - assert !@block.show_cms_action + refute @block.show_profile + refute @block.show_cms_action end should 'be able save breadcrumbs block with show_section_name option' do diff --git a/plugins/breadcrumbs/test/unit/breadcrumbs_plugin_test.rb b/plugins/breadcrumbs/test/unit/breadcrumbs_plugin_test.rb index 57dd8f6..cc33cbe 100644 --- a/plugins/breadcrumbs/test/unit/breadcrumbs_plugin_test.rb +++ b/plugins/breadcrumbs/test/unit/breadcrumbs_plugin_test.rb @@ -7,11 +7,11 @@ class BreadcrumbsPluginTest < ActiveSupport::TestCase end should 'has a name' do - assert !BreadcrumbsPlugin.plugin_name.blank? + refute BreadcrumbsPlugin.plugin_name.blank? end should 'has a description' do - assert !BreadcrumbsPlugin.plugin_description.blank? + refute BreadcrumbsPlugin.plugin_description.blank? end should 'add a block' do diff --git a/plugins/breadcrumbs/test/unit/content_breadcrumbs_block_test.rb b/plugins/breadcrumbs/test/unit/content_breadcrumbs_block_test.rb index 5368ba1..7243ceb 100644 --- a/plugins/breadcrumbs/test/unit/content_breadcrumbs_block_test.rb +++ b/plugins/breadcrumbs/test/unit/content_breadcrumbs_block_test.rb @@ -69,7 +69,7 @@ class ContentBreadcrumbsBlockTest < ActiveSupport::TestCase end should 'not be cacheable' do - assert !@block.cacheable? + refute @block.cacheable? end end diff --git a/plugins/bsc/test/functional/bsc_plugin_admin_controller_test.rb b/plugins/bsc/test/functional/bsc_plugin_admin_controller_test.rb index c277874..1b33d94 100644 --- a/plugins/bsc/test/functional/bsc_plugin_admin_controller_test.rb +++ b/plugins/bsc/test/functional/bsc_plugin_admin_controller_test.rb @@ -76,6 +76,6 @@ class BscPluginAdminControllerTest < ActionController::TestCase assert e1.validated assert e2.validated - assert !e3.validated + refute e3.validated end end diff --git a/plugins/bsc/test/unit/bsc_plugin/bsc_test.rb b/plugins/bsc/test/unit/bsc_plugin/bsc_test.rb index 5f0e1e3..bd48382 100644 --- a/plugins/bsc/test/unit/bsc_plugin/bsc_test.rb +++ b/plugins/bsc/test/unit/bsc_plugin/bsc_test.rb @@ -41,7 +41,7 @@ class BscPlugin::BscTest < ActiveSupport::TestCase bsc.enterprise_requests.stubs(:pending).returns([task]) assert bsc.already_requested?(e1) - assert !bsc.already_requested?(e2) + refute bsc.already_requested?(e2) end should 'return associated enterprises products' do @@ -68,7 +68,7 @@ class BscPlugin::BscTest < ActiveSupport::TestCase end should 'not be able to create product' do - assert !bsc.create_product? + refute bsc.create_product? end should 'have many contracts' do diff --git a/plugins/bsc/test/unit/bsc_plugin/contract_test.rb b/plugins/bsc/test/unit/bsc_plugin/contract_test.rb index 29d9283..d0611d7 100644 --- a/plugins/bsc/test/unit/bsc_plugin/contract_test.rb +++ b/plugins/bsc/test/unit/bsc_plugin/contract_test.rb @@ -14,7 +14,7 @@ class BscPlugin::ContractTest < ActiveSupport::TestCase contract.bsc = BscPlugin::Bsc.new contract.valid? - assert !contract.errors.invalid?(:bsc) + refute contract.errors.invalid?(:bsc) end should 'associate contract with products through sales' do diff --git a/plugins/bsc/test/unit/bsc_plugin/sale_test.rb b/plugins/bsc/test/unit/bsc_plugin/sale_test.rb index 2ae1b3a..5f8e92f 100644 --- a/plugins/bsc/test/unit/bsc_plugin/sale_test.rb +++ b/plugins/bsc/test/unit/bsc_plugin/sale_test.rb @@ -18,8 +18,8 @@ class BscPlugin::SaleTest < ActiveSupport::TestCase sale.product = product sale.contract = contract - assert !sale.errors.invalid?(product) - assert !sale.errors.invalid?(contract) + refute sale.errors.invalid?(product) + refute sale.errors.invalid?(contract) end should 'validate uniqueness of product and contract composed' do @@ -43,7 +43,7 @@ class BscPlugin::SaleTest < ActiveSupport::TestCase sale.quantity = 3 sale.valid? - assert !sale.errors.invalid?(:quantity) + refute sale.errors.invalid?(:quantity) end should 'set default price as product price if no price indicated' do diff --git a/plugins/comment_group/test/unit/article_test.rb b/plugins/comment_group/test/unit/article_test.rb index e9d5f04..e777b5b 100644 --- a/plugins/comment_group/test/unit/article_test.rb +++ b/plugins/comment_group/test/unit/article_test.rb @@ -19,7 +19,7 @@ class ArticleTest < ActiveSupport::TestCase should 'do not allow a exclusion of a group comment macro if this group has comments' do article.body = "
" comment1 = fast_create(Comment, :group_id => 1, :source_id => article.id) - assert !article.save + refute article.save assert_equal ['Not empty group comment cannot be removed'], article.errors[:base] end diff --git a/plugins/comment_group/test/unit/comment_group_plugin_test.rb b/plugins/comment_group/test/unit/comment_group_plugin_test.rb index 304922b..74a16f7 100644 --- a/plugins/comment_group/test/unit/comment_group_plugin_test.rb +++ b/plugins/comment_group/test/unit/comment_group_plugin_test.rb @@ -18,7 +18,7 @@ class CommentGroupPluginTest < ActiveSupport::TestCase end should 'have a js file' do - assert !plugin.js_files.blank? + refute plugin.js_files.blank? end should 'have stylesheet' do diff --git a/plugins/community_track/test/functional/community_track_plugin_public_controller_test.rb b/plugins/community_track/test/functional/community_track_plugin_public_controller_test.rb index a6ad411..9beb346 100644 --- a/plugins/community_track/test/functional/community_track_plugin_public_controller_test.rb +++ b/plugins/community_track/test/functional/community_track_plugin_public_controller_test.rb @@ -52,7 +52,7 @@ class CommunityTrackPluginPublicControllerTest < ActionController::TestCase should 'do not show more link in all tracks if there is no more tracks to show' do CommunityTrackPlugin::Track.destroy_all get :all_tracks, :id => @block.id - assert !assigns['show_more'] + refute assigns['show_more'] assert_no_match /track_list_more_#{@block.id}/, @response.body end diff --git a/plugins/community_track/test/unit/article_test.rb b/plugins/community_track/test/unit/article_test.rb index 443e24e..004298c 100644 --- a/plugins/community_track/test/unit/article_test.rb +++ b/plugins/community_track/test/unit/article_test.rb @@ -18,7 +18,7 @@ class ArticleTest < ActiveSupport::TestCase should 'do nothing if parent is not a step' do folder = fast_create(Folder, :profile_id => @profile.id) article = Article.create!(:parent => folder, :profile => @profile, :accept_comments => false, :name => "article") - assert !article.accept_comments + refute article.accept_comments end end diff --git a/plugins/community_track/test/unit/community_track_plugin/step_test.rb b/plugins/community_track/test/unit/community_track_plugin/step_test.rb index 3414ab4..db74dc2 100644 --- a/plugins/community_track/test/unit/community_track_plugin/step_test.rb +++ b/plugins/community_track/test/unit/community_track_plugin/step_test.rb @@ -24,20 +24,20 @@ class StepTest < ActiveSupport::TestCase should 'set accept_comments to false on create' do today = Date.today step = CommunityTrackPlugin::Step.create(:name => 'Step', :body => 'body', :profile => @profile, :parent => @track, :start_date => today, :end_date => today, :published => true) - assert !step.accept_comments + refute step.accept_comments end should 'do not allow step creation with a parent that is not a track' do today = Date.today blog = fast_create(Blog) step = CommunityTrackPlugin::Step.new(:name => 'Step', :body => 'body', :profile => @profile, :parent => blog, :start_date => today, :end_date => today, :published => true) - assert !step.save + refute step.save end should 'do not allow step creation without a parent' do today = Date.today step = CommunityTrackPlugin::Step.new(:name => 'Step', :body => 'body', :profile => @profile, :parent => nil, :start_date => today, :end_date => today, :published => true) - assert !step.save + refute step.save end should 'create step if end date is equal to start date' do @@ -55,7 +55,7 @@ class StepTest < ActiveSupport::TestCase should 'do not create step if end date is before start date' do @step.start_date = Date.today @step.end_date = Date.today - 1.day - assert !@step.save + refute @step.save end should 'do not validate date period if start date is nil' do @@ -146,7 +146,7 @@ class StepTest < ActiveSupport::TestCase end should 'set position on save' do - assert !@step.position + refute @step.position @step.save! assert_equal 1, @step.position 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 should 'accept comments if step is active' do @step.start_date = Date.today @step.save! - assert !@step.accept_comments + refute @step.accept_comments @step.toggle_activation @step.reload assert @step.accept_comments @@ -167,10 +167,10 @@ class StepTest < ActiveSupport::TestCase @step.start_date = Date.today + 2.days @step.end_date = Date.today + 3.days @step.save! - assert !@step.published + refute @step.published @step.toggle_activation @step.reload - assert !@step.published + refute @step.published end should 'do not accept comments if step is not active anymore' do @@ -185,7 +185,7 @@ class StepTest < ActiveSupport::TestCase @step.save! @step.toggle_activation @step.reload - assert !@step.accept_comments + refute @step.accept_comments end should 'set position to zero if step is hidden' do @@ -228,10 +228,10 @@ class StepTest < ActiveSupport::TestCase @step.start_date = Date.today @step.hidden = true @step.save! - assert !@step.published + refute @step.published @step.toggle_activation @step.reload - assert !@step.published + refute @step.published end should 'return enabled tools for a step' do @@ -268,9 +268,9 @@ class StepTest < ActiveSupport::TestCase should 'enable comments on children when step is activated' do @step.start_date = Date.today @step.save! - assert !@step.accept_comments + refute @step.accept_comments article = fast_create(Article, :parent_id => @step.id, :profile_id => @step.profile.id, :accept_comments => false) - assert !article.accept_comments + refute article.accept_comments @step.toggle_activation assert article.reload.accept_comments end @@ -279,7 +279,7 @@ class StepTest < ActiveSupport::TestCase @step.start_date = Date.today @step.start_date = Date.today @step.save! - assert !@step.accept_comments + refute @step.accept_comments @step.toggle_activation article = Article.create!(:parent => @step, :profile => @step.profile, :accept_comments => false, :name => "article") assert article.reload.accept_comments diff --git a/plugins/community_track/test/unit/community_track_plugin/track_list_block_test.rb b/plugins/community_track/test/unit/community_track_plugin/track_list_block_test.rb index 498dd71..8ce64c2 100644 --- a/plugins/community_track/test/unit/community_track_plugin/track_list_block_test.rb +++ b/plugins/community_track/test/unit/community_track_plugin/track_list_block_test.rb @@ -20,7 +20,7 @@ class TrackListBlockTest < ActiveSupport::TestCase end should 'load more at another page default to false' do - assert !@block.more_another_page + refute @block.more_another_page end should 'list articles only of track type' do @@ -41,7 +41,7 @@ class TrackListBlockTest < ActiveSupport::TestCase should 'do not return more link if there is no more tracks to show' do (@block.limit-1).times { |i| create_track("track#{i}", profile) } - assert !@block.footer + refute @block.footer end should 'count all tracks' do @@ -58,7 +58,7 @@ class TrackListBlockTest < ActiveSupport::TestCase @block.owner.articles.destroy_all (@block.limit+1).times { |i| create_track("track#{i}", profile) } assert @block.has_page?(2) - assert !@block.has_page?(3) + refute @block.has_page?(3) end should 'filter tracks by category' do @@ -95,8 +95,8 @@ class TrackListBlockTest < ActiveSupport::TestCase should 'define expiration condition' do condition = CommunityTrackPlugin::TrackListBlock.expire_on - assert !condition[:profile].empty? - assert !condition[:environment].empty? + refute condition[:profile].empty? + refute condition[:environment].empty? end should 'return track list block categories' do diff --git a/plugins/community_track/test/unit/community_track_plugin_test.rb b/plugins/community_track/test/unit/community_track_plugin_test.rb index d0c0beb..90f935d 100644 --- a/plugins/community_track/test/unit/community_track_plugin_test.rb +++ b/plugins/community_track/test/unit/community_track_plugin_test.rb @@ -74,8 +74,8 @@ class CommunityTrackPluginTest < ActiveSupport::TestCase end should 'return false at content_remove_new if page is not a track' do - assert !@plugin.content_remove_new(CommunityTrackPlugin::Step.new) - assert !@plugin.content_remove_new(Article.new) + refute @plugin.content_remove_new(CommunityTrackPlugin::Step.new) + refute @plugin.content_remove_new(Article.new) end end diff --git a/plugins/container_block/test/unit/container_block_plugin/container_block_test.rb b/plugins/container_block/test/unit/container_block_plugin/container_block_test.rb index 321fb33..01484d7 100644 --- a/plugins/container_block/test/unit/container_block_plugin/container_block_test.rb +++ b/plugins/container_block/test/unit/container_block_plugin/container_block_test.rb @@ -8,11 +8,11 @@ class ContainerBlockPlugin::ContainerBlockTest < ActiveSupport::TestCase end should 'describe yourself' do - assert !ContainerBlockPlugin::ContainerBlock.description.blank? + refute ContainerBlockPlugin::ContainerBlock.description.blank? end should 'has a help' do - assert !@block.help.blank? + refute @block.help.blank? end should 'create a box on save' do @@ -84,7 +84,7 @@ class ContainerBlockPlugin::ContainerBlockTest < ActiveSupport::TestCase @block.save! child = Block.create!(:box_id => @block.container_box.id) @block.destroy - assert !Block.exists?(child.id) + refute Block.exists?(child.id) end should 'destroy box when container is removed' do diff --git a/plugins/container_block/test/unit/container_block_plugin_test.rb b/plugins/container_block/test/unit/container_block_plugin_test.rb index 5eda25b..7c3f5ad 100644 --- a/plugins/container_block/test/unit/container_block_plugin_test.rb +++ b/plugins/container_block/test/unit/container_block_plugin_test.rb @@ -7,11 +7,11 @@ class ContainerBlockPluginTest < ActiveSupport::TestCase end should 'has a name' do - assert !ContainerBlockPlugin.plugin_name.blank? + refute ContainerBlockPlugin.plugin_name.blank? end should 'has a description' do - assert !ContainerBlockPlugin.plugin_description.blank? + refute ContainerBlockPlugin.plugin_description.blank? end should 'add a block' do diff --git a/plugins/context_content/test/functional/profile_design_controller_test.rb b/plugins/context_content/test/functional/profile_design_controller_test.rb index 2345c21..d159c1a 100644 --- a/plugins/context_content/test/functional/profile_design_controller_test.rb +++ b/plugins/context_content/test/functional/profile_design_controller_test.rb @@ -47,7 +47,7 @@ class ProfileDesignControllerTest < ActionController::TestCase 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 @block.reload assert_equal 'context', @block.title - assert !@block.show_image && !@block.show_name && !@block.show_parent_content + refute @block.show_image && !@block.show_name && !@block.show_parent_content assert_equal ['TinyMceArticle', 'Folder'], @block.types end diff --git a/plugins/context_content/test/unit/context_content_block_test.rb b/plugins/context_content/test/unit/context_content_block_test.rb index 1ecfa62..b28c38b 100644 --- a/plugins/context_content/test/unit/context_content_block_test.rb +++ b/plugins/context_content/test/unit/context_content_block_test.rb @@ -175,7 +175,7 @@ class ContextContentBlockTest < ActiveSupport::TestCase end should 'not be cacheable' do - assert !@block.cacheable? + refute @block.cacheable? end end diff --git a/plugins/custom_forms/test/functional/custom_forms_plugin_myprofile_controller_test.rb b/plugins/custom_forms/test/functional/custom_forms_plugin_myprofile_controller_test.rb index 892c150..023210e 100644 --- a/plugins/custom_forms/test/functional/custom_forms_plugin_myprofile_controller_test.rb +++ b/plugins/custom_forms/test/functional/custom_forms_plugin_myprofile_controller_test.rb @@ -34,7 +34,7 @@ class CustomFormsPluginMyprofileControllerTest < ActionController::TestCase form = CustomFormsPlugin::Form.create!(:profile => profile, :name => 'Free Software') assert CustomFormsPlugin::Form.exists?(form.id) post :remove, :profile => profile.identifier, :id => form.id - assert !CustomFormsPlugin::Form.exists?(form.id) + refute CustomFormsPlugin::Form.exists?(form.id) end should 'create a form' do diff --git a/plugins/custom_forms/test/functional/custom_forms_plugin_profile_controller_test.rb b/plugins/custom_forms/test/functional/custom_forms_plugin_profile_controller_test.rb index d6976b0..2d6715e 100644 --- a/plugins/custom_forms/test/functional/custom_forms_plugin_profile_controller_test.rb +++ b/plugins/custom_forms/test/functional/custom_forms_plugin_profile_controller_test.rb @@ -25,7 +25,7 @@ class CustomFormsPluginProfileControllerTest < ActionController::TestCase assert_difference 'CustomFormsPlugin::Submission.count', 1 do post :show, :profile => profile.identifier, :id => form.id, :submission => {field1.id.to_s => 'Noosfero', field2.id.to_s => 'GPL'} end - assert !session[:notice].include?('not saved') + refute session[:notice].include?('not saved') assert_redirected_to :action => 'show' end diff --git a/plugins/custom_forms/test/unit/custom_forms_plugin/answer_test.rb b/plugins/custom_forms/test/unit/custom_forms_plugin/answer_test.rb index 273f132..d00bc5d 100644 --- a/plugins/custom_forms/test/unit/custom_forms_plugin/answer_test.rb +++ b/plugins/custom_forms/test/unit/custom_forms_plugin/answer_test.rb @@ -10,7 +10,7 @@ class CustomFormsPlugin::AnswerTest < ActiveSupport::TestCase field = CustomFormsPlugin::Field.create!(:name => 'License', :form => form) answer.field = field answer.valid? - assert !answer.errors.include?(:field) + refute answer.errors.include?(:field) end should 'belong to a submission' do @@ -31,7 +31,7 @@ class CustomFormsPlugin::AnswerTest < ActiveSupport::TestCase answer.value = "GPL" answer.valid? - assert !answer.errors.include?(:value) + refute answer.errors.include?(:value) end should 'make string representation show answers' do diff --git a/plugins/custom_forms/test/unit/custom_forms_plugin/field_test.rb b/plugins/custom_forms/test/unit/custom_forms_plugin/field_test.rb index c1849f1..acff92f 100644 --- a/plugins/custom_forms/test/unit/custom_forms_plugin/field_test.rb +++ b/plugins/custom_forms/test/unit/custom_forms_plugin/field_test.rb @@ -9,7 +9,7 @@ class CustomFormsPlugin::FieldTest < ActiveSupport::TestCase should 'set mandatory field as false by default' do field = CustomFormsPlugin::Field.new - assert !field.mandatory + refute field.mandatory end should 'have answers' do @@ -47,7 +47,7 @@ class CustomFormsPlugin::FieldTest < ActiveSupport::TestCase should 'have alternative if type is SelectField' do select = CustomFormsPlugin::Field.new(:name => 'select_field001', :type => 'CustomFormsPlugin::SelectField') - assert !select.save + refute select.save select.alternatives << CustomFormsPlugin::Alternative.new(:label => 'option') assert select.save diff --git a/plugins/custom_forms/test/unit/custom_forms_plugin/form_test.rb b/plugins/custom_forms/test/unit/custom_forms_plugin/form_test.rb index 74f81c3..c33a101 100644 --- a/plugins/custom_forms/test/unit/custom_forms_plugin/form_test.rb +++ b/plugins/custom_forms/test/unit/custom_forms_plugin/form_test.rb @@ -10,8 +10,8 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase form.profile = fast_create(Profile) form.name = 'Free Software' form.valid? - assert !form.errors.include?(:profile) - assert !form.errors.include?(:name) + refute form.errors.include?(:profile) + refute form.errors.include?(:name) end should 'have many fields including fields subclasses' do @@ -50,7 +50,7 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase form.profile = another_profile form.valid? - assert !form.errors.include?(:slug) + refute form.errors.include?(:slug) end should 'validate the difference between ending and beginning is positive' do @@ -60,55 +60,55 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase form.begining = Time.now form.ending = Time.now + 1.day assert form.valid? - assert !form.errors.include?(:base) + refute form.errors.include?(:base) form.ending = Time.now - 2.day - assert !form.valid? + refute form.valid? assert form.errors.include?(:base) end should 'define form expiration' do form = CustomFormsPlugin::Form.new - assert !form.expired? + refute form.expired? form.begining = Time.now + 1.day assert form.expired? form.begining = Time.now - 1.day - assert !form.expired? + refute form.expired? form.begining = nil form.ending = Time.now + 1.day - assert !form.expired? + refute form.expired? form.ending = Time.now - 1.day assert form.expired? form.begining = Time.now - 1.day form.ending = Time.now + 1.day - assert !form.expired? + refute form.expired? end should 'define if form will still open' do form = CustomFormsPlugin::Form.new - assert !form.will_open? + refute form.will_open? form.begining = Time.now + 1.day assert form.will_open? form.begining = Time.now - 1.day - assert !form.will_open? + refute form.will_open? form.begining = Time.now - 2.day form.ending = Time.now - 1.day assert form.expired? - assert !form.will_open? + refute form.will_open? end should 'validates format of access' do form = CustomFormsPlugin::Form.new form.valid? - assert !form.errors.include?(:access) + refute form.errors.include?(:access) form.access = 'bli' form.valid? @@ -116,11 +116,11 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase form.access = 'logged' form.valid? - assert !form.errors.include?(:access) + refute form.errors.include?(:access) form.access = 'associated' form.valid? - assert !form.errors.include?(:access) + refute form.errors.include?(:access) form.access = {:bli => 1} form.valid? @@ -133,13 +133,13 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase p1 = fast_create(Profile) form.access = p1.id form.valid? - assert !form.errors.include?(:access) + refute form.errors.include?(:access) p2 = fast_create(Profile) p3 = fast_create(Profile) form.access = [p1,p2,p3].map(&:id) form.valid? - assert !form.errors.include?(:access) + refute form.errors.include?(:access) end should 'defines who is able to access the form' do @@ -148,25 +148,25 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase assert form.accessible_to(nil) form.access = 'logged' - assert !form.accessible_to(nil) + refute form.accessible_to(nil) person = fast_create(Person) assert form.accessible_to(person) form.access = 'associated' - assert !form.accessible_to(person) + refute form.accessible_to(person) owner.add_member(person) assert form.accessible_to(person) p1 = fast_create(Profile) form.access = p1.id - assert !form.accessible_to(person) + refute form.accessible_to(person) assert form.accessible_to(p1) p2 = fast_create(Profile) form.access = [person.id, p1.id] assert form.accessible_to(person) assert form.accessible_to(p1) - assert !form.accessible_to(p2) + refute form.accessible_to(p2) form.access << p2.id assert form.accessible_to(p2) diff --git a/plugins/custom_forms/test/unit/custom_forms_plugin/membership_survey_test.rb b/plugins/custom_forms/test/unit/custom_forms_plugin/membership_survey_test.rb index 00e3713..7b648e9 100644 --- a/plugins/custom_forms/test/unit/custom_forms_plugin/membership_survey_test.rb +++ b/plugins/custom_forms/test/unit/custom_forms_plugin/membership_survey_test.rb @@ -8,7 +8,7 @@ class CustomFormsPlugin::MembershipSurveyTest < ActiveSupport::TestCase task.form_id = 1 task.valid? - assert !task.errors.include?(:form_id) + refute task.errors.include?(:form_id) end should 'create submission with answers on perform' do diff --git a/plugins/custom_forms/test/unit/custom_forms_plugin/select_field_test.rb b/plugins/custom_forms/test/unit/custom_forms_plugin/select_field_test.rb index efd7b62..217b382 100644 --- a/plugins/custom_forms/test/unit/custom_forms_plugin/select_field_test.rb +++ b/plugins/custom_forms/test/unit/custom_forms_plugin/select_field_test.rb @@ -3,7 +3,7 @@ require File.dirname(__FILE__) + '/../../../../../test/test_helper' class CustomFormsPlugin::SelectFieldTest < ActiveSupport::TestCase should 'have alternative' do select = CustomFormsPlugin::SelectField.new(:name => 'select_field001' ) - assert !select.save + refute select.save select.alternatives << CustomFormsPlugin::Alternative.new(:label => 'option') assert select.save diff --git a/plugins/custom_forms/test/unit/custom_forms_plugin/submission_test.rb b/plugins/custom_forms/test/unit/custom_forms_plugin/submission_test.rb index 3a9122d..cda3cc6 100644 --- a/plugins/custom_forms/test/unit/custom_forms_plugin/submission_test.rb +++ b/plugins/custom_forms/test/unit/custom_forms_plugin/submission_test.rb @@ -14,7 +14,7 @@ class CustomFormsPlugin::SubmissionTest < ActiveSupport::TestCase form = CustomFormsPlugin::Form.create!(:name => 'Free Software', :profile => profile) submission.form = form submission.valid? - assert !submission.errors.include?(:form) + refute submission.errors.include?(:form) end should 'belong to a profile' do @@ -32,8 +32,8 @@ class CustomFormsPlugin::SubmissionTest < ActiveSupport::TestCase submission.author_name = 'Jack Sparrow' submission.author_email = 'jack@black-pearl.com' submission.valid? - assert !submission.errors.include?(:author_name) - assert !submission.errors.include?(:author_email) + refute submission.errors.include?(:author_name) + refute submission.errors.include?(:author_email) end should 'have answers' do diff --git a/plugins/custom_forms/test/unit/ext/role_assingment_test.rb b/plugins/custom_forms/test/unit/ext/role_assingment_test.rb index 5d2fbec..e506bdb 100644 --- a/plugins/custom_forms/test/unit/ext/role_assingment_test.rb +++ b/plugins/custom_forms/test/unit/ext/role_assingment_test.rb @@ -67,6 +67,6 @@ class RoleAssignmentsTest < ActiveSupport::TestCase assert_difference 'CustomFormsPlugin::AdmissionSurvey.count', 2 do organization.add_member(person) end - assert !organization.members.include?(person) + refute organization.members.include?(person) end end diff --git a/plugins/event/test/unit/event_block_test.rb b/plugins/event/test/unit/event_block_test.rb index a09775e..cae424a 100644 --- a/plugins/event/test/unit/event_block_test.rb +++ b/plugins/event/test/unit/event_block_test.rb @@ -169,11 +169,11 @@ class EventBlockTest < ActiveSupport::TestCase @block.all_env_events = true # Do not list event from private profile for non logged visitor - assert ! @block.events.include?(ev) + refute @block.events.include?(ev) assert_equal 4, @block.events.length # Do not list event from private profile for non unprivileged user - assert ! @block.events.include?(ev) + refute @block.events.include?(ev) assert_equal 4, @block.events(@p1).length # Must to list event from private profile for a friend diff --git a/plugins/lattes_curriculum/test/unit/academic_info_test.rb b/plugins/lattes_curriculum/test/unit/academic_info_test.rb index 415feb1..0e5b1d3 100644 --- a/plugins/lattes_curriculum/test/unit/academic_info_test.rb +++ b/plugins/lattes_curriculum/test/unit/academic_info_test.rb @@ -8,7 +8,7 @@ class AcademicInfoTest < ActiveSupport::TestCase should 'not ve invalid lattes url' do @academic_info.lattes_url = "http://softwarelivre.org/" - assert !@academic_info.save + refute @academic_info.save end should 'accept blank lattes url' do diff --git a/plugins/ldap/test/unit/ext/environment_test.rb b/plugins/ldap/test/unit/ext/environment_test.rb index 858b5f6..cc1f580 100644 --- a/plugins/ldap/test/unit/ext/environment_test.rb +++ b/plugins/ldap/test/unit/ext/environment_test.rb @@ -130,7 +130,7 @@ class EnvironmentTest < ActiveSupport::TestCase should 'ldap_plugin_onthefly_register return false if ldap onthefly_register variable is defined as false' do value = '0' @enviroment.ldap_plugin_onthefly_register= value - assert !@enviroment.ldap_plugin_onthefly_register + refute @enviroment.ldap_plugin_onthefly_register end should 'ldap_plugin_filter= define the ldap filter' do @@ -160,7 +160,7 @@ class EnvironmentTest < ActiveSupport::TestCase should 'tls return false if ldap tls variable is defined as false' do value = '0' @enviroment.ldap_plugin_tls= value - assert !@enviroment.ldap_plugin_tls + refute @enviroment.ldap_plugin_tls end should 'validates presence of host' do @@ -171,12 +171,12 @@ class EnvironmentTest < ActiveSupport::TestCase @enviroment.ldap_plugin_host= "http://somehost.com" @enviroment.valid? - assert !@enviroment.errors.include?(:ldap_plugin_host) + refute @enviroment.errors.include?(:ldap_plugin_host) end should 'validates presence of host only if some ldap configuration is defined' do @enviroment.valid? - assert !@enviroment.errors.include?(:ldap_plugin_host) + refute @enviroment.errors.include?(:ldap_plugin_host) @enviroment.ldap_plugin= {:port => 3000} @enviroment.valid? diff --git a/plugins/ldap/test/unit/ldap_authentication_test.rb b/plugins/ldap/test/unit/ldap_authentication_test.rb index a94852b..783f0e7 100644 --- a/plugins/ldap/test/unit/ldap_authentication_test.rb +++ b/plugins/ldap/test/unit/ldap_authentication_test.rb @@ -96,7 +96,7 @@ class LdapAuthenticationTest < ActiveSupport::TestCase should "onthefly_register be false as default" do ldap = LdapAuthentication.new - assert !ldap.onthefly_register + refute ldap.onthefly_register end should "create with onthefly_register passed as parameter" do @@ -118,7 +118,7 @@ class LdapAuthenticationTest < ActiveSupport::TestCase should "tls be false as default" do ldap = LdapAuthentication.new - assert !ldap.tls + refute ldap.tls end should "create with tls passed as parameter" do @@ -134,7 +134,7 @@ class LdapAuthenticationTest < ActiveSupport::TestCase should "onthefly_register? return false if onthefly_register is false" do ldap = LdapAuthentication.new('onthefly_register' => false) - assert !ldap.onthefly_register? + refute ldap.onthefly_register? end if ldap_configured? diff --git a/plugins/ldap/test/unit/ldap_plugin_test.rb b/plugins/ldap/test/unit/ldap_plugin_test.rb index e4d0ff7..aa1d3c3 100644 --- a/plugins/ldap/test/unit/ldap_plugin_test.rb +++ b/plugins/ldap/test/unit/ldap_plugin_test.rb @@ -4,12 +4,12 @@ class LdapPluginTest < ActiveSupport::TestCase should "not allow user registration" do plugin = LdapPlugin.new - assert !plugin.allow_user_registration + refute plugin.allow_user_registration end should "not allow password recovery" do plugin = LdapPlugin.new - assert !plugin.allow_password_recovery + refute plugin.allow_password_recovery end end diff --git a/plugins/mark_comment_as_read/test/unit/mark_comment_as_read_plugin/comment_test.rb b/plugins/mark_comment_as_read/test/unit/mark_comment_as_read_plugin/comment_test.rb index a17902b..238dac4 100644 --- a/plugins/mark_comment_as_read/test/unit/mark_comment_as_read_plugin/comment_test.rb +++ b/plugins/mark_comment_as_read/test/unit/mark_comment_as_read_plugin/comment_test.rb @@ -9,7 +9,7 @@ class MarkCommentAsReadPlugin::CommentTest < ActiveSupport::TestCase end should 'mark comment as read' do - assert !@comment.marked_as_read?(@person) + refute @comment.marked_as_read?(@person) @comment.mark_as_read(@person) assert @comment.marked_as_read?(@person) end @@ -25,7 +25,7 @@ class MarkCommentAsReadPlugin::CommentTest < ActiveSupport::TestCase @comment.mark_as_read(@person) assert @comment.marked_as_read?(@person) @comment.mark_as_not_read(@person) - assert !@comment.marked_as_read?(@person) + refute @comment.marked_as_read?(@person) end should 'return comments marked as read for a user' do diff --git a/plugins/mark_comment_as_read/test/unit/mark_comment_as_read_test.rb b/plugins/mark_comment_as_read/test/unit/mark_comment_as_read_test.rb index 5a1c8fd..cc91203 100644 --- a/plugins/mark_comment_as_read/test/unit/mark_comment_as_read_test.rb +++ b/plugins/mark_comment_as_read/test/unit/mark_comment_as_read_test.rb @@ -26,7 +26,7 @@ class MarkCommentAsReadPluginTest < ActiveSupport::TestCase self.stubs(:user).returns(nil) action = @plugin.comment_actions(@comment) link = self.instance_eval(&action) - assert !link + refute link end should 'return actions when comment is not read' do @@ -46,7 +46,7 @@ class MarkCommentAsReadPluginTest < ActiveSupport::TestCase self.stubs(:user).returns(nil) action = @plugin.check_comment_actions(@comment) id = self.instance_eval(&action) - assert !id + refute id end should 'return id of mark as not read link when comment is read' do @@ -70,14 +70,14 @@ class MarkCommentAsReadPluginTest < ActiveSupport::TestCase should 'do not return extra content if comment is not marked as read' do content = @plugin.article_extra_contents(@article) - assert !self.instance_eval(&content) + refute self.instance_eval(&content) end should 'do not return extra content if user is not logged in' do @comment.mark_as_read(@person) self.stubs(:user).returns(nil) content = @plugin.article_extra_contents(@article) - assert !self.instance_eval(&content) + refute self.instance_eval(&content) end def link_to_function(content, url, options = {}) diff --git a/plugins/oauth_client/test/unit/user_test.rb b/plugins/oauth_client/test/unit/user_test.rb index f4bda17..1528a79 100644 --- a/plugins/oauth_client/test/unit/user_test.rb +++ b/plugins/oauth_client/test/unit/user_test.rb @@ -24,12 +24,12 @@ class UserTest < ActiveSupport::TestCase should 'not activate user when created without oauth' do user = fast_create(User) - assert !user.activated? + refute user.activated? end should 'not make activation code when created with oauth' do user = User.create!(:email => 'testoauth@example.com', :login => 'testoauth', :oauth_providers => [provider]) - assert !user.activation_code + refute user.activation_code end should 'make activation code when created without oauth' do diff --git a/plugins/people_block/test/unit/people_block_plugin_test.rb b/plugins/people_block/test/unit/people_block_plugin_test.rb index 1c84109..2fa991f 100644 --- a/plugins/people_block/test/unit/people_block_plugin_test.rb +++ b/plugins/people_block/test/unit/people_block_plugin_test.rb @@ -15,7 +15,7 @@ class PeopleBlockPluginTest < ActiveSupport::TestCase end should "return false for class method has_admin_url?" do - assert !PeopleBlockPlugin.has_admin_url? + refute PeopleBlockPlugin.has_admin_url? end should "return false for class method stylesheet?" do diff --git a/plugins/recent_content/test/unit/recent_content_block_test.rb b/plugins/recent_content/test/unit/recent_content_block_test.rb index 3f5026f..b60eea5 100644 --- a/plugins/recent_content/test/unit/recent_content_block_test.rb +++ b/plugins/recent_content/test/unit/recent_content_block_test.rb @@ -15,7 +15,7 @@ class RecentContentBlockTest < ActiveSupport::TestCase should 'blog_picture be false by default' do block = RecentContentBlock.new - assert !block.show_blog_picture + refute block.show_blog_picture end should 'blog_picture is being stored and restored from database as true' do @@ -33,7 +33,7 @@ class RecentContentBlockTest < ActiveSupport::TestCase block.save block.reload - assert !block.show_blog_picture + refute block.show_blog_picture end should 'root be nil for new blocks' do diff --git a/plugins/require_auth_to_comment/test/unit/require_auth_to_comment_plugin_test.rb b/plugins/require_auth_to_comment/test/unit/require_auth_to_comment_plugin_test.rb index 7f5dcd7..4b38b0c 100644 --- a/plugins/require_auth_to_comment/test/unit/require_auth_to_comment_plugin_test.rb +++ b/plugins/require_auth_to_comment/test/unit/require_auth_to_comment_plugin_test.rb @@ -19,7 +19,7 @@ class RequireAuthToCommentPluginTest < ActiveSupport::TestCase should 'allow comments from authenticated users' do plugin.context = logged_in(true) plugin.filter_comment(comment) - assert !comment.rejected? + refute comment.rejected? end should 'allow comments from unauthenticated users if allowed by profile' do @@ -27,7 +27,7 @@ class RequireAuthToCommentPluginTest < ActiveSupport::TestCase plugin.context.profile.allow_unauthenticated_comments = true plugin.filter_comment(comment) - assert !comment.rejected? + refute comment.rejected? end should 'the default require type setting be hide_button' do @@ -38,7 +38,7 @@ class RequireAuthToCommentPluginTest < ActiveSupport::TestCase context = mock(); context.expects(:environment).returns(environment) plugin.expects(:context).returns(context) - assert !plugin.display_login_popup? + refute plugin.display_login_popup? end should 'display_login_popup? be true if require_type is defined as display_login_popup' do @@ -51,7 +51,7 @@ class RequireAuthToCommentPluginTest < ActiveSupport::TestCase should 'not display stylesheet if login popup is active' do plugin.expects(:display_login_popup?).returns(true) - assert !plugin.stylesheet? + refute plugin.stylesheet? end should 'display stylesheet if login popup is inactive' do diff --git a/plugins/send_email/test/unit/send_email_plugin_mail_test.rb b/plugins/send_email/test/unit/send_email_plugin_mail_test.rb index ca54a31..8522a1d 100644 --- a/plugins/send_email/test/unit/send_email_plugin_mail_test.rb +++ b/plugins/send_email/test/unit/send_email_plugin_mail_test.rb @@ -14,17 +14,17 @@ class SendEmailPluginMailTest < ActiveSupport::TestCase should 'requires to field' do mail = SendEmailPlugin::Mail.new(:subject => 'Hi', :message => 'Hi john', :environment => @environment) - assert !mail.valid? + refute mail.valid? end should 'require message field' do mail = SendEmailPlugin::Mail.new(:subject => 'Hi', :to => 'john@example.com', :environment => @environment) - assert !mail.valid? + refute mail.valid? end should 'require environment field' do mail = SendEmailPlugin::Mail.new(:subject => 'Hi', :to => 'john@example.com', :message => 'Hi john') - assert !mail.valid? + refute mail.valid? end should 'have a default subject' do @@ -34,18 +34,18 @@ class SendEmailPluginMailTest < ActiveSupport::TestCase should 'not accept invalid email address' do mail = SendEmailPlugin::Mail.new(:subject => 'Hi', :message => 'Hi john', :to => 'invalid-mail-address', :environment => @environment) - assert !mail.valid? + refute mail.valid? end should 'not accept email that is not in allowed address list' do mail = SendEmailPlugin::Mail.new(:subject => 'Hi', :message => 'Hi john', :to => 'unknow@example.com', :environment => @environment) - assert !mail.valid? + refute mail.valid? end should 'discard some keys on set params hash' do mail = SendEmailPlugin::Mail.new(:params => {:action => 1, :controller => 2, :to => 3, :message => 4, :subject => 5, :age => 6}) [:params].each do |k| - assert !mail.params.include?(k) + refute mail.params.include?(k) end assert mail.params.include?(:age) end @@ -57,7 +57,7 @@ class SendEmailPluginMailTest < ActiveSupport::TestCase should "invalid if just one listed in 'to' list was not allowed" do mail = SendEmailPlugin::Mail.new(:subject => 'Hi', :message => 'Hi john', :to => 'john@example.com,notallowed@example.com,someother@example.com', :environment => @environment) - assert !mail.valid? + refute mail.valid? end end diff --git a/plugins/shopping_cart/test/functional/shopping_cart_plugin_controller_test.rb b/plugins/shopping_cart/test/functional/shopping_cart_plugin_controller_test.rb index 0d465cd..eb5f374 100644 --- a/plugins/shopping_cart/test/functional/shopping_cart_plugin_controller_test.rb +++ b/plugins/shopping_cart/test/functional/shopping_cart_plugin_controller_test.rb @@ -40,8 +40,8 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase should 'not add product to cart if it does not exists' do assert_nothing_raised { get :add, :id => 9999 } - assert !product_in_cart?(product) - assert !response_ok? + refute product_in_cart?(product) + refute response_ok? assert_equal 3, reponse_error_code end @@ -50,15 +50,15 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase assert cart? get :remove, :id => product.id - assert !cart? + refute cart? end should 'not try to remove a product if there is no cart' do instantiate_cart - assert !cart? + refute cart? assert_nothing_raised { get :remove, :id => 9999 } - assert !response_ok? + refute response_ok? assert_equal 2, reponse_error_code end @@ -69,7 +69,7 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase get :remove, :id => product.id assert cart? - assert !product_in_cart?(product) + refute product_in_cart?(product) end should 'not try to remove a product that is not in the cart' do @@ -77,16 +77,16 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase assert cart? assert_nothing_raised { get :remove, :id => 9999 } - assert !response_ok? + refute response_ok? assert_equal 4, reponse_error_code end should 'not try to list the cart if there is no cart' do instantiate_cart - assert !cart? + refute cart? assert_nothing_raised { get :list } - assert !response_ok? + refute response_ok? assert_equal 2, reponse_error_code end @@ -107,10 +107,10 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase should 'not try to update quantity the quantity of a product if there is no cart' do instantiate_cart - assert !cart? + refute cart? assert_nothing_raised { get :update_quantity, :id => 9999, :quantity => 3 } - assert !response_ok? + refute response_ok? assert_equal 2, reponse_error_code end @@ -119,7 +119,7 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase assert cart? assert_nothing_raised { get :update_quantity, :id => 9999, :quantity => 3 } - assert !response_ok? + refute response_ok? assert_equal 4, reponse_error_code end @@ -127,11 +127,11 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase get :add, :id => product.id assert_nothing_raised { get :update_quantity, :id => product.id, :quantity => -1} - assert !response_ok? + refute response_ok? assert_equal 5, reponse_error_code assert_nothing_raised { get :update_quantity, :id => product.id, :quantity => 'asdf'} - assert !response_ok? + refute response_ok? assert_equal 5, reponse_error_code end @@ -141,12 +141,12 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase get :add, :id => another_product.id assert_nothing_raised { get :clean } - assert !cart? + refute cart? end should 'not crash if there is no cart' do instantiate_cart - assert !cart? + refute cart? assert_nothing_raised { get :clean } end @@ -185,12 +185,12 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase product1 = fast_create(Product, :profile_id => profile.id) post :add, :id => product1.id post :send_request, :customer => { :name => "Manuel", :email => "manuel@ceu.com" } - assert !cart?, "cart expected to be empty!" + refute cart?, "cart expected to be empty!" end should 'not allow buy without any cart' do get :buy - assert !json_response[:ok] + refute json_response[:ok] assert_equal 2, json_response['error']['code'] end diff --git a/plugins/shopping_cart/test/functional/shopping_cart_plugin_myprofile_controller_test.rb b/plugins/shopping_cart/test/functional/shopping_cart_plugin_myprofile_controller_test.rb index 27661d5..e16f51f 100644 --- a/plugins/shopping_cart/test/functional/shopping_cart_plugin_myprofile_controller_test.rb +++ b/plugins/shopping_cart/test/functional/shopping_cart_plugin_myprofile_controller_test.rb @@ -25,7 +25,7 @@ class ShoppingCartPluginMyprofileControllerTest < ActionController::TestCase settings.save! post :edit, :profile => profile.identifier, :settings => {:enabled => '0'} - assert !settings.enabled + refute settings.enabled end should 'be able to enable shopping cart delivery' do @@ -41,7 +41,7 @@ class ShoppingCartPluginMyprofileControllerTest < ActionController::TestCase settings.save! post :edit, :profile => profile.identifier, :settings => {:delivery => '0'} - assert !settings.delivery + refute settings.delivery end should 'be able to choose the delivery price' do diff --git a/plugins/shopping_cart/test/unit/shopping_cart_plugin_test.rb b/plugins/shopping_cart/test/unit/shopping_cart_plugin_test.rb index a2d8312..36e05b6 100644 --- a/plugins/shopping_cart/test/unit/shopping_cart_plugin_test.rb +++ b/plugins/shopping_cart/test/unit/shopping_cart_plugin_test.rb @@ -29,6 +29,6 @@ class ShoppingCartPluginTest < ActiveSupport::TestCase should 'be disabled by default on the enterprise' do profile = fast_create(Enterprise) settings = Noosfero::Plugin::Settings.new(profile, ShoppingCartPlugin) - assert !settings.enabled + refute settings.enabled end end diff --git a/plugins/solr/test/functional/search_controller_test.rb b/plugins/solr/test/functional/search_controller_test.rb index cf1f12f..6ac5b6e 100644 --- a/plugins/solr/test/functional/search_controller_test.rb +++ b/plugins/solr/test/functional/search_controller_test.rb @@ -51,7 +51,7 @@ class SearchControllerTest < ActionController::TestCase art.save! get 'articles', :query => 'article found' - assert !assigns(:searches)[:articles][:facets].blank? + refute assigns(:searches)[:articles][:facets].blank? assert assigns(:searches)[:articles][:facets]['facet_fields']['solr_plugin_f_type_facet'][0][0] == 'Article' assert assigns(:searches)[:articles][:facets]['facet_fields']['solr_plugin_f_profile_type_facet'][0][0] == 'Person' assert assigns(:searches)[:articles][:facets]['facet_fields']['solr_plugin_f_category_facet'][0][0] == 'cat1' @@ -69,7 +69,7 @@ class SearchControllerTest < ActionController::TestCase get 'people', :query => 'Hildebrando' - assert !assigns(:searches)[:people][:facets].blank? + refute assigns(:searches)[:people][:facets].blank? assert assigns(:searches)[:people][:facets]['facet_fields']['solr_plugin_f_region_facet'][0][0] == city.id.to_s categories_facet = assigns(:searches)[:people][:facets]['facet_fields']['solr_plugin_f_categories_facet'] @@ -89,7 +89,7 @@ class SearchControllerTest < ActionController::TestCase prod.save! get 'products', :query => 'Sound' - assert !assigns(:searches)[:products][:facets].blank? + refute assigns(:searches)[:products][:facets].blank? assert assigns(:searches)[:products][:facets]['facet_fields']['solr_plugin_f_category_facet'][0][0] == @product_category.name assert assigns(:searches)[:products][:facets]['facet_fields']['solr_plugin_f_region_facet'][0][0] == city.id.to_s assert assigns(:searches)[:products][:facets]['facet_fields']['solr_plugin_f_qualifier_facet'][0][0] == "#{qualifier1.id} 0" diff --git a/plugins/solr/test/unit/acts_as_faceted_test.rb b/plugins/solr/test/unit/acts_as_faceted_test.rb index 6d9cec4..5c92e91 100644 --- a/plugins/solr/test/unit/acts_as_faceted_test.rb +++ b/plugins/solr/test/unit/acts_as_faceted_test.rb @@ -69,7 +69,7 @@ class ActsAsFacetedTest < ActiveSupport::TestCase should 'show facets option for solr' do assert TestModel.facets_option_for_solr.include?(:f_type) - assert !TestModel.facets_option_for_solr.include?(:f_published_at) + refute TestModel.facets_option_for_solr.include?(:f_published_at) end should 'show facets fields for solr' do diff --git a/plugins/solr/test/unit/profile_test.rb b/plugins/solr/test/unit/profile_test.rb index 85809fe..0c8cf04 100644 --- a/plugins/solr/test/unit/profile_test.rb +++ b/plugins/solr/test/unit/profile_test.rb @@ -91,7 +91,7 @@ class ProfileTest < ActiveSupport::TestCase p = create(Profile, :name => 'wanted') assert Profile.find_by_contents('wanted')[:results].include?(p) - assert ! Profile.find_by_contents('not_wanted')[:results].include?(p) + refute Profile.find_by_contents('not_wanted')[:results].include?(p) end # This problem should be solved; talk to BrĂ¡ulio if it fails diff --git a/plugins/spaminator/test/functional/spaminator_plugin_admin_controller_test.rb b/plugins/spaminator/test/functional/spaminator_plugin_admin_controller_test.rb index 3a14446..6a27e99 100644 --- a/plugins/spaminator/test/functional/spaminator_plugin_admin_controller_test.rb +++ b/plugins/spaminator/test/functional/spaminator_plugin_admin_controller_test.rb @@ -38,7 +38,7 @@ class SpaminatorPluginAdminControllerTest < ActionController::TestCase get :withhold reload_settings - assert !settings.deployed + refute settings.deployed end should 'make spaminator scan' do @@ -70,7 +70,7 @@ class SpaminatorPluginAdminControllerTest < ActionController::TestCase reload_settings assert settings.scheduled_scan.nil? - assert !Delayed::Job.exists?(settings.scheduled_scan) + refute Delayed::Job.exists?(settings.scheduled_scan) end private diff --git a/plugins/spaminator/test/unit/spaminator_plugin/report_test.rb b/plugins/spaminator/test/unit/spaminator_plugin/report_test.rb index 353e127..cda125b 100644 --- a/plugins/spaminator/test/unit/spaminator_plugin/report_test.rb +++ b/plugins/spaminator/test/unit/spaminator_plugin/report_test.rb @@ -9,7 +9,7 @@ class SpaminatorPlugin::ReportTest < ActiveSupport::TestCase report.environment = Environment.default report.valid? - assert !report.errors.include?(:environment) + refute report.errors.include?(:environment) end should 'have scope of all reports from an environment' do diff --git a/plugins/spaminator/test/unit/spaminator_plugin/spaminator_test.rb b/plugins/spaminator/test/unit/spaminator_plugin/spaminator_test.rb index 095ccf3..2fff77c 100644 --- a/plugins/spaminator/test/unit/spaminator_plugin/spaminator_test.rb +++ b/plugins/spaminator/test/unit/spaminator_plugin/spaminator_test.rb @@ -87,7 +87,7 @@ class SpaminatorPlugin::SpaminatorTest < ActiveSupport::TestCase spaminator.send(:process_person_by_comments, person) assert_equal 0, report.spammers_by_comments - assert !person.abuser? + refute person.abuser? fast_create(Comment, :author_id => person, :spam => true) spaminator.send(:process_person_by_comments, person) @@ -107,17 +107,17 @@ class SpaminatorPlugin::SpaminatorTest < ActiveSupport::TestCase fast_create(Comment, :author_id => person) spaminator.send(:process_person_by_no_network, person) - assert !person.abuser? + refute person.abuser? assert_equal 0, report.spammers_by_no_network assert_equal 0, report.spams_by_no_network assert person.visible c1.remove_member(person) spaminator.send(:process_person_by_no_network, person) - assert !person.abuser? + refute person.abuser? assert_equal 1, report.spammers_by_no_network assert_equal 2, report.spams_by_no_network - assert !person.visible + refute person.visible end should 'mark person as spammer' do @@ -126,7 +126,7 @@ class SpaminatorPlugin::SpaminatorTest < ActiveSupport::TestCase spaminator.send(:mark_as_spammer, person) end person.reload - assert !person.visible + refute person.visible end should 'send email notification after disabling person' do diff --git a/plugins/statistics/test/unit/statistics_block_test.rb b/plugins/statistics/test/unit/statistics_block_test.rb index 96f34d9..12166b0 100644 --- a/plugins/statistics/test/unit/statistics_block_test.rb +++ b/plugins/statistics/test/unit/statistics_block_test.rb @@ -11,7 +11,7 @@ class StatisticsBlockTest < ActiveSupport::TestCase ['community_counter', 'enterprise_counter', 'product_counter', 'category_counter', 'hit_counter'].map do |counter| should "#{counter} be false by default" do b = StatisticsBlock.new - assert !b.is_visible?(counter) + refute b.is_visible?(counter) end end @@ -41,7 +41,7 @@ class StatisticsBlockTest < ActiveSupport::TestCase should 'is_visible? return false if setting is false' do b = StatisticsBlock.new b.community_counter = false - assert !b.is_visible?('community_counter') + refute b.is_visible?('community_counter') end should 'templates return the Community templates of the Environment' do @@ -349,7 +349,7 @@ class StatisticsBlockTest < ActiveSupport::TestCase should 'is_template_counter_active? return false if setting is false' do b = StatisticsBlock.new b.templates_ids_counter = {'1' => 'false'} - assert !b.is_template_counter_active?(1) + refute b.is_template_counter_active?(1) end should 'template_counter_count return the amount of communities of the Environment using a template' do diff --git a/plugins/stoa/test/functional/account_controller_test.rb b/plugins/stoa/test/functional/account_controller_test.rb index 9f85204..6564f5a 100644 --- a/plugins/stoa/test/functional/account_controller_test.rb +++ b/plugins/stoa/test/functional/account_controller_test.rb @@ -38,7 +38,7 @@ class AccountControllerTest < ActionController::TestCase should 'pass if confirmation value matches' do #StoaPlugin::UspUser.stubs(:matches?).returns(true) post :signup, :profile_data => {:usp_id => '12345678'}, :confirmation_field => 'cpf', :cpf => '12345678' - assert !assigns(:person).errors.include?(:usp_id) + refute assigns(:person).errors.include?(:usp_id) end should 'include invitation_code param in the person\'s attributes' do diff --git a/plugins/stoa/test/functional/stoa_plugin_controller_test.rb b/plugins/stoa/test/functional/stoa_plugin_controller_test.rb index e6959fa..55e199b 100644 --- a/plugins/stoa/test/functional/stoa_plugin_controller_test.rb +++ b/plugins/stoa/test/functional/stoa_plugin_controller_test.rb @@ -99,7 +99,7 @@ class StoaPluginControllerTest < ActionController::TestCase post :authenticate, :login => user.login, :password => '123456', :fields => 'special' - assert !json_response.keys.include?('f1') + refute json_response.keys.include?('f1') assert json_response.keys.include?('f2') assert json_response.keys.include?('f3') end @@ -153,7 +153,7 @@ class StoaPluginControllerTest < ActionController::TestCase usp_id = '87654321' StoaPlugin::UspUser.stubs(:exists?).with(usp_id).returns(false) get :check_usp_id, :usp_id => usp_id - assert !json_response['exists'] + refute json_response['exists'] end should 'check existent cpf' do @@ -176,7 +176,7 @@ class StoaPluginControllerTest < ActionController::TestCase user_with_cpf.stubs(:cpf).returns(nil) StoaPlugin::UspUser.stubs(:find_by_codpes).with(usp_id_without_cpf).returns(user_without_cpf) get :check_cpf, :usp_id => usp_id_without_cpf - assert !json_response['exists'] + refute json_response['exists'] end private diff --git a/plugins/stoa/test/unit/person_api_test.rb b/plugins/stoa/test/unit/person_api_test.rb index 76d14ef..88cd5fc 100644 --- a/plugins/stoa/test/unit/person_api_test.rb +++ b/plugins/stoa/test/unit/person_api_test.rb @@ -98,7 +98,7 @@ class StoaPlugin::PersonApiTest < ActiveSupport::TestCase create_article_with_tags(person.id, 'free_software') api = StoaPlugin::PersonApi.new(person) - assert !api.tags.has_key?('noosfero') + refute api.tags.has_key?('noosfero') end should 'provide communities' do diff --git a/plugins/stoa/test/unit/person_test.rb b/plugins/stoa/test/unit/person_test.rb index 348d5d2..3f36c30 100644 --- a/plugins/stoa/test/unit/person_test.rb +++ b/plugins/stoa/test/unit/person_test.rb @@ -33,12 +33,12 @@ class StoaPlugin::Person < ActiveSupport::TestCase Task.create!(:code => 12345678) person.invitation_code = 12345678 person.valid? - assert !person.errors.include?(:usp_id) + refute person.errors.include?(:usp_id) person.invitation_code = nil person.is_template = true person.valid? - assert !person.errors.include?(:usp_id) + refute person.errors.include?(:usp_id) end should 'allow multiple nil usp_id' do @@ -47,7 +47,7 @@ class StoaPlugin::Person < ActiveSupport::TestCase person = Person.new(:invitation_code => 87654321) person.valid? - assert !person.errors.include?(:usp_id) + refute person.errors.include?(:usp_id) end 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 t.finish person.valid? - assert !person.errors.include?(:usp_id) + refute person.errors.include?(:usp_id) end diff --git a/plugins/stoa/test/unit/usp_user_test.rb b/plugins/stoa/test/unit/usp_user_test.rb index 59626bc..070298b 100644 --- a/plugins/stoa/test/unit/usp_user_test.rb +++ b/plugins/stoa/test/unit/usp_user_test.rb @@ -21,19 +21,19 @@ class StoaPlugin::UspUserTest < ActiveSupport::TestCase should 'check existence of usp_id' do assert StoaPlugin::UspUser.exists?(123456) - assert !StoaPlugin::UspUser.exists?(654321) + refute StoaPlugin::UspUser.exists?(654321) end should 'check if usp_id matches with a cpf' do assert StoaPlugin::UspUser.matches?(123456, :cpf, 12345678) - assert !StoaPlugin::UspUser.matches?(123456, :cpf, 87654321) - assert !StoaPlugin::UspUser.matches?(654321, :cpf, 12345678) + refute StoaPlugin::UspUser.matches?(123456, :cpf, 87654321) + refute StoaPlugin::UspUser.matches?(654321, :cpf, 12345678) end should 'check if usp_id matches with a birth_date' do assert StoaPlugin::UspUser.matches?(123456, :birth_date, '1970-01-30') - assert !StoaPlugin::UspUser.matches?(123456, :birth_date, '1999-01-30') - assert !StoaPlugin::UspUser.matches?(654321, :birth_date, '1970-01-30') + refute StoaPlugin::UspUser.matches?(123456, :birth_date, '1999-01-30') + refute StoaPlugin::UspUser.matches?(654321, :birth_date, '1970-01-30') end should 'filter leading zeroes of id codes on exists and matches' do diff --git a/plugins/sub_organizations/test/unit/related_organizations_block_test.rb b/plugins/sub_organizations/test/unit/related_organizations_block_test.rb index b333a72..e138027 100644 --- a/plugins/sub_organizations/test/unit/related_organizations_block_test.rb +++ b/plugins/sub_organizations/test/unit/related_organizations_block_test.rb @@ -25,6 +25,6 @@ class RelatedOrganizationsBlockTest < ActiveSupport::TestCase assert @block.related_organizations.include?(child1) assert @block.related_organizations.include?(child2) - assert !@block.related_organizations.include?(org1) + refute @block.related_organizations.include?(org1) end end diff --git a/plugins/sub_organizations/test/unit/sub_organizations_plugin/relation_test.rb b/plugins/sub_organizations/test/unit/sub_organizations_plugin/relation_test.rb index bff92fa..185f767 100644 --- a/plugins/sub_organizations/test/unit/sub_organizations_plugin/relation_test.rb +++ b/plugins/sub_organizations/test/unit/sub_organizations_plugin/relation_test.rb @@ -28,7 +28,7 @@ class SubOrganizationsPlugin::RelationTest < ActiveSupport::TestCase should 'not allow self relation' do org = fast_create(Organization) relation = SubOrganizationsPlugin::Relation.new(:parent => org, :child => org) - assert !relation.valid? + refute relation.valid? assert relation.errors.include?(:child) end @@ -60,7 +60,7 @@ class SubOrganizationsPlugin::RelationTest < ActiveSupport::TestCase SubOrganizationsPlugin::Relation.create!(:parent => org1, :child => org2) relation = SubOrganizationsPlugin::Relation.new(:parent => org2, :child => org1) - assert !relation.valid? + refute relation.valid? assert relation.errors.include?(:child) end @@ -72,10 +72,10 @@ class SubOrganizationsPlugin::RelationTest < ActiveSupport::TestCase r1 = SubOrganizationsPlugin::Relation.new(:parent => org2, :child => org3) r2 = SubOrganizationsPlugin::Relation.new(:parent => org3, :child => org1) - assert !r1.valid? + refute r1.valid? assert r1.errors.include?(:child) - assert !r2.valid? + refute r2.valid? assert r2.errors.include?(:child) end diff --git a/plugins/tolerance_time/test/unit/tolerance_time_plugin/publication_test.rb b/plugins/tolerance_time/test/unit/tolerance_time_plugin/publication_test.rb index 648dd3e..591d77e 100644 --- a/plugins/tolerance_time/test/unit/tolerance_time_plugin/publication_test.rb +++ b/plugins/tolerance_time/test/unit/tolerance_time_plugin/publication_test.rb @@ -10,8 +10,8 @@ class ToleranceTimePlugin::PublicationTest < ActiveSupport::TestCase publication.target = fast_create(Article) publication.valid? - assert !publication.errors[:target_id].present? - assert !publication.errors[:target_type].present? + refute publication.errors[:target_id].present? + refute publication.errors[:target_type].present? end should 'validate uniqueness of target' do @@ -51,9 +51,9 @@ class ToleranceTimePlugin::PublicationTest < ActiveSupport::TestCase on_time_comment.save! assert expired_article.expired? - assert !on_time_article.expired? + refute on_time_article.expired? assert expired_comment.expired? - assert !on_time_comment.expired? + refute on_time_comment.expired? end should 'consider tolerance infinity if not defined' do @@ -64,7 +64,7 @@ class ToleranceTimePlugin::PublicationTest < ActiveSupport::TestCase article_publication.save! ToleranceTimePlugin::Tolerance.create!(:profile => profile) - assert !article_publication.expired? + refute article_publication.expired? end should 'not crash if profile has no tolerance yet defined' do @@ -74,6 +74,6 @@ class ToleranceTimePlugin::PublicationTest < ActiveSupport::TestCase article_publication.created_at = 1000.years.ago article_publication.save! - assert !article_publication.expired? + refute article_publication.expired? end end diff --git a/plugins/tolerance_time/test/unit/tolerance_time_plugin/tolerance_test.rb b/plugins/tolerance_time/test/unit/tolerance_time_plugin/tolerance_test.rb index f2ffad6..b5cbfa1 100644 --- a/plugins/tolerance_time/test/unit/tolerance_time_plugin/tolerance_test.rb +++ b/plugins/tolerance_time/test/unit/tolerance_time_plugin/tolerance_test.rb @@ -8,7 +8,7 @@ class ToleranceTimePlugin::ToleranceTest < ActiveSupport::TestCase tolerance.profile = fast_create(Profile) tolerance.valid? - assert !tolerance.errors[:profile_id].present? + refute tolerance.errors[:profile_id].present? end should 'validate uniqueness of profile' do diff --git a/plugins/video/test/unit/video_block_test.rb b/plugins/video/test/unit/video_block_test.rb index 0ebdae4..2e1612a 100644 --- a/plugins/video/test/unit/video_block_test.rb +++ b/plugins/video/test/unit/video_block_test.rb @@ -36,19 +36,19 @@ class VideoBlockTest < ActiveSupport::TestCase should "is_youtube return false when the url not contains youtube video ID" do block = VideoBlock.new block.url = "youtube.com/" - assert !block.is_youtube? + refute block.is_youtube? end should "is_youtube return false when the url contains empty youtube video ID" do block = VideoBlock.new block.url = "youtube.com/?v=" - assert !block.is_youtube? + refute block.is_youtube? end should "is_youtube return false when the url contains an invalid youtube link" do block = VideoBlock.new block.url = "http://www.yt.com/?v=XXXXX" - assert !block.is_youtube? + refute block.is_youtube? end should "format embed video for youtube videos" do @@ -131,19 +131,19 @@ class VideoBlockTest < ActiveSupport::TestCase should "is_vimeo return false when the url not contains vimeo video ID" do block = VideoBlock.new block.url = "vimeo.com/home" - assert !block.is_vimeo? + refute block.is_vimeo? end should "is_vimeo return false when the url contains empty vimeo video ID" do block = VideoBlock.new block.url = "vimeo.com/" - assert !block.is_vimeo? + refute block.is_vimeo? end should "is_vimeo return false when the url contains an invalid vimeo link" do block = VideoBlock.new block.url = "http://www.vmsd.com/98979" - assert !block.is_vimeo? + refute block.is_vimeo? end should "format embed video for vimeo videos" do @@ -205,13 +205,13 @@ class VideoBlockTest < ActiveSupport::TestCase should "is_video return false if url ends without mp4, ogg, ogv, webm" do block = VideoBlock.new block.url = "http://www.vmsd.com/98979.mp4r" - assert !block.is_video_file? + refute block.is_video_file? block.url = "http://www.vmsd.com/98979.oggr" - assert !block.is_video_file? + refute block.is_video_file? block.url = "http://www.vmsd.com/98979.ogvr" - assert !block.is_video_file? + refute block.is_video_file? block.url = "http://www.vmsd.com/98979.webmr" - assert !block.is_video_file? + refute block.is_video_file? end should 'display video block partial' do diff --git a/plugins/vote/test/functional/vote_plugin_profile_controller_test.rb b/plugins/vote/test/functional/vote_plugin_profile_controller_test.rb index 73db1e3..a81fe85 100644 --- a/plugins/vote/test/functional/vote_plugin_profile_controller_test.rb +++ b/plugins/vote/test/functional/vote_plugin_profile_controller_test.rb @@ -27,7 +27,7 @@ class VotePluginProfileControllerTest < ActionController::TestCase should 'not vote if value is not allowed' do xhr :post, :vote, :profile => profile.identifier, :id => comment.id, :model => 'comment', :vote => 4 - assert !profile.voted_on?(comment) + refute profile.voted_on?(comment) end should 'not vote in a disallowed model' do @@ -43,7 +43,7 @@ class VotePluginProfileControllerTest < ActionController::TestCase should 'unlike comment' do xhr :post, :vote, :profile => profile.identifier, :id => comment.id, :model => 'comment', :vote => 1 xhr :post, :vote, :profile => profile.identifier, :id => comment.id, :model => 'comment', :vote => 1 - assert !profile.voted_for?(comment) + refute profile.voted_for?(comment) end should 'dislike comment' do @@ -54,7 +54,7 @@ class VotePluginProfileControllerTest < ActionController::TestCase should 'undislike comment' do xhr :post, :vote, :profile => profile.identifier, :id => comment.id, :model => 'comment', :vote => -1 xhr :post, :vote, :profile => profile.identifier, :id => comment.id, :model => 'comment', :vote => -1 - assert !profile.voted_against?(comment) + refute profile.voted_against?(comment) end should 'dislike a liked comment' do diff --git a/plugins/work_assignment/test/unit/work_assingment_plugin_test.rb b/plugins/work_assignment/test/unit/work_assingment_plugin_test.rb index 85094de..b9a2053 100644 --- a/plugins/work_assignment/test/unit/work_assingment_plugin_test.rb +++ b/plugins/work_assignment/test/unit/work_assingment_plugin_test.rb @@ -15,7 +15,7 @@ class WorkAssignmentPluginTest < ActiveSupport::TestCase }, :without_protection => true ) - assert !WorkAssignmentPlugin.is_submission?(content) + refute WorkAssignmentPlugin.is_submission?(content) work_assignment = WorkAssignmentPlugin::WorkAssignment.create!(:name => 'Work Assignment', :profile => organization) content.parent = work_assignment @@ -28,7 +28,7 @@ class WorkAssignmentPluginTest < ActiveSupport::TestCase should 'be able to download submission if work_assignment published submissions' do submission = create_submission - assert !WorkAssignmentPlugin.can_download_submission?(nil, submission) + refute WorkAssignmentPlugin.can_download_submission?(nil, submission) work_assignment = submission.parent.parent work_assignment.publish_submissions = true @@ -41,7 +41,7 @@ class WorkAssignmentPluginTest < ActiveSupport::TestCase should 'be able to download submission if the user is author of it' do person = fast_create(Person) submission = create_submission - assert !WorkAssignmentPlugin.can_download_submission?(person, submission) + refute WorkAssignmentPlugin.can_download_submission?(person, submission) submission = create_submission(person) assert WorkAssignmentPlugin.can_download_submission?(person, submission) @@ -50,7 +50,7 @@ class WorkAssignmentPluginTest < ActiveSupport::TestCase should 'be able to download submission if the user has the view_private_content permission on the profile' do person = fast_create(Person) submission = create_submission - assert !WorkAssignmentPlugin.can_download_submission?(person, submission) + refute WorkAssignmentPlugin.can_download_submission?(person, submission) moderator = create_user_with_permission('moderator', 'view_private_content', submission.profile) assert WorkAssignmentPlugin.can_download_submission?(moderator, submission) diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb index e6511b9..8a7487e 100644 --- a/test/functional/account_controller_test.rb +++ b/test/functional/account_controller_test.rb @@ -142,14 +142,14 @@ class AccountControllerTest < ActionController::TestCase users(:johndoe).update_attribute :remember_token_expires_at, 5.minutes.ago @request.cookies["auth_token"] = cookie_for(:johndoe) get :index - assert !@controller.send(:logged_in?) + refute @controller.send(:logged_in?) end def test_should_fail_cookie_login users(:johndoe).remember_me @request.cookies["auth_token"] = auth_token('invalid_auth_token') get :index - assert !@controller.send(:logged_in?) + refute @controller.send(:logged_in?) end def test_should_display_anonymous_user_options @@ -187,7 +187,7 @@ class AccountControllerTest < ActionController::TestCase post :change_password, :current_password => 'wrong', :new_password => 'blabla', :new_password_confirmation => 'blabla' assert_response :success assert_template 'change_password' - assert ! User.find_by_login('ze').authenticated?('blabla') + refute User.find_by_login('ze').authenticated?('blabla') assert_equal users(:ze), @controller.send(:current_user) end @@ -196,8 +196,8 @@ class AccountControllerTest < ActionController::TestCase post :change_password, :current_password => 'test', :new_password => 'blabla', :new_password_confirmation => 'blibli' assert_response :success assert_template 'change_password' - assert !assigns(:current_user).authenticated?('blabla') - assert !assigns(:current_user).authenticated?('blibli') + refute assigns(:current_user).authenticated?('blabla') + refute assigns(:current_user).authenticated?('blibli') assert_equal users(:ze), @controller.send(:current_user) end @@ -282,7 +282,7 @@ class AccountControllerTest < ActionController::TestCase assert_response :success assert_template 'new_password' - assert !User.find(user.id).authenticated?('onepass') + refute User.find(user.id).authenticated?('onepass') end should 'display login popup' do @@ -536,7 +536,7 @@ class AccountControllerTest < ActionController::TestCase post :activate_enterprise, :enterprise_code => '0123456789', :answer => '1998', :terms_accepted => false ent.reload - assert !ent.enabled + refute ent.enabled assert_not_includes ent.members, p end diff --git a/test/functional/admin_panel_controller_test.rb b/test/functional/admin_panel_controller_test.rb index 02b76f6..42dbc5f 100644 --- a/test/functional/admin_panel_controller_test.rb +++ b/test/functional/admin_panel_controller_test.rb @@ -102,7 +102,7 @@ class AdminPanelControllerTest < ActionController::TestCase post :site_info, :environment => { :terms_of_use => content } assert_redirected_to :action => 'index' - assert !Environment.default.has_terms_of_use? + refute Environment.default.has_terms_of_use? end should 'save subject and body of signup welcome text' do @@ -113,7 +113,7 @@ class AdminPanelControllerTest < ActionController::TestCase assert_equal subject, Environment.default.signup_welcome_text[:subject] assert_equal body, Environment.default.signup_welcome_text[:body] - assert !Environment.default.signup_welcome_text.blank? + refute Environment.default.signup_welcome_text.blank? end should 'not save empty string as signup welcome text' do @@ -121,7 +121,7 @@ class AdminPanelControllerTest < ActionController::TestCase post :site_info, :environment => { :signup_welcome_text_body => content } assert_redirected_to :action => 'index' - assert !Environment.default.has_signup_welcome_text? + refute Environment.default.has_signup_welcome_text? end should 'sanitize message for disabled enterprise with white_list' do @@ -390,6 +390,6 @@ class AdminPanelControllerTest < ActionController::TestCase assert_redirected_to :action => 'index' assert_equal body, Environment.default.signup_welcome_screen_body - assert !Environment.default.signup_welcome_screen_body.blank? + refute Environment.default.signup_welcome_screen_body.blank? end end diff --git a/test/functional/application_controller_test.rb b/test/functional/application_controller_test.rb index c6737d9..baa8aac 100644 --- a/test/functional/application_controller_test.rb +++ b/test/functional/application_controller_test.rb @@ -150,7 +150,7 @@ class ApplicationControllerTest < ActionController::TestCase class DoesNotUsesBlocksTestController < ApplicationController no_design_blocks end - assert !DoesNotUsesBlocksTestController.new.send(:uses_design_blocks?) + refute DoesNotUsesBlocksTestController.new.send(:uses_design_blocks?) end should 'generate blocks' do diff --git a/test/functional/cms_controller_test.rb b/test/functional/cms_controller_test.rb index 6d05356..97df043 100644 --- a/test/functional/cms_controller_test.rb +++ b/test/functional/cms_controller_test.rb @@ -141,7 +141,7 @@ class CmsControllerTest < ActionController::TestCase profile.description = 'a' * 600 profile.save(:validate => false) - assert !profile.valid? + refute profile.valid? assert_not_equal a, profile.home_page post :set_home_page, :profile => profile.identifier, :id => a.id @@ -779,9 +779,9 @@ class CmsControllerTest < ActionController::TestCase post :new, :profile => profile.identifier, :type => 'TextileArticle', :parent_id => folder.id, :article => { :name => 'new-private-article'} folder.reload - assert !assigns(:article).published? + refute assigns(:article).published? assert_equal 'new-private-article', folder.children[0].name - assert !folder.children[0].published? + refute folder.children[0].published? end should 'publish the article in the selected community if community is not moderated' do @@ -1310,7 +1310,7 @@ class CmsControllerTest < ActionController::TestCase UploadedFile.attachment_options[:thumbnails].each do |suffix, size| assert File.exists?(UploadedFile.find(file_1.id).public_filename(suffix)) - assert !File.exists?(UploadedFile.find(file_2.id).public_filename(suffix)) + refute File.exists?(UploadedFile.find(file_2.id).public_filename(suffix)) end file_1.destroy file_2.destroy @@ -1553,7 +1553,7 @@ class CmsControllerTest < ActionController::TestCase profile.articles << Blog.new(:name => 'Blog for test', :profile => profile, :display_posts_in_current_language => true) post :edit, :profile => profile.identifier, :id => profile.blog.id, :article => { :display_posts_in_current_language => false } profile.blog.reload - assert !profile.blog.display_posts_in_current_language? + refute profile.blog.display_posts_in_current_language? end should 'update to true blog display posts in current language setting' do diff --git a/test/functional/comment_controller_test.rb b/test/functional/comment_controller_test.rb index 8340c35..aee24e1 100644 --- a/test/functional/comment_controller_test.rb +++ b/test/functional/comment_controller_test.rb @@ -417,7 +417,7 @@ class CommentControllerTest < ActionController::TestCase login_as 'normaluser' # normaluser cannot remove other people's comments xhr :post, :mark_as_spam, :profile => profile.identifier, :id => comment.id comment.reload - assert !comment.spam? + refute comment.spam? end 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 xhr :post, :mark_as_spam, :profile => profile.identifier, :id => comment.id assert_response :success comment.reload - assert !comment.spam? + refute comment.spam? assert_match /\{\"ok\":false\}/, @response.body end diff --git a/test/functional/environment_design_controller_test.rb b/test/functional/environment_design_controller_test.rb index 51dd1c8..f4962d7 100644 --- a/test/functional/environment_design_controller_test.rb +++ b/test/functional/environment_design_controller_test.rb @@ -207,9 +207,9 @@ class EnvironmentDesignControllerTest < ActionController::TestCase Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([TestBlockPlugin.new]) assert @controller.available_blocks.include?(CustomBlock1) - assert !@controller.available_blocks.include?(CustomBlock2) - assert !@controller.available_blocks.include?(CustomBlock3) - assert !@controller.available_blocks.include?(CustomBlock4) + refute @controller.available_blocks.include?(CustomBlock2) + refute @controller.available_blocks.include?(CustomBlock3) + refute @controller.available_blocks.include?(CustomBlock4) end should 'a block plugin with center position add new blocks only in this position' do @@ -247,12 +247,12 @@ class EnvironmentDesignControllerTest < ActionController::TestCase assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock1) assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock2) assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock3) - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock4) - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock5) - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock6) - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock7) - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock8) - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock9) + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock4) + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock5) + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock6) + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock7) + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock8) + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock9) end should 'a block plugin with side position add new blocks only in this position' do @@ -287,9 +287,9 @@ class EnvironmentDesignControllerTest < ActionController::TestCase get :add_block assert_response :success - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock1) - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock2) - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock3) + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock1) + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock2) + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock3) assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock4) assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock5) assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock6) @@ -328,13 +328,13 @@ class EnvironmentDesignControllerTest < ActionController::TestCase get :add_block assert_response :success - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock1) - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock2) - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock3) + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock1) + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock2) + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock3) assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock4) - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock5) - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock6) - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock7) + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock5) + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock6) + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock7) assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock8) end diff --git a/test/functional/features_controller_test.rb b/test/functional/features_controller_test.rb index d906b66..997919d 100644 --- a/test/functional/features_controller_test.rb +++ b/test/functional/features_controller_test.rb @@ -38,7 +38,7 @@ class FeaturesControllerTest < ActionController::TestCase v = Environment.find(environments(:anhetegua_net).id) assert v.enabled?('feature2') assert v.enabled?('feature2') - assert !v.enabled?('feature3') + refute v.enabled?('feature3') end def test_update_disable_all @@ -47,9 +47,9 @@ class FeaturesControllerTest < ActionController::TestCase assert_redirected_to :action => 'index' assert_kind_of String, session[:notice] v = Environment.find(environments(:anhetegua_net).id) - assert !v.enabled?('feature1') - assert !v.enabled?('feature2') - assert !v.enabled?('feature3') + refute v.enabled?('feature1') + refute v.enabled?('feature2') + refute v.enabled?('feature3') end def test_update_no_post diff --git a/test/functional/invite_controller_test.rb b/test/functional/invite_controller_test.rb index 05bd95c..fcdf087 100644 --- a/test/functional/invite_controller_test.rb +++ b/test/functional/invite_controller_test.rb @@ -164,7 +164,7 @@ class InviteControllerTest < ActionController::TestCase assert ContactList.exists?(contact_list.id) process_delayed_job_queue - assert !ContactList.exists?(contact_list.id) + refute ContactList.exists?(contact_list.id) end should 'destroy contact_list after invitation when import is not manual' do @@ -173,7 +173,7 @@ class InviteControllerTest < ActionController::TestCase assert ContactList.exists?(contact_list.id) process_delayed_job_queue - assert !ContactList.exists?(contact_list.id) + refute ContactList.exists?(contact_list.id) end should 'return empty hash as invitation data if contact list was not fetched' do diff --git a/test/functional/mailconf_controller_test.rb b/test/functional/mailconf_controller_test.rb index a11a1d0..09fb792 100644 --- a/test/functional/mailconf_controller_test.rb +++ b/test/functional/mailconf_controller_test.rb @@ -95,7 +95,7 @@ class MailconfControllerTest < ActionController::TestCase login_as('ze') assert user.enable_email! post :disable, :profile => 'ze' - assert !Profile['ze'].user.enable_email + refute Profile['ze'].user.enable_email end should 'go back on save' do diff --git a/test/functional/manage_products_controller_test.rb b/test/functional/manage_products_controller_test.rb index 2285b77..6a3024b 100644 --- a/test/functional/manage_products_controller_test.rb +++ b/test/functional/manage_products_controller_test.rb @@ -44,7 +44,7 @@ class ManageProductsControllerTest < ActionController::TestCase assert_difference 'Product.count' do post 'new', :profile => @enterprise.identifier, :product => {:name => 'test product'}, :selected_category_id => @product_category.id assert assigns(:product) - assert !assigns(:product).new_record? + refute assigns(:product).new_record? end end @@ -86,7 +86,7 @@ class ManageProductsControllerTest < ActionController::TestCase post :edit, :profile => @enterprise.identifier, :product => {:name => 'new test product'}, :id => product.id, :field => 'name' assert_response :success assert assigns(:product) - assert ! assigns(:product).new_record? + refute assigns(:product).new_record? assert_equal product, Product.find_by_name('new test product') end @@ -95,7 +95,7 @@ class ManageProductsControllerTest < ActionController::TestCase post :edit, :profile => @enterprise.identifier, :product => {:description => 'A very good product!'}, :id => product.id, :field => 'info' assert_response :success assert assigns(:product) - assert ! assigns(:product).new_record? + refute assigns(:product).new_record? assert_equal 'A very good product!', Product.find_by_name('test product').description end @@ -104,7 +104,7 @@ class ManageProductsControllerTest < ActionController::TestCase post :edit, :profile => @enterprise.identifier, :product => { :image_builder => { :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png') } }, :id => product.id, :field => 'image' assert_response :success assert assigns(:product) - assert ! assigns(:product).new_record? + refute assigns(:product).new_record? assert_equal 'rails.png', Product.find_by_name('test product').image.filename end @@ -129,7 +129,7 @@ class ManageProductsControllerTest < ActionController::TestCase assert_response :redirect assert_redirected_to :action => 'index' assert assigns(:product) - assert ! Product.find_by_name('test product') + refute Product.find_by_name('test product') end end @@ -491,7 +491,7 @@ class ManageProductsControllerTest < ActionController::TestCase resp = ActiveSupport::JSON.decode(@response.body) assert_nil resp['name'] assert_nil resp['id'] - assert !resp['ok'] + refute resp['ok'] assert_match /blank/, resp['error_msg'] end @@ -501,7 +501,7 @@ class ManageProductsControllerTest < ActionController::TestCase resp = ActiveSupport::JSON.decode(@response.body) assert_nil resp['name'] assert_nil resp['id'] - assert !resp['ok'] + refute resp['ok'] assert_match /too long/, resp['error_msg'] end diff --git a/test/functional/organizations_controller_test.rb b/test/functional/organizations_controller_test.rb index 7400611..d8e14d3 100644 --- a/test/functional/organizations_controller_test.rb +++ b/test/functional/organizations_controller_test.rb @@ -86,7 +86,7 @@ class OrganizationsControllerTest < ActionController::TestCase should 'activate organization profile' do organization = fast_create(Organization, :visible => false, :environment_id => environment.id) - assert !organization.visible? + refute organization.visible? get :activate, {:id => organization.id} organization.reload @@ -101,7 +101,7 @@ class OrganizationsControllerTest < ActionController::TestCase get :deactivate, {:id => organization.id} organization.reload - assert !organization.visible + refute organization.visible end should 'destroy organization profile' do diff --git a/test/functional/profile_controller_test.rb b/test/functional/profile_controller_test.rb index 5f4a779..2d09032 100644 --- a/test/functional/profile_controller_test.rb +++ b/test/functional/profile_controller_test.rb @@ -595,7 +595,7 @@ class ProfileControllerTest < ActionController::TestCase assert_response :success assert_equal "Message successfully sent.", assigns(:message) profile.reload - assert !profile.scraps_received.empty? + refute profile.scraps_received.empty? end should "leave a scrap on another profile" do @@ -608,7 +608,7 @@ class ProfileControllerTest < ActionController::TestCase assert_response :success assert_equal "Message successfully sent.", assigns(:message) another_person.reload - assert !another_person.scraps_received.empty? + refute another_person.scraps_received.empty? end should "the owner of scrap could remove it" do @@ -729,7 +729,7 @@ class ProfileControllerTest < ActionController::TestCase should 'not see the friends activities in the current profile' do p2 = create_user.person - assert !profile.is_a_friend?(p2) + refute profile.is_a_friend?(p2) p3 = create_user.person p3.add_friend(profile) assert p3.is_a_friend?(profile) @@ -753,7 +753,7 @@ class ProfileControllerTest < ActionController::TestCase should 'see all the activities in the current profile network' do p1= create_user.person p2= create_user.person - assert !p1.is_a_friend?(p2) + refute p1.is_a_friend?(p2) p3= create_user.person p3.add_friend(p1) @@ -783,7 +783,7 @@ class ProfileControllerTest < ActionController::TestCase should 'the network activity be visible only to profile followers' do p1= create_user.person p2= create_user.person - assert !p1.is_a_friend?(p2) + refute p1.is_a_friend?(p2) p3= create_user.person p3.add_friend(p1) @@ -826,7 +826,7 @@ class ProfileControllerTest < ActionController::TestCase should 'the network activity be visible only to logged users' do p1= create_user.person p2= create_user.person - assert !p1.is_a_friend?(p2) + refute p1.is_a_friend?(p2) p3= create_user.person p3.add_friend(p1) assert p3.is_a_friend?(p1) @@ -862,7 +862,7 @@ class ProfileControllerTest < ActionController::TestCase p1= fast_create(Person) community = fast_create(Community) p2= fast_create(Person) - assert !p1.is_a_friend?(p2) + refute p1.is_a_friend?(p2) community.add_member(p1) community.add_member(p2) ActionTracker::Record.destroy_all @@ -888,7 +888,7 @@ class ProfileControllerTest < ActionController::TestCase should 'the self activity not crashes with user not logged in' do p1= create_user.person p2= create_user.person - assert !p1.is_a_friend?(p2) + refute p1.is_a_friend?(p2) p3= create_user.person p3.add_friend(p1) assert p3.is_a_friend?(p1) @@ -1404,7 +1404,7 @@ class ProfileControllerTest < ActionController::TestCase login_as(profile.identifier) get :index, :profile => profile.identifier - assert !/This article makes me hungry/.match(@response.body), 'Spam comment was shown!' + refute /This article makes me hungry/.match(@response.body), 'Spam comment was shown!' end should 'display comment in wall from non logged users after click in view all comments' do diff --git a/test/functional/profile_design_controller_test.rb b/test/functional/profile_design_controller_test.rb index 3770477..2d90e1b 100644 --- a/test/functional/profile_design_controller_test.rb +++ b/test/functional/profile_design_controller_test.rb @@ -203,12 +203,12 @@ class ProfileDesignControllerTest < ActionController::TestCase assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock1) assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock2) assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock3) - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock4) - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock5) - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock6) - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock7) - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock8) - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock9) + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock4) + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock5) + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock6) + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock7) + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock8) + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock9) end should 'a block plugin with side position add new blocks only in this position' do @@ -242,9 +242,9 @@ class ProfileDesignControllerTest < ActionController::TestCase get :add_block, :profile => 'designtestuser' assert_response :success - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock1) - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock2) - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock3) + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock1) + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock2) + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock3) assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock4) assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock5) assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock6) @@ -283,13 +283,13 @@ class ProfileDesignControllerTest < ActionController::TestCase assert_response :success assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock1) - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock2) - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock3) - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock4) + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock2) + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock3) + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock4) assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock5) - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock6) - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock7) - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock8) + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock6) + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock7) + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock8) end should 'not edit main block with never option' do @@ -726,7 +726,7 @@ class ProfileDesignControllerTest < ActionController::TestCase end Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([TestBlockPlugin.new]) - assert !@controller.available_blocks.include?(CustomBlock1) + refute @controller.available_blocks.include?(CustomBlock1) end should 'clone a block' do diff --git a/test/functional/profile_editor_controller_test.rb b/test/functional/profile_editor_controller_test.rb index fde38e3..69675d3 100644 --- a/test/functional/profile_editor_controller_test.rb +++ b/test/functional/profile_editor_controller_test.rb @@ -333,7 +333,7 @@ class ProfileEditorControllerTest < ActionController::TestCase post :edit, :profile => org.identifier, :profile_data => { :closed => 'false' } org.reload - assert !org.closed + refute org.closed end should 'not display option to close when it is enterprise' do @@ -477,13 +477,13 @@ class ProfileEditorControllerTest < ActionController::TestCase should 'not enable enterprise without confirmation' do ent = fast_create(Enterprise, :enabled => false) post :enable, :profile => ent.identifier - assert !assigns(:to_enable).enabled? + refute assigns(:to_enable).enabled? end should 'disable enterprise after confirmation' do ent = fast_create(Enterprise, :enabled => true) post :disable, :profile => ent.identifier, :confirmation => 1 - assert !assigns(:to_disable).enabled? + refute assigns(:to_disable).enabled? end should 'not disable enterprise without confirmation' do @@ -883,7 +883,7 @@ class ProfileEditorControllerTest < ActionController::TestCase should 'have welcome_page only for template' do organization = fast_create(Organization, :is_template => false) @controller.stubs(:profile).returns(organization) - assert !@controller.send(:has_welcome_page) + refute @controller.send(:has_welcome_page) organization = fast_create(Organization, :is_template => true) @controller.stubs(:profile).returns(organization) @@ -891,7 +891,7 @@ class ProfileEditorControllerTest < ActionController::TestCase person = fast_create(Person, :is_template => false) @controller.stubs(:profile).returns(person) - assert !@controller.send(:has_welcome_page) + refute @controller.send(:has_welcome_page) person = fast_create(Person, :is_template => true) @controller.stubs(:profile).returns(person) @@ -916,7 +916,7 @@ class ProfileEditorControllerTest < ActionController::TestCase should 'create welcome_page with public false by default' do get :welcome_page, :profile => fast_create(Person, :is_template => true).identifier - assert !assigns(:welcome_page).published + refute assigns(:welcome_page).published end should 'update welcome page and redirect to index' do diff --git a/test/functional/region_validators_controller_test.rb b/test/functional/region_validators_controller_test.rb index 7ecf997..7bbcf3c 100644 --- a/test/functional/region_validators_controller_test.rb +++ b/test/functional/region_validators_controller_test.rb @@ -26,7 +26,7 @@ class RegionValidatorsControllerTest < ActionController::TestCase give_permission('ze', 'manage_environment_validators', environment) region = Region.new(:name => 'my region') environment.regions << region - assert !region.new_record? + refute region.new_record? @controller.expects(:environment).returns(environment).at_least_once @@ -42,7 +42,7 @@ class RegionValidatorsControllerTest < ActionController::TestCase give_permission('ze', 'manage_environment_validators', environment) region = Region.new(:name => 'my region') environment.regions << region - assert !region.new_record? + refute region.new_record? org = create(Organization, :name => "My frufru organization", :identifier => 'frufru', :environment_id => environment.id) @controller.expects(:environment).returns(environment).at_least_once @@ -58,7 +58,7 @@ class RegionValidatorsControllerTest < ActionController::TestCase give_permission('ze', 'manage_environment_validators', environment) region = Region.new(:name => 'my region') environment.regions << region - assert !region.new_record? + refute region.new_record? org = create(Organization, :name => "My frufru organization", :identifier => 'frufru', :environment_id => environment.id) @controller.expects(:environment).returns(environment).at_least_once @@ -75,7 +75,7 @@ class RegionValidatorsControllerTest < ActionController::TestCase give_permission('ze', 'manage_environment_validators', environment) region = Region.new(:name => 'my region') environment.regions << region - assert !region.new_record? + refute region.new_record? org = create(Organization, :name => "My frufru organization", :identifier => 'frufru', :environment_id => environment.id) region.validators << org @@ -85,7 +85,7 @@ class RegionValidatorsControllerTest < ActionController::TestCase assert_response :redirect assert_redirected_to :action => 'region', :id => region.id - assert !Region.find(region.id).validators.include?(org) + refute Region.find(region.id).validators.include?(org) end end diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb index 21d23b8..0a3f1e7 100644 --- a/test/functional/search_controller_test.rb +++ b/test/functional/search_controller_test.rb @@ -267,11 +267,11 @@ class SearchControllerTest < ActionController::TestCase get :index, :query => 'something' assert assigns(:searches).has_key?(:articles) - assert !assigns(:searches).has_key?(:enterprises) - assert !assigns(:searches).has_key?(:people) - assert !assigns(:searches).has_key?(:communities) - assert !assigns(:searches).has_key?(:products) - assert !assigns(:searches).has_key?(:events) + refute assigns(:searches).has_key?(:enterprises) + refute assigns(:searches).has_key?(:people) + refute assigns(:searches).has_key?(:communities) + refute assigns(:searches).has_key?(:products) + refute assigns(:searches).has_key?(:events) end should 'search all enabled assets in general search' do @@ -288,7 +288,7 @@ class SearchControllerTest < ActionController::TestCase [:articles, :enterprises, :people, :communities, :products, :events].select do |key, name| !assigns(:environment).enabled?('disable_asset_' + key.to_s) end.each do |asset| - assert !assigns(:searches)[asset][:results].empty? + refute assigns(:searches)[asset][:results].empty? end end diff --git a/test/functional/spam_controller_test.rb b/test/functional/spam_controller_test.rb index d84f0d3..dfa2c7d 100644 --- a/test/functional/spam_controller_test.rb +++ b/test/functional/spam_controller_test.rb @@ -40,13 +40,13 @@ class SpamControllerTest < ActionController::TestCase test "should remove comments" do post :index, :profile => @community.identifier, :remove_comment => @spam_comment.id - assert !Comment.exists?(@spam_comment.id) + refute Comment.exists?(@spam_comment.id) end test "should remove suggest articles" do post :index, :profile => @community.identifier, :remove_task => @spam_suggest_article.id - assert !SuggestArticle.exists?(@spam_suggest_article.id) + refute SuggestArticle.exists?(@spam_suggest_article.id) end should 'properly render spam that have replies' do diff --git a/test/functional/tasks_controller_test.rb b/test/functional/tasks_controller_test.rb index 49d0d6d..23839c2 100644 --- a/test/functional/tasks_controller_test.rb +++ b/test/functional/tasks_controller_test.rb @@ -517,7 +517,7 @@ class TasksControllerTest < ActionController::TestCase post :change_responsible, :task_id => task.id, :responsible_id => person2.id, :old_responsible => nil assert_equal person1, task.reload.responsible json_response = ActiveSupport::JSON.decode(response.body) - assert !json_response['success'] + refute json_response['success'] end should 'list tasks for user with only view_tasks permission' do diff --git a/test/functional/trusted_sites_controller_test.rb b/test/functional/trusted_sites_controller_test.rb index 62edf85..cd3d785 100644 --- a/test/functional/trusted_sites_controller_test.rb +++ b/test/functional/trusted_sites_controller_test.rb @@ -40,14 +40,14 @@ class TrustedSitesControllerTest < ActionController::TestCase @controller.stubs(:add_trusted_site).returns(false) post :create, :site => 'new.site.com' assert_response :success # it actually failed, but was not redirected - assert !assigns(:environment).trusted_sites_for_iframe.include?('new.site.com'), 'Site was included in the trusted_sites!?' + refute assigns(:environment).trusted_sites_for_iframe.include?('new.site.com'), 'Site was included in the trusted_sites!?' end should 'destroy site' do post :create, :site => 'todel.site.com' delete :destroy, :site => 'todel.site.com' assert_redirected_to :action => :index - assert ! assigns(:environment).trusted_sites_for_iframe.include?('todel.site.com'), 'Site was not removed from trusted_sites' + refute assigns(:environment).trusted_sites_for_iframe.include?('todel.site.com'), 'Site was not removed from trusted_sites' end should "get edit" do @@ -64,7 +64,7 @@ class TrustedSitesControllerTest < ActionController::TestCase post :create, :site => 'toedit.site.com' post :update, :orig_site => 'toedit.site.com', :site => 'edited.site.com' assert_redirected_to :action => :edit - assert ! assigns(:environment).trusted_sites_for_iframe.include?('toedit.site.com'), 'Original site found. Site was not updated?' + refute assigns(:environment).trusted_sites_for_iframe.include?('toedit.site.com'), 'Original site found. Site was not updated?' assert assigns(:environment).trusted_sites_for_iframe.include?('edited.site.com'), 'New name for site not found. Site was not updated?' end @@ -74,6 +74,6 @@ class TrustedSitesControllerTest < ActionController::TestCase post :update, :orig_site => 'toedit.site.com', :site => 'edited.site.com' assert_response :success # it actually failed, but was not redirected assert assigns(:environment).trusted_sites_for_iframe.include?('toedit.site.com'), 'Original site not found. Site was updated?' - assert !assigns(:environment).trusted_sites_for_iframe.include?('edited.site.com'), 'New name for site found. Site was updated?' + refute assigns(:environment).trusted_sites_for_iframe.include?('edited.site.com'), 'New name for site found. Site was updated?' end end diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb index 70e52fc..d3f9f05 100644 --- a/test/functional/users_controller_test.rb +++ b/test/functional/users_controller_test.rb @@ -85,7 +85,7 @@ class UsersControllerTest < ActionController::TestCase post :reset_admin_role, :id => person.id, :q => '' person.reload - assert !person.is_admin? + refute person.is_admin? end should 'activate user' do diff --git a/test/integration/manage_friendships_test.rb b/test/integration/manage_friendships_test.rb index babac0b..d0e5f39 100644 --- a/test/integration/manage_friendships_test.rb +++ b/test/integration/manage_friendships_test.rb @@ -31,7 +31,7 @@ class ManageFriendshipsTest < ActionController::IntegrationTest follow_redirect! assert assigns(:friends).empty? - assert !@person.is_a_friend?(@friend) - assert !@friend.is_a_friend?(@person) + refute @person.is_a_friend?(@friend) + refute @friend.is_a_friend?(@person) end end diff --git a/test/integration/varnish_conf_test.rb b/test/integration/varnish_conf_test.rb index 4bbc85a..11fd077 100644 --- a/test/integration/varnish_conf_test.rb +++ b/test/integration/varnish_conf_test.rb @@ -3,7 +3,7 @@ require 'test/unit' class VarnishConfTest < Test::Unit::TestCase def test_not_use_return_in_varnish_noosfero - assert !system('grep "return.*pass" etc/noosfero/varnish-noosfero.vcl') + refute system('grep "return.*pass" etc/noosfero/varnish-noosfero.vcl') end end diff --git a/test/unit/abuse_complaint_test.rb b/test/unit/abuse_complaint_test.rb index c03fca1..48a1598 100644 --- a/test/unit/abuse_complaint_test.rb +++ b/test/unit/abuse_complaint_test.rb @@ -6,7 +6,7 @@ class AbuseComplaintTest < ActiveSupport::TestCase reported = fast_create(Profile) abuse_complaint = AbuseComplaint.new - assert !abuse_complaint.valid? + refute abuse_complaint.valid? assert abuse_complaint.errors[:reported].any? abuse_complaint.reported = reported @@ -54,6 +54,6 @@ class AbuseComplaintTest < ActiveSupport::TestCase reported.destroy - assert !AbuseComplaint.find_by_requestor_id(reported_id), "AbuseComplaint still exist!" + refute AbuseComplaint.find_by_requestor_id(reported_id), "AbuseComplaint still exist!" end end diff --git a/test/unit/abuse_report_test.rb b/test/unit/abuse_report_test.rb index 12cdd60..7082de8 100644 --- a/test/unit/abuse_report_test.rb +++ b/test/unit/abuse_report_test.rb @@ -13,7 +13,7 @@ class AbuseReportTest < ActiveSupport::TestCase should 'ensure presence of complaint, reporter and reported' do abuse_report = AbuseReport.new(:reason => 'some reason') - assert !abuse_report.valid? + refute abuse_report.valid? assert abuse_report.invalid?(:reporter) assert abuse_report.invalid?(:abuse_complaint) diff --git a/test/unit/action_tracker_notification_test.rb b/test/unit/action_tracker_notification_test.rb index 99eec0d..1c62bdc 100644 --- a/test/unit/action_tracker_notification_test.rb +++ b/test/unit/action_tracker_notification_test.rb @@ -9,7 +9,7 @@ class ActionTrackerNotificationTest < ActiveSupport::TestCase a.profile_id= 1 a.valid? - assert !a.errors[:profile_id.to_s].present? + refute a.errors[:profile_id.to_s].present? end should "have the action tracker" do @@ -19,7 +19,7 @@ class ActionTrackerNotificationTest < ActiveSupport::TestCase a.action_tracker_id= 1 a.valid? - assert !a.errors[:action_tracker_id.to_s].present? + refute a.errors[:action_tracker_id.to_s].present? end should "be associated to Person" do @@ -58,7 +58,7 @@ class ActionTrackerNotificationTest < ActiveSupport::TestCase atn.profile_id = 2 atn.valid? - assert !atn.errors[:action_tracker_id.to_s].present? + refute atn.errors[:action_tracker_id.to_s].present? end should "the action_tracker_id be unique on scope of profile when created by ActionTracker::Record association" do diff --git a/test/unit/acts_as_having_settings_test.rb b/test/unit/acts_as_having_settings_test.rb index 2afa4fc..413fb1e 100644 --- a/test/unit/acts_as_having_settings_test.rb +++ b/test/unit/acts_as_having_settings_test.rb @@ -23,8 +23,8 @@ class ActsAsHavingSettingsTest < ActiveSupport::TestCase block_class = Class.new(Block) block = block_class.new - assert !block.respond_to?(:limit) - assert !block.respond_to?(:limit=) + refute block.respond_to?(:limit) + refute block.respond_to?(:limit=) block_class.settings_items :limit @@ -89,7 +89,7 @@ class ActsAsHavingSettingsTest < ActiveSupport::TestCase should 'setting_changed be false if a setting passed as parameter was not changed' do obj = TestClass.new - assert !obj.setting_changed?('flag') + refute obj.setting_changed?('flag') end 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 obj.flag = true obj.save obj.flag = true - assert !obj.setting_changed?('flag') + refute obj.setting_changed?('flag') end should 'setting_changed be false if a setting passed as parameter was not changed but another setting is changed' do obj = TestClass.new(:name => 'some name') obj.save obj.name = 'antoher nme' - assert !obj.setting_changed?('flag') + refute obj.setting_changed?('flag') end should 'setting_changed be true for all changed fields' do diff --git a/test/unit/add_friend_test.rb b/test/unit/add_friend_test.rb index 508b7e5..90dbc4a 100644 --- a/test/unit/add_friend_test.rb +++ b/test/unit/add_friend_test.rb @@ -101,7 +101,7 @@ class AddFriendTest < ActiveSupport::TestCase task.group_for_person = 'short name' task.valid? - assert !task.errors[:group_for_person].present? + refute task.errors[:group_for_person].present? end should 'limit "group for friend" number of characters' do @@ -115,7 +115,7 @@ class AddFriendTest < ActiveSupport::TestCase task.group_for_friend = 'short name' task.valid? - assert !task.errors[:group_for_friend].present? + refute task.errors[:group_for_friend].present? end should 'have target notification message if is organization and not moderated' do diff --git a/test/unit/application_helper_test.rb b/test/unit/application_helper_test.rb index 9380071..3e1c39f 100644 --- a/test/unit/application_helper_test.rb +++ b/test/unit/application_helper_test.rb @@ -794,7 +794,7 @@ class ApplicationHelperTest < ActionView::TestCase article = fast_create(Article, :name => 'my article') response = content_id_to_str(article) assert_equal String, response.class - assert !response.empty? + refute response.empty? end should 'content_id_to_str return empty string when receiving nil' do diff --git a/test/unit/approve_article_test.rb b/test/unit/approve_article_test.rb index b7a93d8..a468e9d 100644 --- a/test/unit/approve_article_test.rb +++ b/test/unit/approve_article_test.rb @@ -85,7 +85,7 @@ class ApproveArticleTest < ActiveSupport::TestCase community.stubs(:notification_emails).returns(['adm@example.com']) a = create(ApproveArticle, :name => '', :article => article, :target => community, :requestor => profile) - assert !ActionMailer::Base.deliveries.empty? + refute ActionMailer::Base.deliveries.empty? end should 'not notify target if group is not moderated' do @@ -167,7 +167,7 @@ class ApproveArticleTest < ActiveSupport::TestCase a = create(ApproveArticle, :article => article, :target => community, :requestor => profile) a.finish - assert !community.has_blog? + refute community.has_blog? assert_nil article.class.last.parent end diff --git a/test/unit/approve_comment_test.rb b/test/unit/approve_comment_test.rb index 0c1d8a6..a2fe7a7 100644 --- a/test/unit/approve_comment_test.rb +++ b/test/unit/approve_comment_test.rb @@ -162,7 +162,7 @@ class ApproveCommentTest < ActiveSupport::TestCase should 'accept_disabled be false if there is an article associated to task' do a = ApproveComment.new(:comment_attributes => @comment.attributes.to_json) - assert !a.accept_disabled? + refute a.accept_disabled? end should 'have target notification description' do diff --git a/test/unit/article_test.rb b/test/unit/article_test.rb index 68ae33f..d88bd13 100644 --- a/test/unit/article_test.rb +++ b/test/unit/article_test.rb @@ -18,7 +18,7 @@ class ArticleTest < ActiveSupport::TestCase a.profile = profile a.valid? - assert !a.errors[:profile_id.to_s].present? + refute a.errors[:profile_id.to_s].present? end should 'require value for name' do @@ -28,7 +28,7 @@ class ArticleTest < ActiveSupport::TestCase a.name = 'my article' a.valid? - assert !a.errors[:name.to_s].present? + refute a.errors[:name.to_s].present? end should 'limit length of names' do @@ -38,7 +38,7 @@ class ArticleTest < ActiveSupport::TestCase a.name = 'a'*150 a.valid? - assert !a.errors[:name.to_s].present? + refute a.errors[:name.to_s].present? end should 'require value for slug and path if name is filled' do @@ -53,8 +53,8 @@ class ArticleTest < ActiveSupport::TestCase should 'not require value for slug and path if name is blank' do a = Article.new a.valid? - assert !a.errors[:slug.to_s].present? - assert !a.errors[:path.to_s].present? + refute a.errors[:slug.to_s].present? + refute a.errors[:path.to_s].present? end should 'act as versioned' do @@ -145,7 +145,7 @@ class ArticleTest < ActiveSupport::TestCase a3 = profile.articles.build(:name => 'test') a3.parent = a1 a3.valid? - assert !a3.errors[:slug.to_s].present? + refute a3.errors[:slug.to_s].present? a3.save! # cannot add another child of a1 with same slug @@ -352,11 +352,11 @@ class ArticleTest < ActiveSupport::TestCase end should 'identify itself as a non-folder' do - assert !Article.new.folder?, 'should identify itself as non-folder' + refute Article.new.folder?, 'should identify itself as non-folder' end should 'identify itself as a non-blog' do - assert !Article.new.blog?, 'should identify itself as non-blog' + refute Article.new.blog?, 'should identify itself as non-blog' end should 'always display if public content' do @@ -425,7 +425,7 @@ class ArticleTest < ActiveSupport::TestCase assert_equivalent [c2, c3], art.categories(true) assert_includes art.categories_including_virtual(true), c1 - assert !art.categories_including_virtual(true).include?(c4) + refute art.categories_including_virtual(true).include?(c4) end should 'be able to create an article already with categories' do @@ -459,7 +459,7 @@ class ArticleTest < ActiveSupport::TestCase end should 'not accept Product category as category' do - assert !Article.new.accept_category?(ProductCategory.new) + refute Article.new.accept_category?(ProductCategory.new) end should 'accept published attribute' do @@ -471,7 +471,7 @@ class ArticleTest < ActiveSupport::TestCase profile = fast_create(Profile, :name => 'test profile', :identifier => 'test_profile') article = fast_create(Article, :name => 'test article', :profile_id => profile.id, :published => false) - assert !article.display_to?(nil) + refute article.display_to?(nil) end should 'say that not member of profile cannot see private article' do @@ -479,7 +479,7 @@ class ArticleTest < ActiveSupport::TestCase article = fast_create(Article, :name => 'test article', :profile_id => profile.id, :published => false) person = create_user('test_user').person - assert !article.display_to?(person) + refute article.display_to?(person) end should 'say that member user can not see private article' do @@ -488,7 +488,7 @@ class ArticleTest < ActiveSupport::TestCase person = create_user('test_user').person profile.affiliate(person, Profile::Roles.member(profile.environment.id)) - assert !article.display_to?(person) + refute article.display_to?(person) end should 'say that profile admin can see private article' do @@ -526,7 +526,7 @@ class ArticleTest < ActiveSupport::TestCase folder = fast_create(Folder, :name => 'my_intranet', :profile_id => profile.id, :published => false) article = fast_create(Article, :name => 'my private article', :profile_id => profile.id, :parent_id => folder.id) - assert !article.published? + refute article.published? end should 'save as private' do @@ -538,7 +538,7 @@ class ArticleTest < ActiveSupport::TestCase article.save! article.reload - assert !article.published? + refute article.published? end should 'not allow friends of private person see the article' do @@ -549,7 +549,7 @@ class ArticleTest < ActiveSupport::TestCase person.save! friend.save! - assert !article.display_to?(friend) + refute article.display_to?(friend) end should 'display private articles to people who can view private content' do @@ -661,7 +661,7 @@ class ArticleTest < ActiveSupport::TestCase p = create_user('user_blog_test').person folder = fast_create(Folder, :name => 'Not Blog', :profile_id => p.id) a = fast_create(TextileArticle, :name => 'Not blog post', :profile_id => p.id, :parent_id => folder.id) - assert !a.belongs_to_blog? + refute a.belongs_to_blog? end should 'has comments notifier true by default' do @@ -690,7 +690,7 @@ class ArticleTest < ActiveSupport::TestCase should 'moderate_comments? return false if moderate_comments variable is false' do a = Article.new a.moderate_comments= false - assert !a.moderate_comments? + refute a.moderate_comments? end should 'hold hits count' do @@ -761,7 +761,7 @@ class ArticleTest < ActiveSupport::TestCase should 'not be highlighted by default' do a = Article.new - assert !a.highlighted + refute a.highlighted end should 'get tagged with tag' do @@ -1009,7 +1009,7 @@ class ArticleTest < ActiveSupport::TestCase should 'notifiable is false by default' do a = fast_create(Article) - assert !a.notifiable? + refute a.notifiable? end should 'not notify activity by default on create' do @@ -1205,11 +1205,11 @@ class ArticleTest < ActiveSupport::TestCase end should 'not be a forum by default' do - assert !fast_create(Article).forum? + refute fast_create(Article).forum? end should 'not have posts by default' do - assert !fast_create(Article).has_posts? + refute fast_create(Article).has_posts? end should 'get article galleries' do @@ -1243,21 +1243,21 @@ class ArticleTest < ActiveSupport::TestCase assert a.errors[:language.to_s].present? a.language = 'en' a.valid? - assert !a.errors[:language.to_s].present? + refute a.errors[:language.to_s].present? end should 'language can be blank' do a = build(Article) a.valid? - assert !a.errors[:language.to_s].present? + refute a.errors[:language.to_s].present? a.language = '' a.valid? - assert !a.errors[:language.to_s].present? + refute a.errors[:language.to_s].present? end should 'article is not translatable' do a = build(Article) - assert !a.translatable? + refute a.translatable? end should 'get native translation' do @@ -1272,7 +1272,7 @@ class ArticleTest < ActiveSupport::TestCase native_article = fast_create(Article, :language => 'pt', :profile_id => fast_create(Profile).id ) article_translation = fast_create(Article, :language => 'en', :translation_of_id => native_article.id) possible_translations = native_article.possible_translations - assert !possible_translations.include?('en') + refute possible_translations.include?('en') assert possible_translations.include?('pt') end @@ -1286,7 +1286,7 @@ class ArticleTest < ActiveSupport::TestCase assert a.errors[:language.to_s].present? a.language = 'es' a.valid? - assert !a.errors[:language.to_s].present? + refute a.errors[:language.to_s].present? end should 'verify if native translation is already in use' do @@ -1298,7 +1298,7 @@ class ArticleTest < ActiveSupport::TestCase assert a.errors[:language.to_s].present? a.language = 'es' a.valid? - assert !a.errors[:language.to_s].present? + refute a.errors[:language.to_s].present? end should 'translation have a language' do @@ -1309,7 +1309,7 @@ class ArticleTest < ActiveSupport::TestCase assert a.errors[:language.to_s].present? a.language = 'en' a.valid? - assert !a.errors[:language.to_s].present? + refute a.errors[:language.to_s].present? end should 'native translation have a language' do @@ -1387,10 +1387,10 @@ class ArticleTest < ActiveSupport::TestCase should 'not list own language as a possible translation if language has changed' do a = build(Article, :language => 'pt', :profile_id => fast_create(Profile).id) - assert !a.possible_translations.include?('pt') + refute a.possible_translations.include?('pt') a = fast_create(Article, :language => 'pt', :profile_id => fast_create(Profile).id ) a.language = 'en' - assert !a.possible_translations.include?('en') + refute a.possible_translations.include?('en') end should 'list own language as a possible translation if language has not changed' do @@ -1430,7 +1430,7 @@ class ArticleTest < ActiveSupport::TestCase end should 'tiny mce editor is disabled by default' do - assert !Article.new.tiny_mce? + refute Article.new.tiny_mce? end should 'return only folders' do @@ -1474,19 +1474,19 @@ class ArticleTest < ActiveSupport::TestCase should 'not accept uploads if has no parent' do child = fast_create(UploadedFile) - assert !child.accept_uploads? + refute child.accept_uploads? end should 'not accept uploads if parent is a blog' do folder = fast_create(Blog) child = fast_create(UploadedFile, :parent_id => folder.id) - assert !child.accept_uploads? + refute child.accept_uploads? end should 'not accept uploads if parent is a forum' do folder = fast_create(Forum) child = fast_create(UploadedFile, :parent_id => folder.id) - assert !child.accept_uploads? + refute child.accept_uploads? end should 'get images paths in article body' do @@ -1684,7 +1684,7 @@ class ArticleTest < ActiveSupport::TestCase should 'not crash on allow_edit without a current user' do a = build(Article) a.allow_members_to_edit = true - assert !a.allow_edit?(nil) + refute a.allow_edit?(nil) end should 'allow author to edit topic' do @@ -1834,13 +1834,13 @@ class ArticleTest < ActiveSupport::TestCase p = create_user('user_forum_test').person blog = fast_create(Blog, :name => 'Not Forum', :profile_id => p.id) a = fast_create(TextileArticle, :name => 'Not forum post', :profile_id => p.id, :parent_id => blog.id) - assert !a.belongs_to_forum? + refute a.belongs_to_forum? end should 'not belongs to forum if do not have a parent' do p = create_user('user_forum_test').person a = fast_create(TextileArticle, :name => 'Orphan post', :profile_id => p.id) - assert !a.belongs_to_forum? + refute a.belongs_to_forum? end should 'save image on create article' do @@ -1998,7 +1998,7 @@ class ArticleTest < ActiveSupport::TestCase should 'display_filter do not show person private content to non friends' do user = create_user('someuser').person p = fast_create(Person) - assert !p.is_a_friend?(user) + refute p.is_a_friend?(user) user.stubs(:has_permission?).with(:view_private_content, p).returns(false) Article.delete_all a = fast_create(Article, :published => false, :show_to_followers => true, :profile_id => p.id) @@ -2010,7 +2010,7 @@ class ArticleTest < ActiveSupport::TestCase should 'display_filter do not show community private content to non members' do user = create_user('someuser').person p = fast_create(Community) - assert !user.is_member_of?(p) + refute user.is_member_of?(p) user.stubs(:has_permission?).with(:view_private_content, p).returns(false) Article.delete_all a = fast_create(Article, :published => false, :show_to_followers => true, :profile_id => p.id) @@ -2022,7 +2022,7 @@ class ArticleTest < ActiveSupport::TestCase should 'display_filter show community public content even it has no followers defined' do user = create_user('someuser').person p = fast_create(Community) - assert !user.is_member_of?(p) + refute user.is_member_of?(p) user.stubs(:has_permission?).with(:view_private_content, p).returns(false) Article.delete_all a = fast_create(Article, :published => true, :show_to_followers => true, :profile_id => p.id) @@ -2034,7 +2034,7 @@ class ArticleTest < ActiveSupport::TestCase should 'display_filter show person public content even it has no followers defined' do user = create_user('someuser').person p = fast_create(Community) - assert !user.is_a_friend?(p) + refute user.is_a_friend?(p) user.stubs(:has_permission?).with(:view_private_content, p).returns(false) Article.delete_all a = fast_create(Article, :published => true, :show_to_followers => true, :profile_id => p.id) @@ -2046,8 +2046,8 @@ class ArticleTest < ActiveSupport::TestCase should 'display_filter do not show person private content to non friends passing nil as profile parameter' do user = create_user('someuser').person p = fast_create(Person) - assert !p.is_a_friend?(user) - assert !user.is_admin? + refute p.is_a_friend?(user) + refute user.is_admin? Article.delete_all fast_create(Article, :published => false, :profile_id => p.id) assert_equal [], Article.display_filter(user, nil) @@ -2056,8 +2056,8 @@ class ArticleTest < ActiveSupport::TestCase should 'display_filter show person public content to non friends passing nil as profile parameter' do user = create_user('someuser').person p = fast_create(Person) - assert !p.is_a_friend?(user) - assert !user.is_admin? + refute p.is_a_friend?(user) + refute user.is_admin? Article.delete_all a1 = fast_create(Article, :profile_id => p.id) a2 = fast_create(Article) @@ -2067,7 +2067,7 @@ class ArticleTest < ActiveSupport::TestCase should 'display_filter do not show community private content to non members passing nil as profile parameter' do user = create_user('someuser').person p = fast_create(Community) - assert !user.is_member_of?(p) + refute user.is_member_of?(p) Article.delete_all fast_create(Article, :published => false, :profile_id => p.id) assert_equal [], Article.display_filter(user, nil) @@ -2076,7 +2076,7 @@ class ArticleTest < ActiveSupport::TestCase should 'display_filter show community public content to non members passing nil as profile parameter' do user = create_user('someuser').person p = fast_create(Community) - assert !user.is_member_of?(p) + refute user.is_member_of?(p) Article.delete_all a1 = fast_create(Article, :profile_id => p.id) a2 = fast_create(Article) @@ -2099,7 +2099,7 @@ class ArticleTest < ActiveSupport::TestCase should 'display_filter not show public content of private community for non members' do user = create_user('someuser').person p = fast_create(Community, :public_profile => false) - assert !user.is_member_of?(p) + refute user.is_member_of?(p) user.stubs(:has_permission?).with(:view_private_content, p).returns(false) Article.delete_all a = fast_create(Article, :published => true, :profile_id => p.id) @@ -2141,7 +2141,7 @@ class ArticleTest < ActiveSupport::TestCase should 'display_filter not show public content of private person for non friends' do user = create_user('someuser').person p = fast_create(Person, :public_profile => false) - assert !user.is_a_friend?(p) + refute user.is_a_friend?(p) user.stubs(:has_permission?).with(:view_private_content, p).returns(false) Article.delete_all a = fast_create(Article, :published => true, :profile_id => p.id) diff --git a/test/unit/block_test.rb b/test/unit/block_test.rb index b44a481..2eeb781 100644 --- a/test/unit/block_test.rb +++ b/test/unit/block_test.rb @@ -238,11 +238,11 @@ class BlockTest < ActiveSupport::TestCase block = MyBlock.new assert block.visible?({:value => 2}) - assert !block.visible?({:value => 3}) + refute block.visible?({:value => 3}) end should 'not be embedable by default' do - assert !Block.new.embedable? + refute Block.new.embedable? end should 'generate embed code' do @@ -275,13 +275,13 @@ class BlockTest < ActiveSupport::TestCase should 'do not display block to logged users for display_user = not_logged' do block = Block.new block.display_user = 'not_logged' - assert !block.display_to_user?(User.new) + refute block.display_to_user?(User.new) end should 'do not display block to not logged users for display_user = logged' do block = Block.new block.display_user = 'logged' - assert !block.display_to_user?(nil) + refute block.display_to_user?(nil) end should 'display block to not logged users for display_user = not_logged' do @@ -293,7 +293,7 @@ class BlockTest < ActiveSupport::TestCase should 'not be visible if display_to_user? is false' do block = Block.new block.expects(:display_to_user?).once.returns(false) - assert !block.visible?({}) + refute block.visible?({}) end should 'accept user as parameter on cache_key without change its value' do @@ -322,7 +322,7 @@ class BlockTest < ActiveSupport::TestCase block = create(Block, :box_id => box.id) block.display_user = 'followers' block.save! - assert !block.display_to_user?(user.person) + refute block.display_to_user?(user.person) end should 'display block to friends of person for display_user = friends' do @@ -346,7 +346,7 @@ class BlockTest < ActiveSupport::TestCase block = create(Block, :box_id => box.id) block.display_user = 'followers' block.save! - assert !block.display_to_user?(person_friend) + refute block.display_to_user?(person_friend) end should 'get limit as a number when limit is string' do diff --git a/test/unit/blog_test.rb b/test/unit/blog_test.rb index 39fdc85..6d14222 100644 --- a/test/unit/blog_test.rb +++ b/test/unit/blog_test.rb @@ -118,7 +118,7 @@ class BlogTest < ActiveSupport::TestCase p = create_user('testuser').person blog = build(Blog, :profile => p, :name => 'Blog test', :external_feed_builder => {:enabled => true}) blog.save - assert ! blog.valid? + refute blog.valid? end should 'remove external feed when removing blog' do @@ -178,15 +178,15 @@ class BlogTest < ActiveSupport::TestCase blog.visualization_format = 'short' blog.valid? - assert !blog.errors[:visualization_format.to_s].present? + refute blog.errors[:visualization_format.to_s].present? blog.visualization_format = 'full' blog.valid? - assert !blog.errors[:visualization_format.to_s].present? + refute blog.errors[:visualization_format.to_s].present? blog.visualization_format = 'compact' blog.valid? - assert !blog.errors[:visualization_format.to_s].present? + refute blog.errors[:visualization_format.to_s].present? end should 'have posts' do @@ -195,8 +195,8 @@ class BlogTest < ActiveSupport::TestCase should 'not display posts in current language by default' do blog = Blog.new - assert !blog.display_posts_in_current_language - assert !blog.display_posts_in_current_language? + refute blog.display_posts_in_current_language + refute blog.display_posts_in_current_language? end should 'update display posts in current language setting' do @@ -205,8 +205,8 @@ class BlogTest < ActiveSupport::TestCase blog = p.blog blog.display_posts_in_current_language = false assert blog.save! && blog.reload - assert !blog.reload.display_posts_in_current_language - assert !blog.reload.display_posts_in_current_language? + refute blog.reload.display_posts_in_current_language + refute blog.reload.display_posts_in_current_language? end #FIXME This should be used until there is a migration to fix all blogs that @@ -223,7 +223,7 @@ class BlogTest < ActiveSupport::TestCase should 'not accept uploads' do folder = fast_create(Blog) - assert !folder.accept_uploads? + refute folder.accept_uploads? end should 'know when blog has or when has no posts' do @@ -231,7 +231,7 @@ class BlogTest < ActiveSupport::TestCase blog = Blog.create!(:profile => p, :name => 'Blog test') assert blog.empty? fast_create(TextileArticle, :parent_id => blog.id) - assert ! blog.empty? + refute blog.empty? end should 'set cover image' do diff --git a/test/unit/box_test.rb b/test/unit/box_test.rb index deff6e1..5e1e701 100644 --- a/test/unit/box_test.rb +++ b/test/unit/box_test.rb @@ -18,15 +18,15 @@ class BoxTest < ActiveSupport::TestCase should 'list allowed blocks for center box' do blocks = Box.new.tap { |b| b.position = 1 }.acceptable_blocks - assert !blocks.include?('.block') - assert !blocks.include?('.disabled-enterprise-message-block') - assert !blocks.include?('.featured-products-block') - assert !blocks.include?('.products-block') - assert !blocks.include?('.profile-info-block') - assert !blocks.include?('.profile-list-block') - assert !blocks.include?('.profile-search-block') - assert !blocks.include?('.slideshow-block') - assert !blocks.include?('.location-block') + refute blocks.include?('.block') + refute blocks.include?('.disabled-enterprise-message-block') + refute blocks.include?('.featured-products-block') + refute blocks.include?('.products-block') + refute blocks.include?('.profile-info-block') + refute blocks.include?('.profile-list-block') + refute blocks.include?('.profile-search-block') + refute blocks.include?('.slideshow-block') + refute blocks.include?('.location-block') assert blocks.include?('.article-block') assert blocks.include?('.blog-archives-block') @@ -51,9 +51,9 @@ class BoxTest < ActiveSupport::TestCase should 'list allowed blocks for box at position 2' do blocks = Box.new.tap { |b| b.position = 2 }.acceptable_blocks - assert !blocks.include?('.main-block') - assert !blocks.include?('.block') - assert !blocks.include?('.profile-list-block') + refute blocks.include?('.main-block') + refute blocks.include?('.block') + refute blocks.include?('.profile-list-block') assert blocks.include?('.article-block') assert blocks.include?('.blog-archives-block') @@ -129,7 +129,7 @@ class BoxTest < ActiveSupport::TestCase assert blocks.include?('box-test_plugin-block') blocks = build(Box, :position => 1, :owner => Community.new).acceptable_blocks - assert !blocks.include?('box-test_plugin-block') + refute blocks.include?('box-test_plugin-block') end should 'list only boxes with a postion greater than zero' do diff --git a/test/unit/boxes_helper_test.rb b/test/unit/boxes_helper_test.rb index cabd36d..2cd3fea 100644 --- a/test/unit/boxes_helper_test.rb +++ b/test/unit/boxes_helper_test.rb @@ -106,7 +106,7 @@ class BoxesHelperTest < ActionView::TestCase end should 'add invisible CSS class name for invisible blocks' do - assert !block_css_classes(build(Block, :display => 'always')).split.any? { |item| item == 'invisible-block'} + refute block_css_classes(build(Block, :display => 'always')).split.any? { |item| item == 'invisible-block'} assert block_css_classes(build(Block, :display => 'never')).split.any? { |item| item == 'invisible-block'} end diff --git a/test/unit/category_test.rb b/test/unit/category_test.rb index 45185bb..deabdb7 100644 --- a/test/unit/category_test.rb +++ b/test/unit/category_test.rb @@ -17,7 +17,7 @@ class CategoryTest < ActiveSupport::TestCase def test_mandatory_field_name c = Category.new c.name = 'product category for testing' - assert !c.valid? + refute c.valid? assert c.errors[:environment_id.to_s].present? end @@ -75,14 +75,14 @@ class CategoryTest < ActiveSupport::TestCase sub_cat = build(Category, :name => 'subcategory_name') sub_cat.stubs(:parent).returns(cat) sub_cat.parent = cat - assert !sub_cat.top_level? + refute sub_cat.top_level? end def test_leaf cat = build(Category, :name => 'category_name') sub_cat = build(Category, :name => 'subcategory_name') cat.stubs(:children).returns([sub_cat]) - assert !cat.leaf? + refute cat.leaf? end def test_not_leaf @@ -132,7 +132,7 @@ class CategoryTest < ActiveSupport::TestCase c1 = create(Category, :environment_id => @env.id) c2 = build(Category, :slug => c1.slug, :environment_id => @env.id) - assert !c2.valid? + refute c2.valid? assert c2.errors[:slug.to_s].present? end diff --git a/test/unit/certifier_test.rb b/test/unit/certifier_test.rb index b86d2ab..387b9b5 100644 --- a/test/unit/certifier_test.rb +++ b/test/unit/certifier_test.rb @@ -14,7 +14,7 @@ class CertifierTest < ActiveSupport::TestCase should 'environment is mandatory' do certifier = Certifier.new(:name => 'Certifier without environment') - assert !certifier.valid? + refute certifier.valid? certifier.environment = fast_create(Environment) assert certifier.valid? @@ -34,7 +34,7 @@ class CertifierTest < ActiveSupport::TestCase should 'name is mandatory' do env_one = fast_create(Environment) certifier = env_one.certifiers.new - assert !certifier.valid? + refute certifier.valid? certifier.name = 'Certifier name' assert certifier.valid? diff --git a/test/unit/change_password_test.rb b/test/unit/change_password_test.rb index 6e8ce9e..ab06cdb 100644 --- a/test/unit/change_password_test.rb +++ b/test/unit/change_password_test.rb @@ -16,7 +16,7 @@ class ChangePasswordTest < ActiveSupport::TestCase change.status = Task::Status::FINISHED change.password = 'right' change.password_confirmation = 'wrong' - assert !change.valid? + refute change.valid? assert change.errors[:password.to_s].present? diff --git a/test/unit/comment_helper_test.rb b/test/unit/comment_helper_test.rb index d24591c..2fb747d 100644 --- a/test/unit/comment_helper_test.rb +++ b/test/unit/comment_helper_test.rb @@ -71,7 +71,7 @@ class CommentHelperTest < ActiveSupport::TestCase should 'do not return link for report abuse action when comment has no author' do comment = Comment.new link = link_for_report_abuse(comment) - assert !link + refute link end should 'return link for mark comment as spam' do diff --git a/test/unit/comment_test.rb b/test/unit/comment_test.rb index 802045a..64270ea 100644 --- a/test/unit/comment_test.rb +++ b/test/unit/comment_test.rb @@ -328,7 +328,7 @@ class CommentTest < ActiveSupport::TestCase should 'be able to reject a comment' do c = Comment.new - assert !c.rejected? + refute c.rejected? c.reject! assert c.rejected? @@ -408,15 +408,15 @@ class CommentTest < ActiveSupport::TestCase c = Comment.new c.spam = true assert c.spam? - assert !c.ham? + refute c.ham? c.spam = false assert c.ham? - assert !c.spam? + refute c.spam? c.spam = nil - assert !c.spam? - assert !c.ham? + refute c.spam? + refute c.ham? end should 'be able to select non-spam comments' do @@ -547,7 +547,7 @@ class CommentTest < ActiveSupport::TestCase article = Article.new comment = build(Comment, :article => article) - assert !comment.need_moderation? + refute comment.need_moderation? end should 'not need moderation if the comment author is the article author' do @@ -560,7 +560,7 @@ class CommentTest < ActiveSupport::TestCase comment = build(Comment, :article => article) comment.stubs(:author).returns(author) - assert !comment.need_moderation? + refute comment.need_moderation? end should 'need moderation if article is moderated and the comment has no author' do @@ -589,7 +589,7 @@ class CommentTest < ActiveSupport::TestCase should 'not be able to destroy comment without user' do comment = Comment.new - assert !comment.can_be_destroyed_by?(nil) + refute comment.can_be_destroyed_by?(nil) end should 'not be able to destroy comment' do @@ -599,7 +599,7 @@ class CommentTest < ActiveSupport::TestCase comment = build(Comment, :article => article) user.expects(:has_permission?).with(:moderate_comments, profile).returns(false) - assert !comment.can_be_destroyed_by?(user) + refute comment.can_be_destroyed_by?(user) end should 'be able to destroy comment if is the author' do @@ -631,7 +631,7 @@ class CommentTest < ActiveSupport::TestCase should 'not be able to mark comment as spam without user' do comment = Comment.new - assert !comment.can_be_marked_as_spam_by?(nil) + refute comment.can_be_marked_as_spam_by?(nil) end should 'not be able to mark comment as spam' do @@ -641,7 +641,7 @@ class CommentTest < ActiveSupport::TestCase comment = build(Comment, :article => article) user.expects(:has_permission?).with(:moderate_comments, profile).returns(false) - assert !comment.can_be_marked_as_spam_by?(user) + refute comment.can_be_marked_as_spam_by?(user) end should 'be able to mark comment as spam if is the profile' do @@ -666,14 +666,14 @@ class CommentTest < ActiveSupport::TestCase should 'not be able to update comment without user' do comment = Comment.new - assert !comment.can_be_updated_by?(nil) + refute comment.can_be_updated_by?(nil) end should 'not be able to update comment' do user = Person.new comment = Comment.new - assert !comment.can_be_updated_by?(user) + refute comment.can_be_updated_by?(user) end should 'be able to update comment if is the author' do @@ -714,10 +714,10 @@ class CommentTest < ActiveSupport::TestCase should 'like a comment' do comment = create_comment person = create_user('voter').person - assert !comment.voted_by?(person, true) + refute comment.voted_by?(person, true) person.vote_for(comment) assert comment.voted_by?(person, true) - assert !comment.voted_by?(person, false) + refute comment.voted_by?(person, false) end should 'count voters for' do diff --git a/test/unit/community_test.rb b/test/unit/community_test.rb index c5b10bd..ef0a3a6 100644 --- a/test/unit/community_test.rb +++ b/test/unit/community_test.rb @@ -28,9 +28,9 @@ class CommunityTest < ActiveSupport::TestCase should 'create default set of blocks' do c = create(Community, :environment => Environment.default, :name => 'my new community') - assert !c.boxes[0].blocks.empty?, 'person must have blocks in area 1' - assert !c.boxes[1].blocks.empty?, 'person must have blocks in area 2' - assert !c.boxes[2].blocks.empty?, 'person must have blocks in area 3' + refute c.boxes[0].blocks.empty?, 'person must have blocks in area 1' + refute c.boxes[1].blocks.empty?, 'person must have blocks in area 2' + refute c.boxes[2].blocks.empty?, 'person must have blocks in area 3' end should 'create a default set of articles' do @@ -82,7 +82,7 @@ class CommunityTest < ActiveSupport::TestCase c.destroy relationships.each do |i| - assert !RoleAssignment.exists?(i.id) + refute RoleAssignment.exists?(i.id) end end @@ -118,24 +118,24 @@ class CommunityTest < ActiveSupport::TestCase e = Environment.default e.expects(:required_community_fields).returns(['contact_phone']).at_least_once community = build(Community, :name => 'My community', :environment => e) - assert ! community.valid? + refute community.valid? assert community.errors[:contact_phone.to_s].present? community.contact_phone = '99999' community.valid? - assert ! community.errors[:contact_phone.to_s].present? + refute community.errors[:contact_phone.to_s].present? end should 'not require fields if community is a template' do e = Environment.default e.expects(:required_community_fields).returns(['contact_phone']).at_least_once community = build(Community, :name => 'My community', :environment => e) - assert ! community.valid? + refute community.valid? assert community.errors[:contact_phone.to_s].present? community.is_template = true community.valid? - assert ! community.errors[:contact_phone.to_s].present? + refute community.errors[:contact_phone.to_s].present? end should 'return newest text articles as news' do @@ -262,11 +262,11 @@ class CommunityTest < ActiveSupport::TestCase p2 = fast_create(Person) p3 = fast_create(Person) - assert !p1.is_member_of?(c) + refute p1.is_member_of?(c) c.add_member(p1) assert p1.is_member_of?(c) - assert !p3.is_member_of?(c) + refute p3.is_member_of?(c) c.add_member(p3) assert p3.is_member_of?(c) @@ -288,7 +288,7 @@ class CommunityTest < ActiveSupport::TestCase process_delayed_job_queue community.add_member(p3) assert p1.is_member_of?(community) - assert !p2.is_member_of?(community) + refute p2.is_member_of?(community) assert p3.is_member_of?(community) process_delayed_job_queue end @@ -409,14 +409,14 @@ class CommunityTest < ActiveSupport::TestCase member = create_user('memberuser').person c.add_member(member) - assert !c.is_admin?(member) + refute c.is_admin?(member) end should 'a moderator user not be a community admin' do c = fast_create(Community, :name => 'my test profile', :identifier => 'mytestprofile') moderator = create_user('moderatoruser').person c.add_moderator(moderator) - assert !c.is_admin?(moderator) + refute c.is_admin?(moderator) end end diff --git a/test/unit/contact_test.rb b/test/unit/contact_test.rb index 78cde6a..04f1a5b 100644 --- a/test/unit/contact_test.rb +++ b/test/unit/contact_test.rb @@ -4,16 +4,16 @@ class ContactTest < ActiveSupport::TestCase should 'validates required fields' do contact = Contact.new - assert !contact.valid? + refute contact.valid? contact.subject = 'Hi' - assert !contact.valid? + refute contact.valid? contact.name = 'john' - assert !contact.valid? + refute contact.valid? contact.email = 'visitor@invalid.com' - assert !contact.valid? + refute contact.valid? contact.message = 'Hi, all' assert contact.valid? @@ -40,8 +40,8 @@ class ContactTest < ActiveSupport::TestCase should 'not deliver message if contact is invalid' do ent = fast_create(Enterprise, :name => 'my enterprise', :identifier => 'myent') c = Contact.new(:name => 'john', :subject => 'hi', :message => 'hi, all', :dest => ent) - assert !c.valid? - assert !c.deliver + refute c.valid? + refute c.deliver end should 'use sender name and environment noreply_email on from' do diff --git a/test/unit/create_community_test.rb b/test/unit/create_community_test.rb index c1bf8ef..798e25e 100644 --- a/test/unit/create_community_test.rb +++ b/test/unit/create_community_test.rb @@ -23,7 +23,7 @@ class CreateCommunityTest < ActiveSupport::TestCase assert task.errors[:requestor_id.to_s].present? task.requestor = person task.valid? - assert !task.errors[:requestor_id.to_s].present? + refute task.errors[:requestor_id.to_s].present? end should 'actually create a community when finishing the task and associate the task requestor as its admin' do diff --git a/test/unit/create_enterprise_test.rb b/test/unit/create_enterprise_test.rb index b028e04..99d27d7 100644 --- a/test/unit/create_enterprise_test.rb +++ b/test/unit/create_enterprise_test.rb @@ -26,7 +26,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase task.foundation_year = 2006 task.valid? - assert !task.errors[:foundation_year.to_s].present? + refute task.errors[:foundation_year.to_s].present? end should 'require a requestor' do @@ -37,7 +37,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase assert task.errors[:requestor_id.to_s].present? task.requestor = create_user('testuser').person task.valid? - assert !task.errors[:requestor_id.to_s].present? + refute task.errors[:requestor_id.to_s].present? end should 'require a target (validator organization)' do @@ -49,7 +49,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase task.target = Organization.create!(:name => "My organization", :identifier => 'validator_organization') task.valid? - assert !task.errors[:target_id.to_s].present? + refute task.errors[:target_id.to_s].present? end should 'require that the informed target (validator organization) actually validates for the chosen region' do @@ -69,7 +69,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase region.validators << validator task.valid? - assert !task.errors[:target.to_s].present? + refute task.errors[:target.to_s].present? end should 'cancel task when rejected ' do @@ -84,7 +84,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase task.reject_explanation = nil task.valid? - assert !task.errors[:reject_explanation.to_s].present? + refute task.errors[:reject_explanation.to_s].present? task.status = Task::Status::CANCELLED task.valid? @@ -92,7 +92,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase task.reject_explanation = 'bla bla bla' task.valid? - assert !task.errors[:reject_explanation.to_s].present? + refute task.errors[:reject_explanation.to_s].present? end should 'finish task when approved' do @@ -130,7 +130,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase task.finish - assert !enterprise.new_record? + refute enterprise.new_record? assert_equal person.user, enterprise.user assert_equal environment, enterprise.environment @@ -167,7 +167,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase task.finish - assert !enterprise.new_record? + refute enterprise.new_record? assert_equal person.user, enterprise.user assert_equal environment, enterprise.environment @@ -203,7 +203,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase :requestor_id => person.id, }) - assert !task.valid? && task.valid_before_selecting_target? + refute task.valid? && task.valid_before_selecting_target? task.target = validator assert task.valid? diff --git a/test/unit/disabled_enterprise_message_block_test.rb b/test/unit/disabled_enterprise_message_block_test.rb index 2e1ff28..56c14d2 100644 --- a/test/unit/disabled_enterprise_message_block_test.rb +++ b/test/unit/disabled_enterprise_message_block_test.rb @@ -19,7 +19,7 @@ class DisabledEnterpriseMessageBlockTest < ActiveSupport::TestCase end should 'not be editable' do - assert !DisabledEnterpriseMessageBlock.new.editable? + refute DisabledEnterpriseMessageBlock.new.editable? end end diff --git a/test/unit/domain_test.rb b/test/unit/domain_test.rb index 455927f..a05dbe6 100644 --- a/test/unit/domain_test.rb +++ b/test/unit/domain_test.rb @@ -22,7 +22,7 @@ class DomainTest < ActiveSupport::TestCase should 'allow domains with dot' do domain = build(Domain, :name => 'test.org') domain.valid? - assert !domain.errors[:name.to_s].present? + refute domain.errors[:name.to_s].present? end should 'not allow domains with upper cased letters' do @@ -34,13 +34,13 @@ class DomainTest < ActiveSupport::TestCase should 'allow domains with hyphen' do domain = build(Domain, :name => 'test-domain.org') domain.valid? - assert !domain.errors[:name.to_s].present? + refute domain.errors[:name.to_s].present? end should 'allow domains with underscore' do domain = build(Domain, :name => 'test_domain.org') domain.valid? - assert !domain.errors[:name.to_s].present? + refute domain.errors[:name.to_s].present? end def test_owner @@ -63,7 +63,7 @@ class DomainTest < ActiveSupport::TestCase d.name = 'example.net' d.valid? - assert !d.errors[:name.to_s].present? + refute d.errors[:name.to_s].present? end def test_find_by_name @@ -71,8 +71,8 @@ class DomainTest < ActiveSupport::TestCase fast_create(Domain, :name => 'example.net') d1 = Domain.find_by_name('example.net') d2 = Domain.find_by_name('www.example.net') - assert !d1.nil? - assert !d2.nil? + refute d1.nil? + refute d2.nil? assert d1 == d2 end @@ -81,7 +81,7 @@ class DomainTest < ActiveSupport::TestCase assert create(Domain, :name => 'example.net') d = build(Domain, :name => 'example.net') - assert !d.valid? + refute d.valid? assert d.errors[:name.to_s].present? end diff --git a/test/unit/email_activation_test.rb b/test/unit/email_activation_test.rb index a77cf7f..09f911a 100644 --- a/test/unit/email_activation_test.rb +++ b/test/unit/email_activation_test.rb @@ -24,7 +24,7 @@ class EmailActivationTest < ActiveSupport::TestCase should 'enable user email when finish' do ze = create_user('zezinho', :environment_id => Environment.default.id) - assert !ze.enable_email + refute ze.enable_email task = fast_create(EmailActivation, :requestor_id => ze.person.id, :target_id => Environment.default.id) task.finish ze.reload @@ -33,7 +33,7 @@ class EmailActivationTest < ActiveSupport::TestCase should 'deliver email after enabling mailbox' do ze = create_user('zezinho', :environment_id => Environment.default.id, :email => 'ze@example.com') - assert !ze.enable_email + refute ze.enable_email task = EmailActivation.create!(:requestor => ze.person, :target => Environment.default) task.finish @@ -46,7 +46,7 @@ class EmailActivationTest < ActiveSupport::TestCase assert task.save! another_task = EmailActivation.new(:requestor => ze.person, :target => Environment.default) - assert !another_task.save, "Should not be able to save another task" + refute another_task.save, "Should not be able to save another task" end should 'deliver activation email notification' do diff --git a/test/unit/enterprise_activation_test.rb b/test/unit/enterprise_activation_test.rb index f860a3f..ca55707 100644 --- a/test/unit/enterprise_activation_test.rb +++ b/test/unit/enterprise_activation_test.rb @@ -26,7 +26,7 @@ class EnterpriseActivationTest < ActiveSupport::TestCase ent = Enterprise.create!(:name => 'my enterprise', :identifier => 'myent') t.enterprise = ent t.valid? - assert !t.errors[:enterprise].any?, "must validate after enterprise is set" + refute t.errors[:enterprise].any?, "must validate after enterprise is set" end should 'activate enterprise when finished' do diff --git a/test/unit/enterprise_test.rb b/test/unit/enterprise_test.rb index 04a549a..6c076d3 100644 --- a/test/unit/enterprise_test.rb +++ b/test/unit/enterprise_test.rb @@ -25,15 +25,15 @@ class EnterpriseTest < ActiveSupport::TestCase p.identifier = 'rightformat2007' p.valid? - assert ! p.errors[:identifier.to_s].present? + refute p.errors[:identifier.to_s].present? p.identifier = 'rightformat' p.valid? - assert ! p.errors[:identifier.to_s].present? + refute p.errors[:identifier.to_s].present? p.identifier = 'right_format' p.valid? - assert ! p.errors[:identifier.to_s].present? + refute p.errors[:identifier.to_s].present? end def test_has_domains @@ -83,9 +83,9 @@ class EnterpriseTest < ActiveSupport::TestCase should 'create default set of blocks' do e = create(Enterprise, :name => 'my new community', :identifier => 'mynewcommunity') - assert !e.boxes[0].blocks.empty?, 'enterprise must have blocks in area 1' - assert !e.boxes[1].blocks.empty?, 'enterprise must have blocks in area 2' - assert !e.boxes[2].blocks.empty?, 'enterprise must have blocks in area 3' + refute e.boxes[0].blocks.empty?, 'enterprise must have blocks in area 1' + refute e.boxes[1].blocks.empty?, 'enterprise must have blocks in area 2' + refute e.boxes[2].blocks.empty?, 'enterprise must have blocks in area 3' end should 'allow to add new members if has no members' do @@ -147,7 +147,7 @@ class EnterpriseTest < ActiveSupport::TestCase ent.data[:blocked] = true ent.save ent.unblock - assert !Enterprise.find(ent.id).blocked? + refute Enterprise.find(ent.id).blocked? end should 'enable and make user admin' do @@ -302,29 +302,29 @@ class EnterpriseTest < ActiveSupport::TestCase e = Environment.default e.expects(:required_enterprise_fields).returns(['contact_phone']).at_least_once enterprise = build(Enterprise, :environment => e) - assert ! enterprise.valid? + refute enterprise.valid? assert enterprise.errors[:contact_phone.to_s].present? enterprise.contact_phone = '99999' enterprise.valid? - assert ! enterprise.errors[:contact_phone.to_s].present? + refute enterprise.errors[:contact_phone.to_s].present? end should 'not require fields if enterprise is a template' do e = Environment.default e.expects(:required_enterprise_fields).returns(['contact_phone']).at_least_once enterprise = build(Enterprise, :environment => e) - assert ! enterprise.valid? + refute enterprise.valid? assert enterprise.errors[:contact_phone.to_s].present? enterprise.is_template = true enterprise.valid? - assert ! enterprise.errors[:contact_phone.to_s].present? + refute enterprise.errors[:contact_phone.to_s].present? end should 'enable contact' do enterprise = build(Enterprise, :enable_contact_us => false) - assert !enterprise.enable_contact? + refute enterprise.enable_contact? enterprise.enable_contact_us = true assert enterprise.enable_contact? end @@ -370,7 +370,7 @@ class EnterpriseTest < ActiveSupport::TestCase e.disable('enterprises_are_validated_when_created') e.save enterprise = create(Enterprise, :name => 'test enteprise', :identifier => 'test_ent2') - assert !enterprise.validated + refute enterprise.validated end should 'have inactive_template when creating enterprise and feature is enabled' do @@ -437,11 +437,11 @@ class EnterpriseTest < ActiveSupport::TestCase p2 = fast_create(Person) p3 = fast_create(Person) - assert !p1.is_member_of?(e) + refute p1.is_member_of?(e) e.add_member(p1) assert p1.is_member_of?(e) - assert !p3.is_member_of?(e) + refute p3.is_member_of?(e) e.add_member(p3) assert p3.is_member_of?(e) @@ -514,14 +514,14 @@ class EnterpriseTest < ActiveSupport::TestCase member = create_user('memberuser').person c.add_member(member) - assert !c.is_admin?(member) + refute c.is_admin?(member) end should 'a moderator user not be a community admin' do c = fast_create(Enterprise, :name => 'my test profile', :identifier => 'mytestprofile') moderator = create_user('moderatoruser').person c.add_moderator(moderator) - assert !c.is_admin?(moderator) + refute c.is_admin?(moderator) end diff --git a/test/unit/environment_mailing_test.rb b/test/unit/environment_mailing_test.rb index 79285c6..c312db5 100644 --- a/test/unit/environment_mailing_test.rb +++ b/test/unit/environment_mailing_test.rb @@ -20,7 +20,7 @@ class EnvironmentMailingTest < ActiveSupport::TestCase mailing.source_id = environment.id mailing.valid? - assert !mailing.errors[:source_id].any? + refute mailing.errors[:source_id].any? end should 'return environment name' do @@ -95,7 +95,7 @@ class EnvironmentMailingTest < ActiveSupport::TestCase mailing = create_mailing(environment, :person => person_1) process_delayed_job_queue - assert !mailing.mailing_sents.find_by_person_id(recipient.id) + refute mailing.mailing_sents.find_by_person_id(recipient.id) end def new_mailing(environment) diff --git a/test/unit/environment_test.rb b/test/unit/environment_test.rb index 363030a..55a91ca 100644 --- a/test/unit/environment_test.rb +++ b/test/unit/environment_test.rb @@ -11,7 +11,7 @@ class EnvironmentTest < ActiveSupport::TestCase vc2 = build(Environment, :name => 'Another Test Community') vc2.is_default = true - assert !vc2.valid? + refute vc2.valid? assert vc2.errors[:is_default.to_s].present? assert_equal vc, Environment.default @@ -38,7 +38,7 @@ class EnvironmentTest < ActiveSupport::TestCase v.enable('feature1', false) assert v.enabled?('feature1') v.disable('feature1', false) - assert !v.enabled?('feature1') + refute v.enabled?('feature1') end def test_enabled_features @@ -50,7 +50,7 @@ class EnvironmentTest < ActiveSupport::TestCase def test_enabled_features_no_features_enabled v = fast_create(Environment) - assert !v.enabled?('feature1') && !v.enabled?('feature2') && !v.enabled?('feature3') + refute v.enabled?('feature1') && !v.enabled?('feature2') && !v.enabled?('feature3') end def test_default_enabled_features_are_enabled @@ -66,7 +66,7 @@ class EnvironmentTest < ActiveSupport::TestCase assert v.errors[:name.to_s].present? v.name = 'blablabla' v.valid? - assert !v.errors[:name.to_s].present? + refute v.errors[:name.to_s].present? end def test_terms_of_use @@ -84,12 +84,12 @@ class EnvironmentTest < ActiveSupport::TestCase v.terms_of_use = "" assert v.save v.reload - assert !v.has_terms_of_use? + refute v.has_terms_of_use? end def test_has_terms_of_use v = Environment.new - assert !v.has_terms_of_use? + refute v.has_terms_of_use? v.terms_of_use = 'some terms of use' assert v.has_terms_of_use? end @@ -105,11 +105,11 @@ class EnvironmentTest < ActiveSupport::TestCase def test_has_terms_of_enterprise_use v = Environment.new - assert !v.has_terms_of_enterprise_use? + refute v.has_terms_of_enterprise_use? v.terms_of_enterprise_use = 'some terms of enterprise use' assert v.has_terms_of_enterprise_use? v.terms_of_enterprise_use = '' - assert !v.has_terms_of_enterprise_use? + refute v.has_terms_of_enterprise_use? end def test_should_list_top_level_categories @@ -122,7 +122,7 @@ class EnvironmentTest < ActiveSupport::TestCase assert_equal 2, cats.size assert cats.include?(cat1) assert cats.include?(cat2) - assert !cats.include?(subcat) + refute cats.include?(subcat) end def test_should_list_all_categories @@ -157,18 +157,18 @@ class EnvironmentTest < ActiveSupport::TestCase should 'list displayable categories' do env = fast_create(Environment) cat1 = create(Category, :environment => env, :name => 'category one', :display_color => 'ffa500') - assert ! cat1.new_record? + refute cat1.new_record? # subcategories should be ignored subcat1 = create(Category, :environment => env, :name => 'subcategory one', :parent_id => cat1.id) - assert ! subcat1.new_record? + refute subcat1.new_record? cat2 = create(Category, :environment => env, :name => 'category two') - assert !cat2.new_record? + refute cat2.new_record? assert_equal 1, env.display_categories.size assert env.display_categories.include?(cat1) - assert !env.display_categories.include?(cat2) + refute env.display_categories.include?(cat2) end should 'have regions' do @@ -192,7 +192,7 @@ class EnvironmentTest < ActiveSupport::TestCase env.contact_email = 'test@example.com' env.valid? - assert !env.errors[:contact_email.to_s].present? + refute env.errors[:contact_email.to_s].present? end should 'notify contact email' do @@ -512,10 +512,10 @@ class EnvironmentTest < ActiveSupport::TestCase assert_kind_of Person, e.person_default_template # the templates must be private - assert !e.enterprise_default_template.visible? - assert !e.inactive_enterprise_template.visible? - assert !e.community_default_template.visible? - assert !e.person_default_template.visible? + refute e.enterprise_default_template.visible? + refute e.inactive_enterprise_template.visible? + refute e.community_default_template.visible? + refute e.person_default_template.visible? end should 'person_templates return all templates of person' do @@ -710,7 +710,7 @@ class EnvironmentTest < ActiveSupport::TestCase p2 = fast_create(Person, :is_template => true, :environment_id => env.id) env.person_default_template= p2.id - assert !env.is_default_template?(p1) + refute env.is_default_template?(p1) end should 'is_default_template? method identify a community default template as default' do @@ -722,7 +722,7 @@ class EnvironmentTest < ActiveSupport::TestCase c2 = fast_create(Community, :is_template => true, :environment_id => env.id) env.community_default_template= c2.id - assert !env.is_default_template?(c1) + refute env.is_default_template?(c1) end should 'is_default_template? method identify a enterprise default template as default' do @@ -734,7 +734,7 @@ class EnvironmentTest < ActiveSupport::TestCase e2 = fast_create(Enterprise, :is_template => true, :environment_id => env.id) env.enterprise_default_template= e2.id - assert !env.is_default_template?(e1) + refute env.is_default_template?(e1) end should 'have a layout template' do @@ -772,7 +772,7 @@ class EnvironmentTest < ActiveSupport::TestCase env.custom_person_fields = { 'birth_date' => {'required' => 'true', 'active' => 'true'}, 'cell_phone' => {'required' => 'true', 'active' => 'true'}} expected_hash = {'cell_phone' => {'required' => 'true', 'active' => 'true', 'signup' => 'true'}} assert(env.custom_person_fields.merge(expected_hash) == env.custom_person_fields) - assert ! env.custom_person_fields.keys.include?('birth_date') + refute env.custom_person_fields.keys.include?('birth_date') end should 'add schooling_status if custom_person_fields has schooling' do @@ -782,7 +782,7 @@ class EnvironmentTest < ActiveSupport::TestCase env.custom_person_fields = { 'schooling' => {'required' => 'true', 'active' => 'true'}} expected_hash = {'schooling' => {'required' => 'true', 'active' => 'true', 'signup' => 'true'}, 'schooling_status' => {'required' => 'true', 'signup' => 'true', 'active' => 'true'}} assert(env.custom_person_fields.merge(expected_hash) == env.custom_person_fields) - assert ! env.custom_person_fields.keys.include?('birth_date') + refute env.custom_person_fields.keys.include?('birth_date') end should 'return person_fields status' do @@ -846,7 +846,7 @@ class EnvironmentTest < ActiveSupport::TestCase env.custom_enterprise_fields = { 'contact_email' => {'required' => 'true', 'active' => 'true'}, 'contact_person' => {'required' => 'true', 'active' => 'true'}} assert_equal({'contact_person' => {'required' => 'true', 'signup' => 'true', 'active' => 'true'}}, env.custom_enterprise_fields) - assert ! env.custom_enterprise_fields.keys.include?('contact_email') + refute env.custom_enterprise_fields.keys.include?('contact_email') end should 'return enteprise_fields status' do @@ -889,7 +889,7 @@ class EnvironmentTest < ActiveSupport::TestCase env.custom_community_fields = { 'contact_email' => {'required' => 'true', 'active' => 'true'}, 'contact_person' => {'required' => 'true', 'active' => 'true'}} assert_equal({'contact_person' => {'required' => 'true', 'signup' => 'true', 'active' => 'true'}}, env.custom_community_fields) - assert ! env.custom_community_fields.keys.include?('contact_email') + refute env.custom_community_fields.keys.include?('contact_email') end should 'return community_fields status' do @@ -1165,7 +1165,7 @@ class EnvironmentTest < ActiveSupport::TestCase should "terms of use not be an blank string" do v = fast_create(Environment) v.terms_of_use = ' ' - assert !v.has_terms_of_use? + refute v.has_terms_of_use? end should 'have currency unit attribute' do @@ -1410,7 +1410,7 @@ class EnvironmentTest < ActiveSupport::TestCase environment.reports_lower_bound = 5 environment.valid? - assert !environment.errors[:reports_lower_bound.to_s].present? + refute environment.errors[:reports_lower_bound.to_s].present? end should 'be able to enable or disable a plugin with the class or class name' do @@ -1424,7 +1424,7 @@ class EnvironmentTest < ActiveSupport::TestCase environment.disable_plugin(Plugin.to_s) environment.reload - assert !environment.plugin_enabled?(Plugin) + refute environment.plugin_enabled?(Plugin) end should 'activate on database all available plugins' do @@ -1492,7 +1492,7 @@ class EnvironmentTest < ActiveSupport::TestCase Environment.login_redirection_options.keys.each do |redirection| environment.redirection_after_login = redirection environment.save - assert !environment.errors[:redirection_after_login.to_s].present? + refute environment.errors[:redirection_after_login.to_s].present? end end @@ -1513,7 +1513,7 @@ class EnvironmentTest < ActiveSupport::TestCase Environment.signup_redirection_options.keys.each do |redirection| environment.redirection_after_signup = redirection environment.save - assert !environment.errors[:redirection_after_signup.to_s].present? + refute environment.errors[:redirection_after_signup.to_s].present? end end @@ -1537,14 +1537,14 @@ class EnvironmentTest < ActiveSupport::TestCase should 'not consider signup welcome text if not defined' do env = Environment.default - assert !env.has_signup_welcome_text? + refute env.has_signup_welcome_text? end should 'not consider signup welcome text if nil' do env = Environment.default env.signup_welcome_text = nil - assert !env.has_signup_welcome_text? + refute env.has_signup_welcome_text? end should 'not consider signup welcome text if body is nil' do @@ -1553,7 +1553,7 @@ class EnvironmentTest < ActiveSupport::TestCase env.signup_welcome_text = { :subject => 'Welcome to the environment', } - assert !env.has_signup_welcome_text? + refute env.has_signup_welcome_text? end should 'consider signup welcome text if subject is nil but body is defined' do @@ -1604,7 +1604,7 @@ class EnvironmentTest < ActiveSupport::TestCase environment.default_language = 'en' environment.valid? - assert !environment.errors[:default_language.to_s].present? + refute environment.errors[:default_language.to_s].present? end should 'define default locale or use the config default locale' do @@ -1627,7 +1627,7 @@ class EnvironmentTest < ActiveSupport::TestCase environment.languages = ['en'] environment.valid? - assert !environment.errors[:languages.to_s].present? + refute environment.errors[:languages.to_s].present? end should 'define locales or use the config locales' do @@ -1655,14 +1655,14 @@ class EnvironmentTest < ActiveSupport::TestCase should 'not consider custom welcome screen text if not defined' do env = Environment.default - assert !env.has_custom_welcome_screen? + refute env.has_custom_welcome_screen? end should 'not consider custom welcome screen text if nil' do env = Environment.default env.signup_welcome_screen_body = nil - assert !env.has_custom_welcome_screen? + refute env.has_custom_welcome_screen? end should 'consider signup welcome screen if body is defined' do @@ -1699,7 +1699,7 @@ class EnvironmentTest < ActiveSupport::TestCase should 'has_license be false if there is no license in enviroment' do e = fast_create(Environment) - assert !e.has_license? + refute e.has_license? end should 'validates_inclusion_of date format' do @@ -1711,23 +1711,23 @@ class EnvironmentTest < ActiveSupport::TestCase environment.date_format = "numbers_with_year" environment.valid? - assert !environment.errors[:date_format.to_s].present? + refute environment.errors[:date_format.to_s].present? environment.date_format = "numbers" environment.valid? - assert !environment.errors[:date_format.to_s].present? + refute environment.errors[:date_format.to_s].present? environment.date_format = "month_name_with_year" environment.valid? - assert !environment.errors[:date_format.to_s].present? + refute environment.errors[:date_format.to_s].present? environment.date_format = "month_name" environment.valid? - assert !environment.errors[:date_format.to_s].present? + refute environment.errors[:date_format.to_s].present? environment.date_format = "past_time" environment.valid? - assert !environment.errors[:date_format.to_s].present? + refute environment.errors[:date_format.to_s].present? end end diff --git a/test/unit/event_test.rb b/test/unit/event_test.rb index d4559a5..fb3eb85 100644 --- a/test/unit/event_test.rb +++ b/test/unit/event_test.rb @@ -47,7 +47,7 @@ class EventTest < ActiveSupport::TestCase assert e.errors[:start_date.to_s].present? e.start_date = Date.today e.valid? - assert !e.errors[:start_date.to_s].present? + refute e.errors[:start_date.to_s].present? end should 'have a end date' do @@ -67,7 +67,7 @@ class EventTest < ActiveSupport::TestCase e.end_date = Date.new(2008,01,05) e.valid? - assert !e.errors[:start_date.to_s].present? + refute e.errors[:start_date.to_s].present? end should 'find by range of dates' do @@ -223,8 +223,8 @@ class EventTest < ActiveSupport::TestCase assert month_events.include?(current_month_event_1) assert month_events.include?(current_month_event_2) - assert !month_events.include?(last_month_event) - assert !month_events.include?(next_month_event) + refute month_events.include?(last_month_event) + refute month_events.include?(next_month_event) end should 'event by month ordered by start date'do @@ -339,7 +339,7 @@ class EventTest < ActiveSupport::TestCase event = Event.new(:profile => profile) - assert !event.translatable? + refute event.translatable? end should 'be translatable if there is languages on environment' do @@ -348,7 +348,7 @@ class EventTest < ActiveSupport::TestCase profile = fast_create(Person, :environment_id => environment.id) event = fast_create(Event, :profile_id => profile.id) - assert !event.translatable? + refute event.translatable? environment.languages = ['en','pt','fr'] diff --git a/test/unit/external_feed_test.rb b/test/unit/external_feed_test.rb index 9375a06..79dc881 100644 --- a/test/unit/external_feed_test.rb +++ b/test/unit/external_feed_test.rb @@ -21,7 +21,7 @@ class ExternalFeedTest < ActiveSupport::TestCase blog = create_blog e = create(:external_feed, blog: blog) assert e.add_item('Article title', 'http://orig.link.invalid', Time.now, 'Content for external post') - assert !e.add_item('Article title', 'http://orig.link.invalid', Time.now, 'Content for external post') + refute e.add_item('Article title', 'http://orig.link.invalid', Time.now, 'Content for external post') assert_equal 1, e.blog.posts.size end @@ -61,7 +61,7 @@ class ExternalFeedTest < ActiveSupport::TestCase should 'require address if enabled' do e = build(ExternalFeed, :enabled => true, :address => nil) - assert !e.valid? + refute e.valid? assert e.errors[:address].present? end diff --git a/test/unit/feed_handler_test.rb b/test/unit/feed_handler_test.rb index 413ef2e..02a1534 100644 --- a/test/unit/feed_handler_test.rb +++ b/test/unit/feed_handler_test.rb @@ -104,13 +104,13 @@ class FeedHandlerTest < ActiveSupport::TestCase # in the first 4 errors, we are ok 4.times { handler.process(container) } - assert !container.error_message.blank?, 'should set the error message for the first errors (%s)' % container_class + refute container.error_message.blank?, 'should set the error message for the first errors (%s)' % container_class assert container.enabled, 'must keep container enabled during the first errors (%s)' % container_class # 5 errors it too much handler.process(container) - assert !container.error_message.blank?, 'must set error message in container after errors (%s)' % container_class - assert !container.enabled, 'must disable continer after errors (%s)' % container_class + refute container.error_message.blank?, 'must set error message in container after errors (%s)' % container_class + refute container.enabled, 'must disable continer after errors (%s)' % container_class end should "reenable after (#{container_class})" do diff --git a/test/unit/forum_test.rb b/test/unit/forum_test.rb index ef90852..a4640f2 100644 --- a/test/unit/forum_test.rb +++ b/test/unit/forum_test.rb @@ -107,7 +107,7 @@ class ForumTest < ActiveSupport::TestCase should 'not accept uploads' do folder = fast_create(Forum) - assert !folder.accept_uploads? + refute folder.accept_uploads? end should 'be notifiable' do @@ -180,7 +180,7 @@ class ForumTest < ActiveSupport::TestCase forum = Forum.new(:profile => person) assert forum.can_create_topic?(person) - assert !forum.can_create_topic?(someone) + refute forum.can_create_topic?(someone) end should 'always allow topic creation to profile admins' do @@ -192,7 +192,7 @@ class ForumTest < ActiveSupport::TestCase forum = Forum.new(:profile => profile) assert forum.can_create_topic?(admin) - assert !forum.can_create_topic?(someone) + refute forum.can_create_topic?(someone) end should 'always allow topic creation to environment admins' do @@ -205,7 +205,7 @@ class ForumTest < ActiveSupport::TestCase forum = Forum.new(:profile => profile) assert forum.can_create_topic?(admin) - assert !forum.can_create_topic?(someone) + refute forum.can_create_topic?(someone) end should 'allow only person friends to create topics when topic_creation is related' do @@ -217,7 +217,7 @@ class ForumTest < ActiveSupport::TestCase forum = Forum.new(:profile => person, :topic_creation => 'related') assert forum.can_create_topic?(friend) - assert !forum.can_create_topic?(someone) + refute forum.can_create_topic?(someone) end should 'allow only group members to create topics when topic_creation is related' do @@ -229,7 +229,7 @@ class ForumTest < ActiveSupport::TestCase forum = Forum.new(:profile => organization, :topic_creation => 'related') assert forum.can_create_topic?(member) - assert !forum.can_create_topic?(someone) + refute forum.can_create_topic?(someone) end should 'allow every user to create topics when topic_creation is users' do @@ -238,6 +238,6 @@ class ForumTest < ActiveSupport::TestCase forum = Forum.new(:profile => profile, :topic_creation => 'users') assert forum.can_create_topic?(user) - assert !forum.can_create_topic?(nil) + refute forum.can_create_topic?(nil) end end diff --git a/test/unit/image_test.rb b/test/unit/image_test.rb index df721ad..0fad272 100644 --- a/test/unit/image_test.rb +++ b/test/unit/image_test.rb @@ -47,7 +47,7 @@ class ImageTest < ActiveSupport::TestCase end should 'return false by default in thumbnails_processed' do - assert !Image.new.thumbnails_processed + refute Image.new.thumbnails_processed end should 'set thumbnails_processed to true' do diff --git a/test/unit/input_test.rb b/test/unit/input_test.rb index 2caf05b..48f0591 100644 --- a/test/unit/input_test.rb +++ b/test/unit/input_test.rb @@ -11,7 +11,7 @@ class InputTest < ActiveSupport::TestCase input.product_category = product_category input.valid? - assert !input.errors[:product_category.to_s].present? + refute input.errors[:product_category.to_s].present? end should 'require product' do @@ -24,7 +24,7 @@ class InputTest < ActiveSupport::TestCase input.product = product input.valid? - assert !input.errors[:product.to_s].present? + refute input.errors[:product.to_s].present? end should 'store inputs ordered by position' do @@ -64,7 +64,7 @@ class InputTest < ActiveSupport::TestCase should 'dont have price details when price related fields was not filled' do input = Input.new - assert !input.has_price_details? + refute input.has_price_details? end should 'has price details if price_per_unit filled' do @@ -79,7 +79,7 @@ class InputTest < ActiveSupport::TestCase should 'not have price details if only unit is filled' do input = build(Input, :unit => Unit.new) - assert !input.has_price_details? + refute input.has_price_details? end should 'accept price_per_unit in american\'s or brazilian\'s currency format' do diff --git a/test/unit/invite_friend_test.rb b/test/unit/invite_friend_test.rb index e2b2686..dc2df61 100644 --- a/test/unit/invite_friend_test.rb +++ b/test/unit/invite_friend_test.rb @@ -116,10 +116,10 @@ class InviteFriendTest < ActiveSupport::TestCase p = create_user('testuser1').person task1 = InviteFriend.new(:person => p, :friend => p, :message => 'click here: ') - assert !task1.save + refute task1.save task2 = InviteFriend.new(:person => p, :friend_name => 'Myself', :friend_email => p.user.email, :message => 'click here: ') - assert !task2.save + refute task2.save end should 'have target notification description' do diff --git a/test/unit/invite_member_test.rb b/test/unit/invite_member_test.rb index 0537a93..a64b4e1 100644 --- a/test/unit/invite_member_test.rb +++ b/test/unit/invite_member_test.rb @@ -107,10 +107,10 @@ class InviteMemberTest < ActiveSupport::TestCase p = create_user('testuser1').person task1 = build(InviteMember, :person => p, :friend => p, :message => 'click here: ') - assert !task1.save + refute task1.save task2 = build(InviteMember, :person => p, :friend_name => 'Myself', :friend_email => p.user.email, :message => 'click here: ') - assert !task2.save + refute task2.save end should 'have target notification description' do diff --git a/test/unit/license_test.rb b/test/unit/license_test.rb index ec1eb32..ffb2084 100644 --- a/test/unit/license_test.rb +++ b/test/unit/license_test.rb @@ -10,8 +10,8 @@ class LicenseTest < ActiveSupport::TestCase license.name = 'GPLv3' license.environment = Environment.default license.valid? - assert !license.errors[:name].any? - assert !license.errors[:environment].any? + refute license.errors[:name].any? + refute license.errors[:environment].any? end should 'fill in slug before creation' do diff --git a/test/unit/mailing_test.rb b/test/unit/mailing_test.rb index 5d7730e..1b1d3f3 100644 --- a/test/unit/mailing_test.rb +++ b/test/unit/mailing_test.rb @@ -27,7 +27,7 @@ class MailingTest < ActiveSupport::TestCase mailing.source_id = Environment.default.id mailing.valid? - assert !mailing.errors[:source_id.to_s].present? + refute mailing.errors[:source_id.to_s].present? end should 'require subject' do @@ -37,7 +37,7 @@ class MailingTest < ActiveSupport::TestCase mailing.subject = 'Hello :)' mailing.valid? - assert !mailing.errors[:subject.to_s].present? + refute mailing.errors[:subject.to_s].present? end should 'require body' do @@ -47,7 +47,7 @@ class MailingTest < ActiveSupport::TestCase mailing.body = 'We have some news!' mailing.valid? - assert !mailing.errors[:body.to_s].present? + refute mailing.errors[:body.to_s].present? end should 'return source' do diff --git a/test/unit/main_block_test.rb b/test/unit/main_block_test.rb index 1124416..3973f7a 100644 --- a/test/unit/main_block_test.rb +++ b/test/unit/main_block_test.rb @@ -26,7 +26,7 @@ class MainBlockTest < ActiveSupport::TestCase env = Environment.new block = MainBlock.new(:display => 'never') block.stubs(:owner).returns(env) - assert !block.visible? + refute block.visible? end should 'guarantee main block is always visible to everybody' do diff --git a/test/unit/moderate_user_registration_test.rb b/test/unit/moderate_user_registration_test.rb index 0bf0887..7f632ad 100644 --- a/test/unit/moderate_user_registration_test.rb +++ b/test/unit/moderate_user_registration_test.rb @@ -15,7 +15,7 @@ class ModerateUserRegistrationTest < ActiveSupport::TestCase t.email = user.email t.target= environment t.save! - assert !user.activated? + refute user.activated? t.perform assert environment.users.find_by_id(user.id).activated? end diff --git a/test/unit/multi_tenancy.rb b/test/unit/multi_tenancy.rb index 3c89342..ce1333d 100644 --- a/test/unit/multi_tenancy.rb +++ b/test/unit/multi_tenancy.rb @@ -31,7 +31,7 @@ class MultiTenancyTest < ActiveSupport::TestCase def test_multitenancy_is_off_if_it_is_not_a_hosted_environment_and_there_is_no_mapping Noosfero::MultiTenancy.expects(:mapping).returns({}) Noosfero::MultiTenancy.expects(:is_hosted_environment?).returns(false) - assert !Noosfero::MultiTenancy.on? + refute Noosfero::MultiTenancy.on? end def test_set_schema_by_host @@ -54,7 +54,7 @@ class MultiTenancyTest < ActiveSupport::TestCase def test_if_is_not_hosted_environment YAML.expects(:load_file).returns(db_config) - assert !Noosfero::MultiTenancy.send(:is_hosted_environment?) + refute Noosfero::MultiTenancy.send(:is_hosted_environment?) end private diff --git a/test/unit/national_region_test.rb b/test/unit/national_region_test.rb index e3484b4..25345a6 100644 --- a/test/unit/national_region_test.rb +++ b/test/unit/national_region_test.rb @@ -27,7 +27,7 @@ class NationalRegionTest < ActiveSupport::TestCase found_regions = NationalRegion.search_city('Santo %', true) - assert !(found_regions.length != 3) + refute (found_regions.length != 3) found_regions.each do |region| assert city_names.find_index(region.city) >= 0 @@ -60,7 +60,7 @@ class NationalRegionTest < ActiveSupport::TestCase found_regions = NationalRegion.search_state('Rio %', true) - assert !(found_regions.length != 3) + refute (found_regions.length != 3) found_regions.each do |region| assert state_names.find_index(region.state) >= 0 diff --git a/test/unit/notify_activity_to_profiles_job_test.rb b/test/unit/notify_activity_to_profiles_job_test.rb index 08094d1..57e1ad9 100644 --- a/test/unit/notify_activity_to_profiles_job_test.rb +++ b/test/unit/notify_activity_to_profiles_job_test.rb @@ -28,7 +28,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase person = fast_create(Person) community = fast_create(Community) action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :verb => 'create_article') - assert !NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) + refute NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) p1, p2, m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) fast_create(Friendship, :person_id => person.id, :friend_id => p1.id) fast_create(Friendship, :person_id => person.id, :friend_id => p2.id) @@ -50,7 +50,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase person = fast_create(Person) community = fast_create(Community) action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :target_id => community.id, :verb => 'create_article') - assert !NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) + refute NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) fast_create(RoleAssignment, :accessor_id => m1.id, :role_id => 3, :resource_id => community.id) fast_create(RoleAssignment, :accessor_id => m2.id, :role_id => 3, :resource_id => community.id) @@ -70,7 +70,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase person = fast_create(Person) community = fast_create(Community) action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :target_id => community.id, :verb => 'create_article') - assert !NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) + refute NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) p1, p2, m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) fast_create(Friendship, :person_id => person.id, :friend_id => p1.id) fast_create(Friendship, :person_id => person.id, :friend_id => p2.id) @@ -92,7 +92,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase person = fast_create(Person) private_community = fast_create(Community, :public_profile => false) action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :target_id => private_community.id, :verb => 'create_article') - assert !NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) + refute NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) p1, p2, m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) fast_create(Friendship, :person_id => person.id, :friend_id => p1.id) fast_create(Friendship, :person_id => person.id, :friend_id => p2.id) @@ -117,7 +117,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase person = fast_create(Person) community = fast_create(Community) action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :target_id => community.id, :verb => 'join_community') - assert !NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) + refute NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) p1, p2, m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) fast_create(Friendship, :person_id => person.id, :friend_id => p1.id) fast_create(Friendship, :person_id => person.id, :friend_id => p2.id) diff --git a/test/unit/organization_mailing_test.rb b/test/unit/organization_mailing_test.rb index 674b144..923c7cf 100644 --- a/test/unit/organization_mailing_test.rb +++ b/test/unit/organization_mailing_test.rb @@ -22,7 +22,7 @@ class OrganizationMailingTest < ActiveSupport::TestCase mailing.source_id = community.id mailing.valid? - assert !mailing.errors[:source_id.to_s].present? + refute mailing.errors[:source_id.to_s].present? end should 'return community name' do @@ -115,7 +115,7 @@ class OrganizationMailingTest < ActiveSupport::TestCase mailing = create(OrganizationMailing, :source => community, :subject => 'Hello', :body => 'We have some news', :person => person) process_delayed_job_queue - assert !mailing.mailing_sents.find_by_person_id(recipient.id) + refute mailing.mailing_sents.find_by_person_id(recipient.id) end protected diff --git a/test/unit/organization_test.rb b/test/unit/organization_test.rb index 5aab807..f172f3c 100644 --- a/test/unit/organization_test.rb +++ b/test/unit/organization_test.rb @@ -80,11 +80,11 @@ class OrganizationTest < ActiveSupport::TestCase should 'validate contact_email if filled' do org = Organization.new org.valid? - assert !org.errors[:contact_email.to_s].present? + refute org.errors[:contact_email.to_s].present? org.contact_email = '' org.valid? - assert !org.errors[:contact_email.to_s].present? + refute org.errors[:contact_email.to_s].present? org.contact_email = 'invalid-email' @@ -93,7 +93,7 @@ class OrganizationTest < ActiveSupport::TestCase org.contact_email = 'someone@somedomain.com' org.valid? - assert !org.errors[:contact_email.to_s].present? + refute org.errors[:contact_email.to_s].present? end should 'list contact_email plus admin emails as "notification emails"' do @@ -191,7 +191,7 @@ class OrganizationTest < ActiveSupport::TestCase org.foundation_year = 2007 org.valid? - assert ! org.errors[:foundation_year.to_s].present? + refute org.errors[:foundation_year.to_s].present? end should 'has closed' do @@ -245,7 +245,7 @@ class OrganizationTest < ActiveSupport::TestCase should 'be closed if organization is not public' do organization = fast_create(Organization) - assert !organization.closed + refute organization.closed organization.public_profile = false organization.save! @@ -278,11 +278,11 @@ class OrganizationTest < ActiveSupport::TestCase p2 = fast_create(Person) p3 = fast_create(Person) - assert !p1.is_member_of?(o) + refute p1.is_member_of?(o) o.add_member(p1) assert p1.is_member_of?(o) - assert !p3.is_member_of?(o) + refute p3.is_member_of?(o) o.add_member(p3) assert p3.is_member_of?(o) @@ -380,7 +380,7 @@ class OrganizationTest < ActiveSupport::TestCase organization.cnpj = '94.132.024/0001-48' organization.valid? - assert !organization.errors[:cnpj.to_s].present? + refute organization.errors[:cnpj.to_s].present? end should 'get members by role' do @@ -429,7 +429,7 @@ class OrganizationTest < ActiveSupport::TestCase assert organization.visible organization.disable - assert !organization.visible + refute organization.visible end should 'increase members_count on new membership' do @@ -467,14 +467,14 @@ class OrganizationTest < ActiveSupport::TestCase member = create_user('memberuser').person c.add_member(member) - assert !c.is_admin?(member) + refute c.is_admin?(member) end should 'a moderator user not be a community admin' do c = fast_create(Organization, :name => 'my test profile', :identifier => 'mytestprofile') moderator = create_user('moderatoruser').person c.add_moderator(moderator) - assert !c.is_admin?(moderator) + refute c.is_admin?(moderator) end end diff --git a/test/unit/person_notifier_test.rb b/test/unit/person_notifier_test.rb index 59c93b4..f5bfc16 100644 --- a/test/unit/person_notifier_test.rb +++ b/test/unit/person_notifier_test.rb @@ -184,11 +184,11 @@ class PersonNotifierTest < ActiveSupport::TestCase should 'exists? method in NotifyAllJob return false if there is no instance of this class created' do Delayed::Job.enqueue(PersonNotifier::NotifyJob.new) - assert !PersonNotifier::NotifyAllJob.exists? + refute PersonNotifier::NotifyAllJob.exists? end should 'exists? method in NotifyAllJob return false if there is no jobs created' do - assert !PersonNotifier::NotifyAllJob.exists? + refute PersonNotifier::NotifyAllJob.exists? end 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 process_delayed_job_queue jobs = PersonNotifier::NotifyJob.find(@member.id) - assert !jobs.select {|j| !j.failed? && j.last_error.nil? }.empty? + refute jobs.select {|j| !j.failed? && j.last_error.nil? }.empty? end should 'render image tags for both internal and external src' do diff --git a/test/unit/person_test.rb b/test/unit/person_test.rb index a2cb697..8d00f9a 100644 --- a/test/unit/person_test.rb +++ b/test/unit/person_test.rb @@ -6,9 +6,9 @@ class PersonTest < ActiveSupport::TestCase def test_person_must_come_from_the_creation_of_an_user p = build(Person, :environment => Environment.default, :name => 'John', :identifier => 'john') - assert !p.valid? + refute p.valid? p.user = create_user('john', :email => 'john@doe.org', :password => 'dhoe', :password_confirmation => 'dhoe') - assert !p.valid? + refute p.valid? p = create_user('johnz', :email => 'johnz@doe.org', :password => 'dhoe', :password_confirmation => 'dhoe').person assert p.valid? end @@ -59,7 +59,7 @@ class PersonTest < ActiveSupport::TestCase p2 = build(Person, :environment => Environment.default) p2.user = u - assert !p2.valid? + refute p2.valid? assert p2.errors[:user_id.to_s].present? end @@ -86,7 +86,7 @@ class PersonTest < ActiveSupport::TestCase assert p.define_roles([r2], e) p = Person.find(p.id) assert p.role_assignments.any? {|ra| ra.role == r2} - assert !p.role_assignments.any? {|ra| ra.role == r1} + refute p.role_assignments.any? {|ra| ra.role == r1} end should 'report that the user has the permission' do @@ -97,7 +97,7 @@ class PersonTest < ActiveSupport::TestCase p = Person.find(p.id) assert e.reload assert p.has_permission?('edit_profile', e) - assert !p.has_permission?('destroy_profile', e) + refute p.has_permission?('destroy_profile', e) end should 'get an email address from the associated user instance' do @@ -144,7 +144,7 @@ class PersonTest < ActiveSupport::TestCase other = create_user('user', :email => 'other@example.com', :environment => other_env).person other.email = 'user@example.com' other.valid? - assert !other.errors[:email.to_s].present? + refute other.errors[:email.to_s].present? end should 'be an admin if have permission of environment administration' do @@ -152,7 +152,7 @@ class PersonTest < ActiveSupport::TestCase env = fast_create(Environment) person = create_user('just_another_person').person env.affiliate(person, role) - assert ! person.is_admin?(env) + refute person.is_admin?(env) role.update_attributes(:permissions => ['view_environment_admin_panel']) person = Person.find(person.id) assert person.is_admin?(env) @@ -172,7 +172,7 @@ class PersonTest < ActiveSupport::TestCase person = Person.find(person.id) assert person.is_admin?(env1) - assert !person.is_admin?(env2) + refute person.is_admin?(env2) end should 'create a default set of articles' do @@ -187,9 +187,9 @@ class PersonTest < ActiveSupport::TestCase should 'create a default set of blocks' do p = create(User).person - assert !p.boxes[0].blocks.empty?, 'person must have blocks in area 1' - assert !p.boxes[1].blocks.empty?, 'person must have blocks in area 2' - assert !p.boxes[2].blocks.empty?, 'person must have blocks in area 3' + refute p.boxes[0].blocks.empty?, 'person must have blocks in area 1' + refute p.boxes[1].blocks.empty?, 'person must have blocks in area 2' + refute p.boxes[2].blocks.empty?, 'person must have blocks in area 3' end should 'link to all articles created by default' do @@ -317,7 +317,7 @@ class PersonTest < ActiveSupport::TestCase should 'required name' do person = Person.new - assert !person.valid? + refute person.valid? assert person.errors[:name].present? end @@ -325,7 +325,7 @@ class PersonTest < ActiveSupport::TestCase p1 = create_user('testuser1').person p2 = create_user('testuser2').person create(AddFriend, person: p1, friend: p2).finish - assert !p1.already_request_friendship?(p2) + refute p1.already_request_friendship?(p2) create(AddFriend, person: p1, friend: p2) assert p1.already_request_friendship?(p2) end @@ -394,7 +394,7 @@ class PersonTest < ActiveSupport::TestCase p1 = create_user('user_with_tasks').person c1 = fast_create(Community) c1.tasks << Task.new - assert !c1.tasks.pending.empty? + refute c1.tasks.pending.empty? c1.add_admin(p1) c2 = fast_create(Community) @@ -463,12 +463,12 @@ class PersonTest < ActiveSupport::TestCase e = Environment.default e.expects(:required_person_fields).returns(['cell_phone']).at_least_once person = build(Person, :environment => e) - assert ! person.valid? + refute person.valid? assert person.errors[:cell_phone.to_s].present? person.cell_phone = '99999' person.valid? - assert ! person.errors[:cell_phone.to_s].present? + refute person.errors[:cell_phone.to_s].present? end should 'require custom_area_of_study if area_of_study is others' do @@ -476,12 +476,12 @@ class PersonTest < ActiveSupport::TestCase e.expects(:required_person_fields).returns(['area_of_study', 'custom_area_of_study']).at_least_once person = build(Person, :environment => e, :area_of_study => 'Others') - assert !person.valid? + refute person.valid? assert person.errors[:custom_area_of_study.to_s].present? person.custom_area_of_study = 'Customized area of study' person.valid? - assert ! person.errors[:custom_area_of_study.to_s].present? + refute person.errors[:custom_area_of_study.to_s].present? end should 'not require custom_area_of_study if area_of_study is not others' do @@ -490,7 +490,7 @@ class PersonTest < ActiveSupport::TestCase person = build(Person, :environment => e, :area_of_study => 'Agrometeorology') person.valid? - assert ! person.errors[:custom_area_of_study.to_s].present? + refute person.errors[:custom_area_of_study.to_s].present? end should 'require custom_formation if formation is others' do @@ -498,12 +498,12 @@ class PersonTest < ActiveSupport::TestCase e.expects(:required_person_fields).returns(['formation', 'custom_formation']).at_least_once person = build(Person, :environment => e, :formation => 'Others') - assert !person.valid? + refute person.valid? assert person.errors[:custom_formation.to_s].present? person.custom_formation = 'Customized formation' person.valid? - assert ! person.errors[:custom_formation.to_s].present? + refute person.errors[:custom_formation.to_s].present? end should 'not require custom_formation if formation is not others' do @@ -511,20 +511,20 @@ class PersonTest < ActiveSupport::TestCase e.expects(:required_person_fields).returns(['formation']).at_least_once person = build(Person, :environment => e, :formation => 'Agrometeorology') - assert !person.valid? - assert ! person.errors[:custom_formation.to_s].present? + refute person.valid? + refute person.errors[:custom_formation.to_s].present? end should 'not require fields if person is a template' do e = Environment.default e.expects(:required_person_fields).returns(['cell_phone']).at_least_once person = build(Person, :environment => e) - assert ! person.valid? + refute person.valid? assert person.errors[:cell_phone.to_s].present? person.is_template = true person.valid? - assert ! person.errors[:cell_phone.to_s].present? + refute person.errors[:cell_phone.to_s].present? end should 'identify when person is a friend' do @@ -538,7 +538,7 @@ class PersonTest < ActiveSupport::TestCase should 'identify when person isnt a friend' do p1 = create_user('testuser1').person p2 = create_user('testuser2').person - assert !p1.is_a_friend?(p2) + refute p1.is_a_friend?(p2) end should 'refuse join community' do @@ -547,7 +547,7 @@ class PersonTest < ActiveSupport::TestCase assert p.ask_to_join?(c) p.refuse_join(c) - assert !p.ask_to_join?(c) + refute p.ask_to_join?(c) end should 'not ask to join for a member' do @@ -555,7 +555,7 @@ class PersonTest < ActiveSupport::TestCase c = fast_create(Community) c.add_member(p) - assert !p.ask_to_join?(c) + refute p.ask_to_join?(c) end should 'not ask to join if already asked' do @@ -563,7 +563,7 @@ class PersonTest < ActiveSupport::TestCase c = fast_create(Community) create(AddMember, :person => p, :organization => c) - assert !p.ask_to_join?(c) + refute p.ask_to_join?(c) end should 'ask to join if community is not public' do @@ -577,7 +577,7 @@ class PersonTest < ActiveSupport::TestCase person = fast_create(Person) community = fast_create(Community, :visible => false) - assert !person.ask_to_join?(community) + refute person.ask_to_join?(community) end should 'save organization_website with http' do @@ -606,7 +606,7 @@ class PersonTest < ActiveSupport::TestCase p2 = create_user('testuser2').person assert p1.add_friend(p2) assert Profile['testuser1'].is_a_friend?(p2) - assert !Profile['testuser1'].add_friend(p2) + refute Profile['testuser1'].add_friend(p2) end should 'not raise exception when validates person without e-mail' do @@ -614,7 +614,7 @@ class PersonTest < ActiveSupport::TestCase person.user.email = nil assert_nothing_raised ActiveRecord::RecordInvalid do - assert !person.save + refute person.save end end @@ -766,11 +766,11 @@ class PersonTest < ActiveSupport::TestCase p2 = fast_create(Person) p3 = fast_create(Person) - assert !p1.is_member_of?(c) + refute p1.is_member_of?(c) c.add_member(p1) assert p1.is_member_of?(c) - assert !p3.is_member_of?(c) + refute p3.is_member_of?(c) c.add_member(p3) assert p3.is_member_of?(c) @@ -786,11 +786,11 @@ class PersonTest < ActiveSupport::TestCase p2 = fast_create(Person) p3 = fast_create(Person) - assert !p1.is_member_of?(e) + refute p1.is_member_of?(e) e.add_member(p1) assert p1.is_member_of?(e) - assert !p3.is_member_of?(e) + refute p3.is_member_of?(e) e.add_member(p3) assert p3.is_member_of?(e) @@ -843,7 +843,7 @@ class PersonTest < ActiveSupport::TestCase p1.add_friend(p2) assert p1.is_a_friend?(p2) - assert !p1.is_a_friend?(p3) + refute p1.is_a_friend?(p3) p1.add_friend(p4) assert p1.is_a_friend?(p4) @@ -867,7 +867,7 @@ class PersonTest < ActiveSupport::TestCase p1.add_friend(p2) assert p1.is_a_friend?(p2) - assert !p1.is_a_friend?(p3) + refute p1.is_a_friend?(p3) p1.add_friend(p4) assert p1.is_a_friend?(p4) @@ -886,7 +886,7 @@ class PersonTest < ActiveSupport::TestCase p1.add_friend(p2) assert p1.is_a_friend?(p2) - assert !p1.is_a_friend?(p3) + refute p1.is_a_friend?(p3) p1.add_friend(p4) assert p1.is_a_friend?(p4) @@ -913,7 +913,7 @@ class PersonTest < ActiveSupport::TestCase assert p1.is_member_of?(community) community.add_member(p3) assert p3.is_member_of?(community) - assert !p2.is_member_of?(community) + refute p2.is_member_of?(community) process_delayed_job_queue action_tracker = fast_create(ActionTracker::Record, :verb => 'create_article') @@ -943,7 +943,7 @@ class PersonTest < ActiveSupport::TestCase assert p3.is_member_of?(community) community.add_member(p4) assert p4.is_member_of?(community) - assert !p2.is_member_of?(community) + refute p2.is_member_of?(community) action_tracker = fast_create(ActionTracker::Record) article = mock() @@ -990,14 +990,14 @@ class PersonTest < ActiveSupport::TestCase p1, p2 = fast_create(Person), fast_create(Person) s = fast_create(Scrap, :sender_id => p1.id, :receiver_id => p1.id) assert p1.can_control_scrap?(s) - assert !p2.can_control_scrap?(s) + refute p2.can_control_scrap?(s) end should "control activity or not" do p1, p2 = fast_create(Person), fast_create(Person) a = fast_create(ActionTracker::Record, :user_id => p2.id) n = fast_create(ActionTrackerNotification, :profile_id => p2.id, :action_tracker_id => a.id) - assert !p1.reload.can_control_activity?(a) + refute p1.reload.can_control_activity?(a) assert p2.reload.can_control_activity?(a) end @@ -1121,7 +1121,7 @@ class PersonTest < ActiveSupport::TestCase organization.add_admin(person) assert person.is_last_admin_leaving?(organization, []) - assert !person.is_last_admin_leaving?(organization, [Role.find_by_key('profile_admin')]) + refute person.is_last_admin_leaving?(organization, [Role.find_by_key('profile_admin')]) end should 'return unique members of a community' do @@ -1226,7 +1226,7 @@ class PersonTest < ActiveSupport::TestCase should 'check if person already reported profile' do person = create_user('some-user').person profile = fast_create(Profile) - assert !person.already_reported?(profile) + refute person.already_reported?(profile) person.register_report(build(AbuseReport, :reason => 'some reason'), profile) person.reload @@ -1240,7 +1240,7 @@ class PersonTest < ActiveSupport::TestCase person.disable - assert !person.visible + refute person.visible assert_not_equal password, person.user.password end @@ -1334,7 +1334,7 @@ class PersonTest < ActiveSupport::TestCase person = create_user('person').person assert abuser.abuser? - assert !person.abuser? + refute person.abuser? end should 'be able to retrieve abusers and non abusers' do @@ -1661,19 +1661,19 @@ class PersonTest < ActiveSupport::TestCase comment = fast_create(Comment) person = fast_create(Person) - assert !person.voted_for?(comment) + refute person.voted_for?(comment) person.vote_for(comment) assert person.voted_for?(comment) - assert !person.voted_against?(comment) + refute person.voted_against?(comment) end should 'vote against a comment' do comment = fast_create(Comment) person = fast_create(Person) - assert !person.voted_against?(comment) + refute person.voted_against?(comment) person.vote_against(comment) - assert !person.voted_for?(comment) + refute person.voted_for?(comment) assert person.voted_against?(comment) end @@ -1682,7 +1682,7 @@ class PersonTest < ActiveSupport::TestCase person = fast_create(Person) assert person.vote_against(comment) - assert !person.vote_against(comment) + refute person.vote_against(comment) end should 'do not vote for a comment twice' do @@ -1690,7 +1690,7 @@ class PersonTest < ActiveSupport::TestCase person = fast_create(Person) assert person.vote_for(comment) - assert !person.vote_for(comment) + refute person.vote_for(comment) end should 'not vote against a voted for comment' do @@ -1700,7 +1700,7 @@ class PersonTest < ActiveSupport::TestCase person.vote_for(comment) person.vote_against(comment) assert person.voted_for?(comment) - assert !person.voted_against?(comment) + refute person.voted_against?(comment) end should 'not vote for a voted against comment' do @@ -1709,7 +1709,7 @@ class PersonTest < ActiveSupport::TestCase person.vote_against(comment) person.vote_for(comment) - assert !person.voted_for?(comment) + refute person.voted_for?(comment) assert person.voted_against?(comment) end @@ -1720,7 +1720,7 @@ class PersonTest < ActiveSupport::TestCase person.vote_for(comment) assert person.voted_for?(comment) person.votes.for_voteable(comment).destroy_all - assert !person.voted_for?(comment) + refute person.voted_for?(comment) end should 'count comments voted' do @@ -1751,19 +1751,19 @@ class PersonTest < ActiveSupport::TestCase article = fast_create(Article) person = fast_create(Person) - assert !person.voted_for?(article) + refute person.voted_for?(article) person.vote_for(article) assert person.voted_for?(article) - assert !person.voted_against?(article) + refute person.voted_against?(article) end should 'vote against a article' do article = fast_create(Article) person = fast_create(Person) - assert !person.voted_against?(article) + refute person.voted_against?(article) person.vote_against(article) - assert !person.voted_for?(article) + refute person.voted_for?(article) assert person.voted_against?(article) end diff --git a/test/unit/product_categories_block_test.rb b/test/unit/product_categories_block_test.rb index cc71da9..1680c22 100644 --- a/test/unit/product_categories_block_test.rb +++ b/test/unit/product_categories_block_test.rb @@ -11,7 +11,7 @@ class ProductCategoriesBlockTest < ActiveSupport::TestCase assert block.visible? block.box.environment.disable('products_for_enterprises') - assert !block.visible? + refute block.visible? end should 'have display option to show only on catalog' do @@ -29,7 +29,7 @@ class ProductCategoriesBlockTest < ActiveSupport::TestCase block.box = box block.box.environment.enable('products_for_enterprises') - assert !block.visible?(:params => {:controller => 'any_other'}) + refute block.visible?(:params => {:controller => 'any_other'}) assert block.visible?(:params => {:controller => 'catalog'}) end end diff --git a/test/unit/product_test.rb b/test/unit/product_test.rb index afd5de9..38f8c9f 100644 --- a/test/unit/product_test.rb +++ b/test/unit/product_test.rb @@ -130,7 +130,7 @@ class ProductTest < ActiveSupport::TestCase e1.public_profile = false e1.save!; p1.reload; - assert !p1.public? + refute p1.public? end should 'accept prices in american\'s or brazilian\'s currency format' do @@ -267,7 +267,7 @@ class ProductTest < ActiveSupport::TestCase should 'has basic info if filled unit, price or discount' do product = Product.new - assert !product.has_basic_info? + refute product.has_basic_info? product = build(Product, :unit => Unit.new) assert product.has_basic_info? @@ -349,7 +349,7 @@ class ProductTest < ActiveSupport::TestCase product = fast_create(Product, :price => 30.0) first = fast_create(Input, :product_id => product.id, :product_category_id => fast_create(ProductCategory).id, :price_per_unit => 20.0, :amount_used => 1) - assert !Product.find(product.id).price_described? + refute Product.find(product.id).price_described? second = fast_create(Input, :product_id => product.id, :product_category_id => fast_create(ProductCategory).id, :price_per_unit => 10.0, :amount_used => 1) assert Product.find(product.id).price_described? @@ -375,7 +375,7 @@ class ProductTest < ActiveSupport::TestCase cost = fast_create(ProductionCost, :owner_id => Environment.default.id, :owner_type => 'Environment') cost2 = fast_create(ProductionCost, :owner_id => Environment.default.id, :owner_type => 'Environment') price_detail = product.price_details.create(:production_cost_id => cost.id, :price => 10) - assert !product.price_details.empty? + refute product.price_details.empty? product.update_price_details([{:production_cost_id => cost.id, :price => 20}, {:production_cost_id => cost2.id, :price => 30}]) assert_equal 20, product.price_details.find_by_production_cost_id(cost.id).price diff --git a/test/unit/production_cost_test.rb b/test/unit/production_cost_test.rb index 591b731..15017a9 100644 --- a/test/unit/production_cost_test.rb +++ b/test/unit/production_cost_test.rb @@ -9,7 +9,7 @@ class ProductionCostTest < ActiveSupport::TestCase p.name = 'Taxes' p.valid? - assert !p.errors[:name.to_s].present? + refute p.errors[:name.to_s].present? end should 'not validates name if it is blank' do @@ -28,7 +28,7 @@ class ProductionCostTest < ActiveSupport::TestCase p.name = 'a'*30 p.valid? - assert !p.errors[:name.to_s].present? + refute p.errors[:name.to_s].present? end should 'not have duplicated name on same environment' do @@ -58,7 +58,7 @@ class ProductionCostTest < ActiveSupport::TestCase cost2.valid? - assert !cost2.errors[:name.to_s].present? + refute cost2.errors[:name.to_s].present? end should 'allow duplicated name on different enterprises' do @@ -70,7 +70,7 @@ class ProductionCostTest < ActiveSupport::TestCase cost2.valid? - assert !cost2.errors[:name.to_s].present? + refute cost2.errors[:name.to_s].present? end should 'be associated to an environment as owner' do @@ -80,7 +80,7 @@ class ProductionCostTest < ActiveSupport::TestCase p.owner = Environment.default p.valid? - assert !p.errors[:owner.to_s].present? + refute p.errors[:owner.to_s].present? end should 'be associated to an enterprise as owner' do @@ -91,7 +91,7 @@ class ProductionCostTest < ActiveSupport::TestCase p.owner = enterprise p.valid? - assert !p.errors[:owner.to_s].present? + refute p.errors[:owner.to_s].present? end should 'create a production cost on an enterprise' do diff --git a/test/unit/profile_test.rb b/test/unit/profile_test.rb index 7bf13da..9d420e1 100644 --- a/test/unit/profile_test.rb +++ b/test/unit/profile_test.rb @@ -19,19 +19,19 @@ class ProfileTest < ActiveSupport::TestCase p.identifier = 'rightformat2007' p.valid? - assert ! p.errors[:identifier.to_s].present? + refute p.errors[:identifier.to_s].present? p.identifier = 'rightformat' p.valid? - assert ! p.errors[:identifier.to_s].present? + refute p.errors[:identifier.to_s].present? p.identifier = 'right_format' p.valid? - assert ! p.errors[:identifier.to_s].present? + refute p.errors[:identifier.to_s].present? p.identifier = 'identifier-with-dashes' p.valid? - assert ! p.errors[:identifier.to_s].present?, 'Profile should accept identifier with dashes' + refute p.errors[:identifier.to_s].present?, 'Profile should accept identifier with dashes' end def test_has_domains @@ -63,11 +63,11 @@ class ProfileTest < ActiveSupport::TestCase should 'set default environment for users created' do user = create_user 'mytestuser' assert_equal 'mytestuser', user.login - assert !user.new_record? + refute user.new_record? p = user.person - assert !p.new_record? + refute p.new_record? assert_equal 'mytestuser', p.identifier e = p.environment assert_equal Environment.default, e @@ -84,7 +84,7 @@ class ProfileTest < ActiveSupport::TestCase assert p.errors[:name.to_s].present? p.name = 'a very unprobable name' p.valid? - assert !p.errors[:name.to_s].present? + refute p.errors[:name.to_s].present? end def test_can_have_affiliated_people @@ -178,7 +178,7 @@ class ProfileTest < ActiveSupport::TestCase top = profile.top_level_articles assert top.include?(p1) assert top.include?(p2) - assert !top.include?(child) + refute top.include?(child) end should 'be able to optionally reload the list of top level articles' do @@ -420,15 +420,15 @@ class ProfileTest < ActiveSupport::TestCase should 'not advertise articles created together with the profile' do Profile.any_instance.stubs(:default_set_of_articles).returns([Article.new(:name => 'home'), RssFeed.new(:name => 'feed')]) profile = create(Profile) - assert !profile.articles.find_by_path('home').advertise? - assert !profile.articles.find_by_path('feed').advertise? + refute profile.articles.find_by_path('home').advertise? + refute profile.articles.find_by_path('feed').advertise? end should 'advertise article after update' do Profile.any_instance.stubs(:default_set_of_articles).returns([Article.new(:name => 'home')]) profile = create(Profile) article = profile.articles.find_by_path('home') - assert !article.advertise? + refute article.advertise? article.name = 'Changed name' article.save! assert article.advertise? @@ -482,7 +482,7 @@ class ProfileTest < ActiveSupport::TestCase end should 'not display private profile to unauthenticated user' do - assert !Profile.new(:public_profile => false).display_info_to?(nil) + refute Profile.new(:public_profile => false).display_info_to?(nil) end should 'display private profile for its owner' do @@ -640,11 +640,11 @@ class ProfileTest < ActiveSupport::TestCase end should 'not accept product category as category' do - assert !Profile.new.accept_category?(ProductCategory.new) + refute Profile.new.accept_category?(ProductCategory.new) end should 'not accept region as a category' do - assert !Profile.new.accept_category?(Region.new) + refute Profile.new.accept_category?(Region.new) end should 'query region for location' do @@ -886,7 +886,7 @@ class ProfileTest < ActiveSupport::TestCase p2 = fast_create(Profile, :public_profile => false) assert p1.public? - assert !p2.public? + refute p2.public? end should 'remove member with many roles' do @@ -964,7 +964,7 @@ class ProfileTest < ActiveSupport::TestCase a_copy = p.articles[0] - assert !a_copy.advertise + refute a_copy.advertise end should 'copy set of boxes from profile template' do @@ -1115,7 +1115,7 @@ class ProfileTest < ActiveSupport::TestCase template.boxes[0].blocks << b p = create(Profile) - assert !b[:title].blank? + refute b[:title].blank? p.copy_blocks_from(template) @@ -1130,7 +1130,7 @@ class ProfileTest < ActiveSupport::TestCase template.boxes[0].blocks << b p = create(Profile) - assert !b[:title].blank? + refute b[:title].blank? p.copy_blocks_from(template) @@ -1205,7 +1205,7 @@ class ProfileTest < ActiveSupport::TestCase p1 = fast_create(Profile, :identifier => 'mytestprofile', :environment_id => env.id) p2 = build(Profile, :identifier => 'mytestprofile', :environment => env) - assert !p2.valid? + refute p2.valid? assert p2.errors[:identifier] assert_equal p1.environment, p2.environment end @@ -1227,7 +1227,7 @@ class ProfileTest < ActiveSupport::TestCase should 'not has blog' do p = fast_create(Profile) - assert !p.has_blog? + refute p.has_blog? end should 'get nil when no blog' do @@ -1369,14 +1369,14 @@ class ProfileTest < ActiveSupport::TestCase child = profile.articles.create!(:name => 'child', :parent => p1) profile.reload assert_equivalent [p1, p2], profile.folders - assert !profile.folders.include?(child) + refute profile.folders.include?(child) end should 'profile is invalid when image not valid' do profile = build(Profile, :image_builder => {:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')}) profile.image.expects(:valid?).returns(false).at_least_once profile.image.errors.add(:size, "fake error") - assert !profile.valid? + refute profile.valid? end should 'profile be valid when image is empty' do @@ -1411,7 +1411,7 @@ class ProfileTest < ActiveSupport::TestCase template.is_template = true template.save! profile.valid? - assert !profile.errors[:template.to_s].present? + refute profile.errors[:template.to_s].present? end should 'be able to have a template' do @@ -1802,7 +1802,7 @@ class ProfileTest < ActiveSupport::TestCase should 'not have forum' do p = fast_create(Profile) - assert !p.has_forum? + refute p.has_forum? end should 'get nil when no forum' do @@ -1839,7 +1839,7 @@ class ProfileTest < ActiveSupport::TestCase should 'know if url is the profile homepage' do profile = fast_create(Profile) - assert !profile.is_on_homepage?("/#{profile.identifier}/any_page") + refute profile.is_on_homepage?("/#{profile.identifier}/any_page") assert profile.is_on_homepage?("/#{profile.identifier}") end @@ -1851,7 +1851,7 @@ class ProfileTest < ActiveSupport::TestCase profile.home_page = homepage profile.save - assert !profile.is_on_homepage?("/#{profile.identifier}/#{not_homepage.slug}",not_homepage) + refute profile.is_on_homepage?("/#{profile.identifier}/#{not_homepage.slug}",not_homepage) assert profile.is_on_homepage?("/#{profile.identifier}/#{homepage.slug}", homepage) end @@ -1958,7 +1958,7 @@ class ProfileTest < ActiveSupport::TestCase def assert_invalid_identifier(id) profile = Profile.new(:identifier => id) - assert !profile.valid? + refute profile.valid? assert profile.errors[:identifier.to_s].present? end @@ -1987,7 +1987,7 @@ class ProfileTest < ActiveSupport::TestCase Environment.login_redirection_options.keys.each do |redirection| profile.redirection_after_login = redirection profile.save - assert !profile.errors[:redirection_after_login.to_s].present? + refute profile.errors[:redirection_after_login.to_s].present? end end @@ -2009,7 +2009,7 @@ class ProfileTest < ActiveSupport::TestCase profile = fast_create(Profile) profile.stubs(:active_fields).returns(['field']) profile.stubs(:public_fields).returns([]) - assert !profile.may_display_field_to?('field', nil) + refute profile.may_display_field_to?('field', nil) end 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 profile.expects(:public_fields).returns([]) user = mock user.expects(:is_a_friend?).with(profile).returns(false) - assert !profile.may_display_field_to?('field', user) + refute profile.may_display_field_to?('field', user) end should 'display field if field is active and not public but user is profile owner' do @@ -2057,7 +2057,7 @@ class ProfileTest < ActiveSupport::TestCase assert profile.may_display_location_to?(user) profile.stubs(:may_display_field_to?).with(Profile::LOCATION_FIELDS[0], user).returns(false) - assert !profile.may_display_location_to?(user) + refute profile.may_display_location_to?(user) end should 'destroy profile if its environment is destroyed' do @@ -2099,13 +2099,13 @@ class ProfileTest < ActiveSupport::TestCase end should 'not copy rss_feed' do - assert !fast_create(Profile).copy_article?(fast_create(RssFeed)) + refute fast_create(Profile).copy_article?(fast_create(RssFeed)) end should 'not copy template welcome_page' do template = fast_create(Person, :is_template => true) welcome_page = fast_create(TinyMceArticle, :slug => 'welcome-page', :profile_id => template.id) - assert !template.copy_article?(welcome_page) + refute template.copy_article?(welcome_page) end should 'return nil on welcome_page_content if template has no welcome page' do diff --git a/test/unit/qualifier_test.rb b/test/unit/qualifier_test.rb index 7a9b373..70f0513 100644 --- a/test/unit/qualifier_test.rb +++ b/test/unit/qualifier_test.rb @@ -5,7 +5,7 @@ class QualifierTest < ActiveSupport::TestCase should 'environment is mandatory' do qualifier = Qualifier.new(:name => 'Qualifier without environment') - assert !qualifier.valid? + refute qualifier.valid? qualifier.environment = fast_create(Environment) assert qualifier.valid? @@ -25,7 +25,7 @@ class QualifierTest < ActiveSupport::TestCase should 'name is mandatory' do env_one = fast_create(Environment) qualifier = env_one.qualifiers.build - assert !qualifier.valid? + refute qualifier.valid? qualifier.name = 'Qualifier name' assert qualifier.valid? diff --git a/test/unit/region_test.rb b/test/unit/region_test.rb index 8e08a81..fecf6c3 100644 --- a/test/unit/region_test.rb +++ b/test/unit/region_test.rb @@ -26,7 +26,7 @@ class RegionTest < ActiveSupport::TestCase should 'has no validator' do env = fast_create(Environment) region = fast_create(Region, :environment_id => env.id, :name => 'My Region') - assert !region.has_validator? + refute region.has_validator? end should 'list regions with validators' do diff --git a/test/unit/rss_feed_test.rb b/test/unit/rss_feed_test.rb index e8079b9..38c9cdf 100644 --- a/test/unit/rss_feed_test.rb +++ b/test/unit/rss_feed_test.rb @@ -15,7 +15,7 @@ class RssFeedTest < ActiveSupport::TestCase :search => 'parent_and_children', } feed.valid? - assert !feed.errors['body'.to_s].present? + refute feed.errors['body'.to_s].present? end should 'alias body as "settings"' do @@ -172,11 +172,11 @@ class RssFeedTest < ActiveSupport::TestCase feed.include = 'parent_and_children' feed.valid? - assert !feed.errors[:include.to_s].present? + refute feed.errors[:include.to_s].present? feed.include = 'all' feed.valid? - assert !feed.errors[:include.to_s].present? + refute feed.errors[:include.to_s].present? end should 'provide proper short description' do @@ -194,7 +194,7 @@ class RssFeedTest < ActiveSupport::TestCase should 'advertise is false before create' do profile = create_user('testuser').person feed = create(RssFeed, :name => 'testfeed', :profile => profile) - assert !feed.advertise? + refute feed.advertise? end should 'can display hits' do diff --git a/test/unit/scope_tool.rb b/test/unit/scope_tool.rb index c64c548..7aa2de9 100644 --- a/test/unit/scope_tool.rb +++ b/test/unit/scope_tool.rb @@ -23,9 +23,9 @@ class ScopeToolTest < ActiveSupport::TestCase assert orgs.include? ent2 orgs = orgs.visible assert orgs.include? cmm1 - assert !orgs.include?(cmm2) + refute orgs.include?(cmm2) assert orgs.include? ent1 - assert !orgs.include?(ent2) + refute orgs.include?(ent2) end end diff --git a/test/unit/scrap_test.rb b/test/unit/scrap_test.rb index ce22777..a379ab6 100644 --- a/test/unit/scrap_test.rb +++ b/test/unit/scrap_test.rb @@ -19,7 +19,7 @@ class ScrapTest < ActiveSupport::TestCase s.content = 'some content' s.valid? - assert !s.errors[:content.to_s].present? + refute s.errors[:content.to_s].present? end should "have the sender" do @@ -29,7 +29,7 @@ class ScrapTest < ActiveSupport::TestCase s.sender_id = 1 s.valid? - assert !s.errors[:sender_id.to_s].present? + refute s.errors[:sender_id.to_s].present? end should "have the receiver" do @@ -39,7 +39,7 @@ class ScrapTest < ActiveSupport::TestCase s.receiver_id = 1 s.valid? - assert !s.errors[:receiver_id.to_s].present? + refute s.errors[:receiver_id.to_s].present? end should "be associated to Person as sender" do @@ -258,7 +258,7 @@ class ScrapTest < ActiveSupport::TestCase should 'strip html before validate' do s, r = create_user.person, create_user.person s = build Scrap, :sender => s, :receiver => r, :content => "

" - assert !s.valid? + refute s.valid? s.content = "

Test

" assert s.valid? end diff --git a/test/unit/search_helper_test.rb b/test/unit/search_helper_test.rb index eb15a26..63f7983 100644 --- a/test/unit/search_helper_test.rb +++ b/test/unit/search_helper_test.rb @@ -14,14 +14,14 @@ class SearchHelperTest < ActiveSupport::TestCase stubs(:params).returns({:action => 'products', :display => 'map'}) @results = {:products => [1,2]} - assert !multiple_search? + refute multiple_search? end should 'return whether on a map search' do stubs(:params).returns({:action => 'index', :display => 'map'}) @results = {:articles => [1,2], :products => [1,2]} @query = '' - assert !map_search? + refute map_search? stubs(:params).returns({:action => 'products', :display => 'map'}) @results = {:products => [1,2]} diff --git a/test/unit/search_term_occurrence_test.rb b/test/unit/search_term_occurrence_test.rb index 7bfedae..1b5415d 100644 --- a/test/unit/search_term_occurrence_test.rb +++ b/test/unit/search_term_occurrence_test.rb @@ -10,7 +10,7 @@ class SearchTermOccurrenceTest < ActiveSupport::TestCase should 'have term' do search_term_occurrence = SearchTermOccurrence.new - assert !search_term_occurrence.valid? + refute search_term_occurrence.valid? assert search_term_occurrence.errors.has_key?(:search_term) end diff --git a/test/unit/search_term_test.rb b/test/unit/search_term_test.rb index e452f9c..e20f368 100644 --- a/test/unit/search_term_test.rb +++ b/test/unit/search_term_test.rb @@ -3,13 +3,13 @@ require 'test_helper' class SearchTermTest < ActiveSupport::TestCase should 'have term' do search_term = SearchTerm.new - assert !search_term.valid? + refute search_term.valid? assert search_term.errors.has_key?(:term) end should 'have context' do search_term = SearchTerm.new - assert !search_term.valid? + refute search_term.valid? assert search_term.errors.has_key?(:context) end @@ -21,12 +21,12 @@ class SearchTermTest < ActiveSupport::TestCase search_term.asset = 'alternate_universe' search_term.valid? - assert !search_term.errors.has_key?(:term) + refute search_term.errors.has_key?(:term) search_term.asset = 'universe' search_term.context = fast_create(Profile) search_term.valid? - assert !search_term.errors.has_key?(:term) + refute search_term.errors.has_key?(:term) end should 'create a search term' do diff --git a/test/unit/suggest_article_test.rb b/test/unit/suggest_article_test.rb index d31d13c..4870ca1 100644 --- a/test/unit/suggest_article_test.rb +++ b/test/unit/suggest_article_test.rb @@ -13,28 +13,28 @@ class SuggestArticleTest < ActiveSupport::TestCase should 'have the article_name' do t = SuggestArticle.new - assert !t.article_object.errors[:name].present? + refute t.article_object.errors[:name].present? t.article_object.valid? assert t.article_object.errors[:name].present? end should 'have the email' do t = SuggestArticle.new - assert !t.errors[:email.to_s].present? + refute t.errors[:email.to_s].present? t.valid? assert t.errors[:email.to_s].present? end should 'have the name' do t = SuggestArticle.new - assert !t.errors[:name.to_s].present? + refute t.errors[:name.to_s].present? t.valid? assert t.errors[:name.to_s].present? end should 'have the target_id' do t = SuggestArticle.new - assert !t.errors[:target_id.to_s].present? + refute t.errors[:target_id.to_s].present? t.valid? assert t.errors[:target_id.to_s].present? end @@ -42,7 +42,7 @@ class SuggestArticleTest < ActiveSupport::TestCase should 'have the article' do t = SuggestArticle.new assert t.respond_to?(:article_object) - assert !t.errors[:article_object].present? + refute t.errors[:article_object].present? t.valid? assert t.errors[:article_object].present? end diff --git a/test/unit/task_mailer_test.rb b/test/unit/task_mailer_test.rb index 69e4695..3ab0da7 100644 --- a/test/unit/task_mailer_test.rb +++ b/test/unit/task_mailer_test.rb @@ -31,7 +31,7 @@ class TaskMailerTest < ActiveSupport::TestCase task.expects(:environment).returns(environment).at_least_once task.send(:send_notification, :finished).deliver - assert !ActionMailer::Base.deliveries.empty? + refute ActionMailer::Base.deliveries.empty? end should 'be able to send a "task cancelled" message' do @@ -54,7 +54,7 @@ class TaskMailerTest < ActiveSupport::TestCase task.expects(:environment).returns(environment).at_least_once task.send(:send_notification, :cancelled).deliver - assert !ActionMailer::Base.deliveries.empty? + refute ActionMailer::Base.deliveries.empty? end should 'be able to send a "task created" message' do @@ -78,7 +78,7 @@ class TaskMailerTest < ActiveSupport::TestCase task.expects(:environment).returns(environment).at_least_once task.send(:send_notification, :created).deliver - assert !ActionMailer::Base.deliveries.empty? + refute ActionMailer::Base.deliveries.empty? end should 'be able to send a "target notification" message' do @@ -88,7 +88,7 @@ class TaskMailerTest < ActiveSupport::TestCase task.expects(:target_notification_description).returns('the task') TaskMailer.target_notification(task, 'the message').deliver - assert !ActionMailer::Base.deliveries.empty? + refute ActionMailer::Base.deliveries.empty? end should 'be able to send a "invitation notification" message' do @@ -121,7 +121,7 @@ class TaskMailerTest < ActiveSupport::TestCase 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 mail.deliver - assert !ActionMailer::Base.deliveries.empty? + refute ActionMailer::Base.deliveries.empty? end should 'use environment name and no-reply email' do diff --git a/test/unit/task_test.rb b/test/unit/task_test.rb index 00388e3..d9d9b09 100644 --- a/test/unit/task_test.rb +++ b/test/unit/task_test.rb @@ -114,7 +114,7 @@ class TaskTest < ActiveSupport::TestCase task1 = Task.create! task2 = build(Task, :code => task1.code) - assert !task2.valid? + refute task2.valid? assert task2.errors[:code.to_s].present? end @@ -391,15 +391,15 @@ class TaskTest < ActiveSupport::TestCase t = Task.new t.spam = true assert t.spam? - assert !t.ham? + refute t.ham? t.spam = false assert t.ham? - assert !t.spam? + refute t.spam? t.spam = nil - assert !t.spam? - assert !t.ham? + refute t.spam? + refute t.ham? end should 'be able to select non-spam tasks' do diff --git a/test/unit/text_article_test.rb b/test/unit/text_article_test.rb index 500acb8..ae981f2 100644 --- a/test/unit/text_article_test.rb +++ b/test/unit/text_article_test.rb @@ -92,7 +92,7 @@ class TextArticleTest < ActiveSupport::TestCase text = TextArticle.new(:profile => profile) - assert !text.translatable? + refute text.translatable? end should 'be translatable if there is languages on environment' do @@ -101,7 +101,7 @@ class TextArticleTest < ActiveSupport::TestCase profile = fast_create(Person, :environment_id => environment.id) text = fast_create(TextArticle, :profile_id => profile.id) - assert !text.translatable? + refute text.translatable? environment.languages = ['en','pt','fr'] environment.save diff --git a/test/unit/theme_test.rb b/test/unit/theme_test.rb index 04eee41..2f0ee22 100644 --- a/test/unit/theme_test.rb +++ b/test/unit/theme_test.rb @@ -167,7 +167,7 @@ class ThemeTest < ActiveSupport::TestCase [Theme.find(t2.id), Theme.find(t1.id)].each do |theme| assert Theme.approved_themes(profile).include?(theme) end - assert ! Theme.approved_themes(profile).include?(Theme.find(t3.id)) + refute Theme.approved_themes(profile).include?(Theme.find(t3.id)) end should 'not list non theme files or dirs inside themes dir' do @@ -188,7 +188,7 @@ class ThemeTest < ActiveSupport::TestCase end should 'not be public by default' do - assert ! Theme.new('test').public + refute Theme.new('test').public end should 'not crash with nil or invalid owner_type' do diff --git a/test/unit/translatable_content_test.rb b/test/unit/translatable_content_test.rb index 2d5fba0..89e461c 100644 --- a/test/unit/translatable_content_test.rb +++ b/test/unit/translatable_content_test.rb @@ -18,7 +18,7 @@ class TranslatableContentTest < ActiveSupport::TestCase should 'not be translatable if parent is a forum' do content.parent = Forum.new - assert !content.translatable? + refute content.translatable? end should 'be translatable if parent is not a forum' do diff --git a/test/unit/uploaded_file_test.rb b/test/unit/uploaded_file_test.rb index b7e7526..33aa150 100644 --- a/test/unit/uploaded_file_test.rb +++ b/test/unit/uploaded_file_test.rb @@ -74,7 +74,7 @@ class UploadedFileTest < ActiveSupport::TestCase should 'not upload files bigger than max_size' do f = build(UploadedFile, :profile => @profile, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')) f.expects(:size).returns(UploadedFile.attachment_options[:max_size] + 1024) - assert !f.valid? + refute f.valid? end should 'upload files smaller than max_size' do @@ -175,7 +175,7 @@ class UploadedFileTest < ActiveSupport::TestCase end should 'return false by default in thumbnails_processed' do - assert !UploadedFile.new.thumbnails_processed + refute UploadedFile.new.thumbnails_processed end should 'set thumbnails_processed to true' do diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb index 4551feb..af36f18 100644 --- a/test/unit/user_test.rb +++ b/test/unit/user_test.rb @@ -10,7 +10,7 @@ class UserTest < ActiveSupport::TestCase def test_should_create_user assert_difference 'User.count' do user = new_user - assert !user.new_record?, "#{user.errors.full_messages.to_sentence}" + refute user.new_record?, "#{user.errors.full_messages.to_sentence}" end end @@ -110,15 +110,15 @@ class UserTest < ActiveSupport::TestCase u.login = 'rightformat2007' u.valid? - assert ! u.errors[:login.to_s].present? + refute u.errors[:login.to_s].present? u.login = 'rightformat' u.valid? - assert ! u.errors[:login.to_s].present? + refute u.errors[:login.to_s].present? u.login = 'right_format' u.valid? - assert ! u.errors[:login.to_s].present? + refute u.errors[:login.to_s].present? end def test_should_change_password @@ -126,7 +126,7 @@ class UserTest < ActiveSupport::TestCase assert_nothing_raised do user.change_password!('test', 'newpass', 'newpass') end - assert !user.authenticated?('test') + refute user.authenticated?('test') assert user.authenticated?('newpass') end @@ -135,7 +135,7 @@ class UserTest < ActiveSupport::TestCase assert_raise User::IncorrectPassword do user.change_password!('wrong', 'newpass', 'newpass') end - assert !user.authenticated?('newpass') + refute user.authenticated?('newpass') assert user.authenticated?('test') end @@ -144,7 +144,7 @@ class UserTest < ActiveSupport::TestCase assert_raise ActiveRecord::RecordInvalid do user.force_change_password!('newpass', 'newpasswrong') end - assert !user.authenticated?('newpass') + refute user.authenticated?('newpass') assert user.authenticated?('test') end @@ -158,7 +158,7 @@ class UserTest < ActiveSupport::TestCase def test_should_create_person_when_creating_user count = Person.count - assert !Person.find_by_identifier('lalala') + refute Person.find_by_identifier('lalala') new_user(:login => 'lalala', :email => 'lalala@example.com') assert Person.find_by_identifier('lalala') end @@ -174,7 +174,7 @@ class UserTest < ActiveSupport::TestCase user = new_user(:login => 'lalala', :email => 'lalala@example.com') assert Person.find_by_identifier('lalala') user.destroy - assert !Person.find_by_identifier('lalala') + refute Person.find_by_identifier('lalala') end def test_should_encrypt_password_with_salted_sha1 @@ -291,7 +291,7 @@ class UserTest < ActiveSupport::TestCase should 'enable email' do user = create_user('cooler') - assert !user.enable_email + refute user.enable_email assert user.enable_email! assert user.enable_email end @@ -307,7 +307,7 @@ class UserTest < ActiveSupport::TestCase user = create_user('cooler') user.expects(:environment).returns(nil) EmailActivation.create!(:requestor => user.person, :target => Environment.default) - assert !user.email_activation_pending? + refute user.email_activation_pending? end should 'has moderate registration pending' do @@ -318,7 +318,7 @@ class UserTest < ActiveSupport::TestCase should 'not has moderate registration pending if not have a pending task' do user = create_user('cooler') - assert !user.moderate_registration_pending? + refute user.moderate_registration_pending? end should 'be able to use [] operator to find users by login' do @@ -527,7 +527,7 @@ class UserTest < ActiveSupport::TestCase user = new_user assert_not_nil user.activation_code assert_nil user.activated_at - assert !user.person.visible + refute user.person.visible end should 'activate an user' do @@ -540,7 +540,7 @@ class UserTest < ActiveSupport::TestCase should 'return if the user is activated' do user = new_user - assert !user.activated? + refute user.activated? user.activate assert user.activated? end @@ -573,7 +573,7 @@ class UserTest < ActiveSupport::TestCase user.activate assert user.deactivate assert_nil user.activated_at - assert !user.person.visible + refute user.person.visible end should 'return if the user is deactivated' do @@ -581,7 +581,7 @@ class UserTest < ActiveSupport::TestCase user.activate assert user.activated? user.deactivate - assert !user.activated? + refute user.activated? end should 'activate right after creation when confirmation is not required' do @@ -595,7 +595,7 @@ class UserTest < ActiveSupport::TestCase should 'cancel activation if user has no person associated' do user = new_user user.stubs(:person).returns(nil) - assert !user.activate + refute user.activate end should 'be able to skip the password requirement' do diff --git a/test/unit/validation_info_test.rb b/test/unit/validation_info_test.rb index 3419a59..b43a1ba 100644 --- a/test/unit/validation_info_test.rb +++ b/test/unit/validation_info_test.rb @@ -8,7 +8,7 @@ class ValidationInfoTest < ActiveSupport::TestCase assert info.errors[:validation_methodology].any? info.validation_methodology = 'lalala' info.valid? - assert !info.errors[:validation_methodology].any? + refute info.errors[:validation_methodology].any? end should 'refer to and validate the presence of an organization' do -- libgit2 0.21.2