Commit 918d7d3baa92ed908fd0d490741a093fdee579b6
Exists in
master
and in
29 other branches
Merge branch 'refute-insteadof-assert-not' into noosfero
Showing
152 changed files
with
746 additions
and
746 deletions
Show diff stats
Too many changes.
To preserve performance only 100 of 152 files displayed.
plugins/breadcrumbs/test/functional/profile_design_controller_test.rb
... | ... | @@ -37,8 +37,8 @@ class ProfileDesignControllerTest < ActionController::TestCase |
37 | 37 | post :save, :id => @block.id, :profile => @profile.identifier, :block => {:title => 'breadcrumbs', :show_cms_action => false, :show_profile => false} |
38 | 38 | @block.reload |
39 | 39 | assert_equal 'breadcrumbs', @block.title |
40 | - assert !@block.show_profile | |
41 | - assert !@block.show_cms_action | |
40 | + refute @block.show_profile | |
41 | + refute @block.show_cms_action | |
42 | 42 | end |
43 | 43 | |
44 | 44 | should 'be able save breadcrumbs block with show_section_name option' do | ... | ... |
plugins/breadcrumbs/test/unit/breadcrumbs_plugin_test.rb
... | ... | @@ -7,11 +7,11 @@ class BreadcrumbsPluginTest < ActiveSupport::TestCase |
7 | 7 | end |
8 | 8 | |
9 | 9 | should 'has a name' do |
10 | - assert !BreadcrumbsPlugin.plugin_name.blank? | |
10 | + refute BreadcrumbsPlugin.plugin_name.blank? | |
11 | 11 | end |
12 | 12 | |
13 | 13 | should 'has a description' do |
14 | - assert !BreadcrumbsPlugin.plugin_description.blank? | |
14 | + refute BreadcrumbsPlugin.plugin_description.blank? | |
15 | 15 | end |
16 | 16 | |
17 | 17 | should 'add a block' do | ... | ... |
plugins/breadcrumbs/test/unit/content_breadcrumbs_block_test.rb
plugins/bsc/test/functional/bsc_plugin_admin_controller_test.rb
plugins/bsc/test/unit/bsc_plugin/bsc_test.rb
... | ... | @@ -41,7 +41,7 @@ class BscPlugin::BscTest < ActiveSupport::TestCase |
41 | 41 | bsc.enterprise_requests.stubs(:pending).returns([task]) |
42 | 42 | |
43 | 43 | assert bsc.already_requested?(e1) |
44 | - assert !bsc.already_requested?(e2) | |
44 | + refute bsc.already_requested?(e2) | |
45 | 45 | end |
46 | 46 | |
47 | 47 | should 'return associated enterprises products' do |
... | ... | @@ -68,7 +68,7 @@ class BscPlugin::BscTest < ActiveSupport::TestCase |
68 | 68 | end |
69 | 69 | |
70 | 70 | should 'not be able to create product' do |
71 | - assert !bsc.create_product? | |
71 | + refute bsc.create_product? | |
72 | 72 | end |
73 | 73 | |
74 | 74 | should 'have many contracts' do | ... | ... |
plugins/bsc/test/unit/bsc_plugin/contract_test.rb
... | ... | @@ -14,7 +14,7 @@ class BscPlugin::ContractTest < ActiveSupport::TestCase |
14 | 14 | |
15 | 15 | contract.bsc = BscPlugin::Bsc.new |
16 | 16 | contract.valid? |
17 | - assert !contract.errors.invalid?(:bsc) | |
17 | + refute contract.errors.invalid?(:bsc) | |
18 | 18 | end |
19 | 19 | |
20 | 20 | should 'associate contract with products through sales' do | ... | ... |
plugins/bsc/test/unit/bsc_plugin/sale_test.rb
... | ... | @@ -18,8 +18,8 @@ class BscPlugin::SaleTest < ActiveSupport::TestCase |
18 | 18 | sale.product = product |
19 | 19 | sale.contract = contract |
20 | 20 | |
21 | - assert !sale.errors.invalid?(product) | |
22 | - assert !sale.errors.invalid?(contract) | |
21 | + refute sale.errors.invalid?(product) | |
22 | + refute sale.errors.invalid?(contract) | |
23 | 23 | end |
24 | 24 | |
25 | 25 | should 'validate uniqueness of product and contract composed' do |
... | ... | @@ -43,7 +43,7 @@ class BscPlugin::SaleTest < ActiveSupport::TestCase |
43 | 43 | |
44 | 44 | sale.quantity = 3 |
45 | 45 | sale.valid? |
46 | - assert !sale.errors.invalid?(:quantity) | |
46 | + refute sale.errors.invalid?(:quantity) | |
47 | 47 | end |
48 | 48 | |
49 | 49 | should 'set default price as product price if no price indicated' do | ... | ... |
plugins/comment_group/test/unit/article_test.rb
... | ... | @@ -19,7 +19,7 @@ class ArticleTest < ActiveSupport::TestCase |
19 | 19 | should 'do not allow a exclusion of a group comment macro if this group has comments' do |
20 | 20 | article.body = "<div class=\"macro\" data-macro-group_id=2></div>" |
21 | 21 | comment1 = fast_create(Comment, :group_id => 1, :source_id => article.id) |
22 | - assert !article.save | |
22 | + refute article.save | |
23 | 23 | assert_equal ['Not empty group comment cannot be removed'], article.errors[:base] |
24 | 24 | end |
25 | 25 | ... | ... |
plugins/comment_group/test/unit/comment_group_plugin_test.rb
plugins/community_track/test/functional/community_track_plugin_public_controller_test.rb
... | ... | @@ -52,7 +52,7 @@ class CommunityTrackPluginPublicControllerTest < ActionController::TestCase |
52 | 52 | should 'do not show more link in all tracks if there is no more tracks to show' do |
53 | 53 | CommunityTrackPlugin::Track.destroy_all |
54 | 54 | get :all_tracks, :id => @block.id |
55 | - assert !assigns['show_more'] | |
55 | + refute assigns['show_more'] | |
56 | 56 | assert_no_match /track_list_more_#{@block.id}/, @response.body |
57 | 57 | end |
58 | 58 | ... | ... |
plugins/community_track/test/unit/article_test.rb
... | ... | @@ -18,7 +18,7 @@ class ArticleTest < ActiveSupport::TestCase |
18 | 18 | should 'do nothing if parent is not a step' do |
19 | 19 | folder = fast_create(Folder, :profile_id => @profile.id) |
20 | 20 | article = Article.create!(:parent => folder, :profile => @profile, :accept_comments => false, :name => "article") |
21 | - assert !article.accept_comments | |
21 | + refute article.accept_comments | |
22 | 22 | end |
23 | 23 | |
24 | 24 | end | ... | ... |
plugins/community_track/test/unit/community_track_plugin/step_test.rb
... | ... | @@ -24,20 +24,20 @@ class StepTest < ActiveSupport::TestCase |
24 | 24 | should 'set accept_comments to false on create' do |
25 | 25 | today = Date.today |
26 | 26 | step = CommunityTrackPlugin::Step.create(:name => 'Step', :body => 'body', :profile => @profile, :parent => @track, :start_date => today, :end_date => today, :published => true) |
27 | - assert !step.accept_comments | |
27 | + refute step.accept_comments | |
28 | 28 | end |
29 | 29 | |
30 | 30 | should 'do not allow step creation with a parent that is not a track' do |
31 | 31 | today = Date.today |
32 | 32 | blog = fast_create(Blog) |
33 | 33 | step = CommunityTrackPlugin::Step.new(:name => 'Step', :body => 'body', :profile => @profile, :parent => blog, :start_date => today, :end_date => today, :published => true) |
34 | - assert !step.save | |
34 | + refute step.save | |
35 | 35 | end |
36 | 36 | |
37 | 37 | should 'do not allow step creation without a parent' do |
38 | 38 | today = Date.today |
39 | 39 | step = CommunityTrackPlugin::Step.new(:name => 'Step', :body => 'body', :profile => @profile, :parent => nil, :start_date => today, :end_date => today, :published => true) |
40 | - assert !step.save | |
40 | + refute step.save | |
41 | 41 | end |
42 | 42 | |
43 | 43 | should 'create step if end date is equal to start date' do |
... | ... | @@ -55,7 +55,7 @@ class StepTest < ActiveSupport::TestCase |
55 | 55 | should 'do not create step if end date is before start date' do |
56 | 56 | @step.start_date = Date.today |
57 | 57 | @step.end_date = Date.today - 1.day |
58 | - assert !@step.save | |
58 | + refute @step.save | |
59 | 59 | end |
60 | 60 | |
61 | 61 | should 'do not validate date period if start date is nil' do |
... | ... | @@ -146,7 +146,7 @@ class StepTest < ActiveSupport::TestCase |
146 | 146 | end |
147 | 147 | |
148 | 148 | should 'set position on save' do |
149 | - assert !@step.position | |
149 | + refute @step.position | |
150 | 150 | @step.save! |
151 | 151 | assert_equal 1, @step.position |
152 | 152 | step2 = CommunityTrackPlugin::Step.new(:name => 'Step2', :body => 'body', :profile => @profile, :parent => @track, :published => false, :end_date => Date.today, :start_date => Date.today) |
... | ... | @@ -157,7 +157,7 @@ class StepTest < ActiveSupport::TestCase |
157 | 157 | should 'accept comments if step is active' do |
158 | 158 | @step.start_date = Date.today |
159 | 159 | @step.save! |
160 | - assert !@step.accept_comments | |
160 | + refute @step.accept_comments | |
161 | 161 | @step.toggle_activation |
162 | 162 | @step.reload |
163 | 163 | assert @step.accept_comments |
... | ... | @@ -167,10 +167,10 @@ class StepTest < ActiveSupport::TestCase |
167 | 167 | @step.start_date = Date.today + 2.days |
168 | 168 | @step.end_date = Date.today + 3.days |
169 | 169 | @step.save! |
170 | - assert !@step.published | |
170 | + refute @step.published | |
171 | 171 | @step.toggle_activation |
172 | 172 | @step.reload |
173 | - assert !@step.published | |
173 | + refute @step.published | |
174 | 174 | end |
175 | 175 | |
176 | 176 | should 'do not accept comments if step is not active anymore' do |
... | ... | @@ -185,7 +185,7 @@ class StepTest < ActiveSupport::TestCase |
185 | 185 | @step.save! |
186 | 186 | @step.toggle_activation |
187 | 187 | @step.reload |
188 | - assert !@step.accept_comments | |
188 | + refute @step.accept_comments | |
189 | 189 | end |
190 | 190 | |
191 | 191 | should 'set position to zero if step is hidden' do |
... | ... | @@ -228,10 +228,10 @@ class StepTest < ActiveSupport::TestCase |
228 | 228 | @step.start_date = Date.today |
229 | 229 | @step.hidden = true |
230 | 230 | @step.save! |
231 | - assert !@step.published | |
231 | + refute @step.published | |
232 | 232 | @step.toggle_activation |
233 | 233 | @step.reload |
234 | - assert !@step.published | |
234 | + refute @step.published | |
235 | 235 | end |
236 | 236 | |
237 | 237 | should 'return enabled tools for a step' do |
... | ... | @@ -268,9 +268,9 @@ class StepTest < ActiveSupport::TestCase |
268 | 268 | should 'enable comments on children when step is activated' do |
269 | 269 | @step.start_date = Date.today |
270 | 270 | @step.save! |
271 | - assert !@step.accept_comments | |
271 | + refute @step.accept_comments | |
272 | 272 | article = fast_create(Article, :parent_id => @step.id, :profile_id => @step.profile.id, :accept_comments => false) |
273 | - assert !article.accept_comments | |
273 | + refute article.accept_comments | |
274 | 274 | @step.toggle_activation |
275 | 275 | assert article.reload.accept_comments |
276 | 276 | end |
... | ... | @@ -279,7 +279,7 @@ class StepTest < ActiveSupport::TestCase |
279 | 279 | @step.start_date = Date.today |
280 | 280 | @step.start_date = Date.today |
281 | 281 | @step.save! |
282 | - assert !@step.accept_comments | |
282 | + refute @step.accept_comments | |
283 | 283 | @step.toggle_activation |
284 | 284 | article = Article.create!(:parent => @step, :profile => @step.profile, :accept_comments => false, :name => "article") |
285 | 285 | assert article.reload.accept_comments | ... | ... |
plugins/community_track/test/unit/community_track_plugin/track_list_block_test.rb
... | ... | @@ -20,7 +20,7 @@ class TrackListBlockTest < ActiveSupport::TestCase |
20 | 20 | end |
21 | 21 | |
22 | 22 | should 'load more at another page default to false' do |
23 | - assert !@block.more_another_page | |
23 | + refute @block.more_another_page | |
24 | 24 | end |
25 | 25 | |
26 | 26 | should 'list articles only of track type' do |
... | ... | @@ -41,7 +41,7 @@ class TrackListBlockTest < ActiveSupport::TestCase |
41 | 41 | |
42 | 42 | should 'do not return more link if there is no more tracks to show' do |
43 | 43 | (@block.limit-1).times { |i| create_track("track#{i}", profile) } |
44 | - assert !@block.footer | |
44 | + refute @block.footer | |
45 | 45 | end |
46 | 46 | |
47 | 47 | should 'count all tracks' do |
... | ... | @@ -58,7 +58,7 @@ class TrackListBlockTest < ActiveSupport::TestCase |
58 | 58 | @block.owner.articles.destroy_all |
59 | 59 | (@block.limit+1).times { |i| create_track("track#{i}", profile) } |
60 | 60 | assert @block.has_page?(2) |
61 | - assert !@block.has_page?(3) | |
61 | + refute @block.has_page?(3) | |
62 | 62 | end |
63 | 63 | |
64 | 64 | should 'filter tracks by category' do |
... | ... | @@ -95,8 +95,8 @@ class TrackListBlockTest < ActiveSupport::TestCase |
95 | 95 | |
96 | 96 | should 'define expiration condition' do |
97 | 97 | condition = CommunityTrackPlugin::TrackListBlock.expire_on |
98 | - assert !condition[:profile].empty? | |
99 | - assert !condition[:environment].empty? | |
98 | + refute condition[:profile].empty? | |
99 | + refute condition[:environment].empty? | |
100 | 100 | end |
101 | 101 | |
102 | 102 | should 'return track list block categories' do | ... | ... |
plugins/community_track/test/unit/community_track_plugin_test.rb
... | ... | @@ -74,8 +74,8 @@ class CommunityTrackPluginTest < ActiveSupport::TestCase |
74 | 74 | end |
75 | 75 | |
76 | 76 | should 'return false at content_remove_new if page is not a track' do |
77 | - assert !@plugin.content_remove_new(CommunityTrackPlugin::Step.new) | |
78 | - assert !@plugin.content_remove_new(Article.new) | |
77 | + refute @plugin.content_remove_new(CommunityTrackPlugin::Step.new) | |
78 | + refute @plugin.content_remove_new(Article.new) | |
79 | 79 | end |
80 | 80 | |
81 | 81 | end | ... | ... |
plugins/container_block/test/unit/container_block_plugin/container_block_test.rb
... | ... | @@ -8,11 +8,11 @@ class ContainerBlockPlugin::ContainerBlockTest < ActiveSupport::TestCase |
8 | 8 | end |
9 | 9 | |
10 | 10 | should 'describe yourself' do |
11 | - assert !ContainerBlockPlugin::ContainerBlock.description.blank? | |
11 | + refute ContainerBlockPlugin::ContainerBlock.description.blank? | |
12 | 12 | end |
13 | 13 | |
14 | 14 | should 'has a help' do |
15 | - assert !@block.help.blank? | |
15 | + refute @block.help.blank? | |
16 | 16 | end |
17 | 17 | |
18 | 18 | should 'create a box on save' do |
... | ... | @@ -84,7 +84,7 @@ class ContainerBlockPlugin::ContainerBlockTest < ActiveSupport::TestCase |
84 | 84 | @block.save! |
85 | 85 | child = Block.create!(:box_id => @block.container_box.id) |
86 | 86 | @block.destroy |
87 | - assert !Block.exists?(child.id) | |
87 | + refute Block.exists?(child.id) | |
88 | 88 | end |
89 | 89 | |
90 | 90 | should 'destroy box when container is removed' do | ... | ... |
plugins/container_block/test/unit/container_block_plugin_test.rb
... | ... | @@ -7,11 +7,11 @@ class ContainerBlockPluginTest < ActiveSupport::TestCase |
7 | 7 | end |
8 | 8 | |
9 | 9 | should 'has a name' do |
10 | - assert !ContainerBlockPlugin.plugin_name.blank? | |
10 | + refute ContainerBlockPlugin.plugin_name.blank? | |
11 | 11 | end |
12 | 12 | |
13 | 13 | should 'has a description' do |
14 | - assert !ContainerBlockPlugin.plugin_description.blank? | |
14 | + refute ContainerBlockPlugin.plugin_description.blank? | |
15 | 15 | end |
16 | 16 | |
17 | 17 | should 'add a block' do | ... | ... |
plugins/context_content/test/functional/profile_design_controller_test.rb
... | ... | @@ -47,7 +47,7 @@ class ProfileDesignControllerTest < ActionController::TestCase |
47 | 47 | post :save, :id => @block.id, :block => {:title => 'context', :show_image => '0', :show_name => '0', :show_parent_content => '0', :types => ['TinyMceArticle', '', nil, 'Folder'] }, :profile => @profile.identifier |
48 | 48 | @block.reload |
49 | 49 | assert_equal 'context', @block.title |
50 | - assert !@block.show_image && !@block.show_name && !@block.show_parent_content | |
50 | + refute @block.show_image && !@block.show_name && !@block.show_parent_content | |
51 | 51 | assert_equal ['TinyMceArticle', 'Folder'], @block.types |
52 | 52 | end |
53 | 53 | ... | ... |
plugins/context_content/test/unit/context_content_block_test.rb
plugins/custom_forms/test/functional/custom_forms_plugin_myprofile_controller_test.rb
... | ... | @@ -34,7 +34,7 @@ class CustomFormsPluginMyprofileControllerTest < ActionController::TestCase |
34 | 34 | form = CustomFormsPlugin::Form.create!(:profile => profile, :name => 'Free Software') |
35 | 35 | assert CustomFormsPlugin::Form.exists?(form.id) |
36 | 36 | post :remove, :profile => profile.identifier, :id => form.id |
37 | - assert !CustomFormsPlugin::Form.exists?(form.id) | |
37 | + refute CustomFormsPlugin::Form.exists?(form.id) | |
38 | 38 | end |
39 | 39 | |
40 | 40 | should 'create a form' do | ... | ... |
plugins/custom_forms/test/functional/custom_forms_plugin_profile_controller_test.rb
... | ... | @@ -25,7 +25,7 @@ class CustomFormsPluginProfileControllerTest < ActionController::TestCase |
25 | 25 | assert_difference 'CustomFormsPlugin::Submission.count', 1 do |
26 | 26 | post :show, :profile => profile.identifier, :id => form.id, :submission => {field1.id.to_s => 'Noosfero', field2.id.to_s => 'GPL'} |
27 | 27 | end |
28 | - assert !session[:notice].include?('not saved') | |
28 | + refute session[:notice].include?('not saved') | |
29 | 29 | assert_redirected_to :action => 'show' |
30 | 30 | end |
31 | 31 | ... | ... |
plugins/custom_forms/test/unit/custom_forms_plugin/answer_test.rb
... | ... | @@ -10,7 +10,7 @@ class CustomFormsPlugin::AnswerTest < ActiveSupport::TestCase |
10 | 10 | field = CustomFormsPlugin::Field.create!(:name => 'License', :form => form) |
11 | 11 | answer.field = field |
12 | 12 | answer.valid? |
13 | - assert !answer.errors.include?(:field) | |
13 | + refute answer.errors.include?(:field) | |
14 | 14 | end |
15 | 15 | |
16 | 16 | should 'belong to a submission' do |
... | ... | @@ -31,7 +31,7 @@ class CustomFormsPlugin::AnswerTest < ActiveSupport::TestCase |
31 | 31 | |
32 | 32 | answer.value = "GPL" |
33 | 33 | answer.valid? |
34 | - assert !answer.errors.include?(:value) | |
34 | + refute answer.errors.include?(:value) | |
35 | 35 | end |
36 | 36 | |
37 | 37 | should 'make string representation show answers' do | ... | ... |
plugins/custom_forms/test/unit/custom_forms_plugin/field_test.rb
... | ... | @@ -9,7 +9,7 @@ class CustomFormsPlugin::FieldTest < ActiveSupport::TestCase |
9 | 9 | |
10 | 10 | should 'set mandatory field as false by default' do |
11 | 11 | field = CustomFormsPlugin::Field.new |
12 | - assert !field.mandatory | |
12 | + refute field.mandatory | |
13 | 13 | end |
14 | 14 | |
15 | 15 | should 'have answers' do |
... | ... | @@ -47,7 +47,7 @@ class CustomFormsPlugin::FieldTest < ActiveSupport::TestCase |
47 | 47 | |
48 | 48 | should 'have alternative if type is SelectField' do |
49 | 49 | select = CustomFormsPlugin::Field.new(:name => 'select_field001', :type => 'CustomFormsPlugin::SelectField') |
50 | - assert !select.save | |
50 | + refute select.save | |
51 | 51 | |
52 | 52 | select.alternatives << CustomFormsPlugin::Alternative.new(:label => 'option') |
53 | 53 | assert select.save | ... | ... |
plugins/custom_forms/test/unit/custom_forms_plugin/form_test.rb
... | ... | @@ -10,8 +10,8 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase |
10 | 10 | form.profile = fast_create(Profile) |
11 | 11 | form.name = 'Free Software' |
12 | 12 | form.valid? |
13 | - assert !form.errors.include?(:profile) | |
14 | - assert !form.errors.include?(:name) | |
13 | + refute form.errors.include?(:profile) | |
14 | + refute form.errors.include?(:name) | |
15 | 15 | end |
16 | 16 | |
17 | 17 | should 'have many fields including fields subclasses' do |
... | ... | @@ -50,7 +50,7 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase |
50 | 50 | |
51 | 51 | form.profile = another_profile |
52 | 52 | form.valid? |
53 | - assert !form.errors.include?(:slug) | |
53 | + refute form.errors.include?(:slug) | |
54 | 54 | end |
55 | 55 | |
56 | 56 | should 'validate the difference between ending and beginning is positive' do |
... | ... | @@ -60,55 +60,55 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase |
60 | 60 | form.begining = Time.now |
61 | 61 | form.ending = Time.now + 1.day |
62 | 62 | assert form.valid? |
63 | - assert !form.errors.include?(:base) | |
63 | + refute form.errors.include?(:base) | |
64 | 64 | |
65 | 65 | form.ending = Time.now - 2.day |
66 | - assert !form.valid? | |
66 | + refute form.valid? | |
67 | 67 | assert form.errors.include?(:base) |
68 | 68 | end |
69 | 69 | |
70 | 70 | should 'define form expiration' do |
71 | 71 | form = CustomFormsPlugin::Form.new |
72 | - assert !form.expired? | |
72 | + refute form.expired? | |
73 | 73 | |
74 | 74 | form.begining = Time.now + 1.day |
75 | 75 | assert form.expired? |
76 | 76 | |
77 | 77 | form.begining = Time.now - 1.day |
78 | - assert !form.expired? | |
78 | + refute form.expired? | |
79 | 79 | |
80 | 80 | form.begining = nil |
81 | 81 | form.ending = Time.now + 1.day |
82 | - assert !form.expired? | |
82 | + refute form.expired? | |
83 | 83 | |
84 | 84 | form.ending = Time.now - 1.day |
85 | 85 | assert form.expired? |
86 | 86 | |
87 | 87 | form.begining = Time.now - 1.day |
88 | 88 | form.ending = Time.now + 1.day |
89 | - assert !form.expired? | |
89 | + refute form.expired? | |
90 | 90 | end |
91 | 91 | |
92 | 92 | should 'define if form will still open' do |
93 | 93 | form = CustomFormsPlugin::Form.new |
94 | - assert !form.will_open? | |
94 | + refute form.will_open? | |
95 | 95 | |
96 | 96 | form.begining = Time.now + 1.day |
97 | 97 | assert form.will_open? |
98 | 98 | |
99 | 99 | form.begining = Time.now - 1.day |
100 | - assert !form.will_open? | |
100 | + refute form.will_open? | |
101 | 101 | |
102 | 102 | form.begining = Time.now - 2.day |
103 | 103 | form.ending = Time.now - 1.day |
104 | 104 | assert form.expired? |
105 | - assert !form.will_open? | |
105 | + refute form.will_open? | |
106 | 106 | end |
107 | 107 | |
108 | 108 | should 'validates format of access' do |
109 | 109 | form = CustomFormsPlugin::Form.new |
110 | 110 | form.valid? |
111 | - assert !form.errors.include?(:access) | |
111 | + refute form.errors.include?(:access) | |
112 | 112 | |
113 | 113 | form.access = 'bli' |
114 | 114 | form.valid? |
... | ... | @@ -116,11 +116,11 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase |
116 | 116 | |
117 | 117 | form.access = 'logged' |
118 | 118 | form.valid? |
119 | - assert !form.errors.include?(:access) | |
119 | + refute form.errors.include?(:access) | |
120 | 120 | |
121 | 121 | form.access = 'associated' |
122 | 122 | form.valid? |
123 | - assert !form.errors.include?(:access) | |
123 | + refute form.errors.include?(:access) | |
124 | 124 | |
125 | 125 | form.access = {:bli => 1} |
126 | 126 | form.valid? |
... | ... | @@ -133,13 +133,13 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase |
133 | 133 | p1 = fast_create(Profile) |
134 | 134 | form.access = p1.id |
135 | 135 | form.valid? |
136 | - assert !form.errors.include?(:access) | |
136 | + refute form.errors.include?(:access) | |
137 | 137 | |
138 | 138 | p2 = fast_create(Profile) |
139 | 139 | p3 = fast_create(Profile) |
140 | 140 | form.access = [p1,p2,p3].map(&:id) |
141 | 141 | form.valid? |
142 | - assert !form.errors.include?(:access) | |
142 | + refute form.errors.include?(:access) | |
143 | 143 | end |
144 | 144 | |
145 | 145 | should 'defines who is able to access the form' do |
... | ... | @@ -148,25 +148,25 @@ class CustomFormsPlugin::FormTest < ActiveSupport::TestCase |
148 | 148 | assert form.accessible_to(nil) |
149 | 149 | |
150 | 150 | form.access = 'logged' |
151 | - assert !form.accessible_to(nil) | |
151 | + refute form.accessible_to(nil) | |
152 | 152 | person = fast_create(Person) |
153 | 153 | assert form.accessible_to(person) |
154 | 154 | |
155 | 155 | form.access = 'associated' |
156 | - assert !form.accessible_to(person) | |
156 | + refute form.accessible_to(person) | |
157 | 157 | owner.add_member(person) |
158 | 158 | assert form.accessible_to(person) |
159 | 159 | |
160 | 160 | p1 = fast_create(Profile) |
161 | 161 | form.access = p1.id |
162 | - assert !form.accessible_to(person) | |
162 | + refute form.accessible_to(person) | |
163 | 163 | assert form.accessible_to(p1) |
164 | 164 | |
165 | 165 | p2 = fast_create(Profile) |
166 | 166 | form.access = [person.id, p1.id] |
167 | 167 | assert form.accessible_to(person) |
168 | 168 | assert form.accessible_to(p1) |
169 | - assert !form.accessible_to(p2) | |
169 | + refute form.accessible_to(p2) | |
170 | 170 | form.access << p2.id |
171 | 171 | assert form.accessible_to(p2) |
172 | 172 | ... | ... |
plugins/custom_forms/test/unit/custom_forms_plugin/membership_survey_test.rb
... | ... | @@ -8,7 +8,7 @@ class CustomFormsPlugin::MembershipSurveyTest < ActiveSupport::TestCase |
8 | 8 | |
9 | 9 | task.form_id = 1 |
10 | 10 | task.valid? |
11 | - assert !task.errors.include?(:form_id) | |
11 | + refute task.errors.include?(:form_id) | |
12 | 12 | end |
13 | 13 | |
14 | 14 | should 'create submission with answers on perform' do | ... | ... |
plugins/custom_forms/test/unit/custom_forms_plugin/select_field_test.rb
... | ... | @@ -3,7 +3,7 @@ require File.dirname(__FILE__) + '/../../../../../test/test_helper' |
3 | 3 | class CustomFormsPlugin::SelectFieldTest < ActiveSupport::TestCase |
4 | 4 | should 'have alternative' do |
5 | 5 | select = CustomFormsPlugin::SelectField.new(:name => 'select_field001' ) |
6 | - assert !select.save | |
6 | + refute select.save | |
7 | 7 | |
8 | 8 | select.alternatives << CustomFormsPlugin::Alternative.new(:label => 'option') |
9 | 9 | assert select.save | ... | ... |
plugins/custom_forms/test/unit/custom_forms_plugin/submission_test.rb
... | ... | @@ -14,7 +14,7 @@ class CustomFormsPlugin::SubmissionTest < ActiveSupport::TestCase |
14 | 14 | form = CustomFormsPlugin::Form.create!(:name => 'Free Software', :profile => profile) |
15 | 15 | submission.form = form |
16 | 16 | submission.valid? |
17 | - assert !submission.errors.include?(:form) | |
17 | + refute submission.errors.include?(:form) | |
18 | 18 | end |
19 | 19 | |
20 | 20 | should 'belong to a profile' do |
... | ... | @@ -32,8 +32,8 @@ class CustomFormsPlugin::SubmissionTest < ActiveSupport::TestCase |
32 | 32 | submission.author_name = 'Jack Sparrow' |
33 | 33 | submission.author_email = 'jack@black-pearl.com' |
34 | 34 | submission.valid? |
35 | - assert !submission.errors.include?(:author_name) | |
36 | - assert !submission.errors.include?(:author_email) | |
35 | + refute submission.errors.include?(:author_name) | |
36 | + refute submission.errors.include?(:author_email) | |
37 | 37 | end |
38 | 38 | |
39 | 39 | should 'have answers' do | ... | ... |
plugins/custom_forms/test/unit/ext/role_assingment_test.rb
... | ... | @@ -67,6 +67,6 @@ class RoleAssignmentsTest < ActiveSupport::TestCase |
67 | 67 | assert_difference 'CustomFormsPlugin::AdmissionSurvey.count', 2 do |
68 | 68 | organization.add_member(person) |
69 | 69 | end |
70 | - assert !organization.members.include?(person) | |
70 | + refute organization.members.include?(person) | |
71 | 71 | end |
72 | 72 | end | ... | ... |
plugins/event/test/unit/event_block_test.rb
... | ... | @@ -169,11 +169,11 @@ class EventBlockTest < ActiveSupport::TestCase |
169 | 169 | @block.all_env_events = true |
170 | 170 | |
171 | 171 | # Do not list event from private profile for non logged visitor |
172 | - assert ! @block.events.include?(ev) | |
172 | + refute @block.events.include?(ev) | |
173 | 173 | assert_equal 4, @block.events.length |
174 | 174 | |
175 | 175 | # Do not list event from private profile for non unprivileged user |
176 | - assert ! @block.events.include?(ev) | |
176 | + refute @block.events.include?(ev) | |
177 | 177 | assert_equal 4, @block.events(@p1).length |
178 | 178 | |
179 | 179 | # Must to list event from private profile for a friend | ... | ... |
plugins/lattes_curriculum/test/unit/academic_info_test.rb
... | ... | @@ -8,7 +8,7 @@ class AcademicInfoTest < ActiveSupport::TestCase |
8 | 8 | |
9 | 9 | should 'not ve invalid lattes url' do |
10 | 10 | @academic_info.lattes_url = "http://softwarelivre.org/" |
11 | - assert !@academic_info.save | |
11 | + refute @academic_info.save | |
12 | 12 | end |
13 | 13 | |
14 | 14 | should 'accept blank lattes url' do | ... | ... |
plugins/ldap/test/unit/ext/environment_test.rb
... | ... | @@ -130,7 +130,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
130 | 130 | should 'ldap_plugin_onthefly_register return false if ldap onthefly_register variable is defined as false' do |
131 | 131 | value = '0' |
132 | 132 | @enviroment.ldap_plugin_onthefly_register= value |
133 | - assert !@enviroment.ldap_plugin_onthefly_register | |
133 | + refute @enviroment.ldap_plugin_onthefly_register | |
134 | 134 | end |
135 | 135 | |
136 | 136 | should 'ldap_plugin_filter= define the ldap filter' do |
... | ... | @@ -160,7 +160,7 @@ class EnvironmentTest < ActiveSupport::TestCase |
160 | 160 | should 'tls return false if ldap tls variable is defined as false' do |
161 | 161 | value = '0' |
162 | 162 | @enviroment.ldap_plugin_tls= value |
163 | - assert !@enviroment.ldap_plugin_tls | |
163 | + refute @enviroment.ldap_plugin_tls | |
164 | 164 | end |
165 | 165 | |
166 | 166 | should 'validates presence of host' do |
... | ... | @@ -171,12 +171,12 @@ class EnvironmentTest < ActiveSupport::TestCase |
171 | 171 | |
172 | 172 | @enviroment.ldap_plugin_host= "http://somehost.com" |
173 | 173 | @enviroment.valid? |
174 | - assert !@enviroment.errors.include?(:ldap_plugin_host) | |
174 | + refute @enviroment.errors.include?(:ldap_plugin_host) | |
175 | 175 | end |
176 | 176 | |
177 | 177 | should 'validates presence of host only if some ldap configuration is defined' do |
178 | 178 | @enviroment.valid? |
179 | - assert !@enviroment.errors.include?(:ldap_plugin_host) | |
179 | + refute @enviroment.errors.include?(:ldap_plugin_host) | |
180 | 180 | |
181 | 181 | @enviroment.ldap_plugin= {:port => 3000} |
182 | 182 | @enviroment.valid? | ... | ... |
plugins/ldap/test/unit/ldap_authentication_test.rb
... | ... | @@ -96,7 +96,7 @@ class LdapAuthenticationTest < ActiveSupport::TestCase |
96 | 96 | |
97 | 97 | should "onthefly_register be false as default" do |
98 | 98 | ldap = LdapAuthentication.new |
99 | - assert !ldap.onthefly_register | |
99 | + refute ldap.onthefly_register | |
100 | 100 | end |
101 | 101 | |
102 | 102 | should "create with onthefly_register passed as parameter" do |
... | ... | @@ -118,7 +118,7 @@ class LdapAuthenticationTest < ActiveSupport::TestCase |
118 | 118 | |
119 | 119 | should "tls be false as default" do |
120 | 120 | ldap = LdapAuthentication.new |
121 | - assert !ldap.tls | |
121 | + refute ldap.tls | |
122 | 122 | end |
123 | 123 | |
124 | 124 | should "create with tls passed as parameter" do |
... | ... | @@ -134,7 +134,7 @@ class LdapAuthenticationTest < ActiveSupport::TestCase |
134 | 134 | |
135 | 135 | should "onthefly_register? return false if onthefly_register is false" do |
136 | 136 | ldap = LdapAuthentication.new('onthefly_register' => false) |
137 | - assert !ldap.onthefly_register? | |
137 | + refute ldap.onthefly_register? | |
138 | 138 | end |
139 | 139 | |
140 | 140 | if ldap_configured? | ... | ... |
plugins/ldap/test/unit/ldap_plugin_test.rb
... | ... | @@ -4,12 +4,12 @@ class LdapPluginTest < ActiveSupport::TestCase |
4 | 4 | |
5 | 5 | should "not allow user registration" do |
6 | 6 | plugin = LdapPlugin.new |
7 | - assert !plugin.allow_user_registration | |
7 | + refute plugin.allow_user_registration | |
8 | 8 | end |
9 | 9 | |
10 | 10 | should "not allow password recovery" do |
11 | 11 | plugin = LdapPlugin.new |
12 | - assert !plugin.allow_password_recovery | |
12 | + refute plugin.allow_password_recovery | |
13 | 13 | end |
14 | 14 | |
15 | 15 | end | ... | ... |
plugins/mark_comment_as_read/test/unit/mark_comment_as_read_plugin/comment_test.rb
... | ... | @@ -9,7 +9,7 @@ class MarkCommentAsReadPlugin::CommentTest < ActiveSupport::TestCase |
9 | 9 | end |
10 | 10 | |
11 | 11 | should 'mark comment as read' do |
12 | - assert !@comment.marked_as_read?(@person) | |
12 | + refute @comment.marked_as_read?(@person) | |
13 | 13 | @comment.mark_as_read(@person) |
14 | 14 | assert @comment.marked_as_read?(@person) |
15 | 15 | end |
... | ... | @@ -25,7 +25,7 @@ class MarkCommentAsReadPlugin::CommentTest < ActiveSupport::TestCase |
25 | 25 | @comment.mark_as_read(@person) |
26 | 26 | assert @comment.marked_as_read?(@person) |
27 | 27 | @comment.mark_as_not_read(@person) |
28 | - assert !@comment.marked_as_read?(@person) | |
28 | + refute @comment.marked_as_read?(@person) | |
29 | 29 | end |
30 | 30 | |
31 | 31 | should 'return comments marked as read for a user' do | ... | ... |
plugins/mark_comment_as_read/test/unit/mark_comment_as_read_test.rb
... | ... | @@ -26,7 +26,7 @@ class MarkCommentAsReadPluginTest < ActiveSupport::TestCase |
26 | 26 | self.stubs(:user).returns(nil) |
27 | 27 | action = @plugin.comment_actions(@comment) |
28 | 28 | link = self.instance_eval(&action) |
29 | - assert !link | |
29 | + refute link | |
30 | 30 | end |
31 | 31 | |
32 | 32 | should 'return actions when comment is not read' do |
... | ... | @@ -46,7 +46,7 @@ class MarkCommentAsReadPluginTest < ActiveSupport::TestCase |
46 | 46 | self.stubs(:user).returns(nil) |
47 | 47 | action = @plugin.check_comment_actions(@comment) |
48 | 48 | id = self.instance_eval(&action) |
49 | - assert !id | |
49 | + refute id | |
50 | 50 | end |
51 | 51 | |
52 | 52 | should 'return id of mark as not read link when comment is read' do |
... | ... | @@ -70,14 +70,14 @@ class MarkCommentAsReadPluginTest < ActiveSupport::TestCase |
70 | 70 | |
71 | 71 | should 'do not return extra content if comment is not marked as read' do |
72 | 72 | content = @plugin.article_extra_contents(@article) |
73 | - assert !self.instance_eval(&content) | |
73 | + refute self.instance_eval(&content) | |
74 | 74 | end |
75 | 75 | |
76 | 76 | should 'do not return extra content if user is not logged in' do |
77 | 77 | @comment.mark_as_read(@person) |
78 | 78 | self.stubs(:user).returns(nil) |
79 | 79 | content = @plugin.article_extra_contents(@article) |
80 | - assert !self.instance_eval(&content) | |
80 | + refute self.instance_eval(&content) | |
81 | 81 | end |
82 | 82 | |
83 | 83 | def link_to_function(content, url, options = {}) | ... | ... |
plugins/oauth_client/test/unit/user_test.rb
... | ... | @@ -24,12 +24,12 @@ class UserTest < ActiveSupport::TestCase |
24 | 24 | |
25 | 25 | should 'not activate user when created without oauth' do |
26 | 26 | user = fast_create(User) |
27 | - assert !user.activated? | |
27 | + refute user.activated? | |
28 | 28 | end |
29 | 29 | |
30 | 30 | should 'not make activation code when created with oauth' do |
31 | 31 | user = User.create!(:email => 'testoauth@example.com', :login => 'testoauth', :oauth_providers => [provider]) |
32 | - assert !user.activation_code | |
32 | + refute user.activation_code | |
33 | 33 | end |
34 | 34 | |
35 | 35 | should 'make activation code when created without oauth' do | ... | ... |
plugins/people_block/test/unit/people_block_plugin_test.rb
... | ... | @@ -15,7 +15,7 @@ class PeopleBlockPluginTest < ActiveSupport::TestCase |
15 | 15 | end |
16 | 16 | |
17 | 17 | should "return false for class method has_admin_url?" do |
18 | - assert !PeopleBlockPlugin.has_admin_url? | |
18 | + refute PeopleBlockPlugin.has_admin_url? | |
19 | 19 | end |
20 | 20 | |
21 | 21 | should "return false for class method stylesheet?" do | ... | ... |
plugins/recent_content/test/unit/recent_content_block_test.rb
... | ... | @@ -15,7 +15,7 @@ class RecentContentBlockTest < ActiveSupport::TestCase |
15 | 15 | |
16 | 16 | should 'blog_picture be false by default' do |
17 | 17 | block = RecentContentBlock.new |
18 | - assert !block.show_blog_picture | |
18 | + refute block.show_blog_picture | |
19 | 19 | end |
20 | 20 | |
21 | 21 | should 'blog_picture is being stored and restored from database as true' do |
... | ... | @@ -33,7 +33,7 @@ class RecentContentBlockTest < ActiveSupport::TestCase |
33 | 33 | block.save |
34 | 34 | block.reload |
35 | 35 | |
36 | - assert !block.show_blog_picture | |
36 | + refute block.show_blog_picture | |
37 | 37 | end |
38 | 38 | |
39 | 39 | should 'root be nil for new blocks' do | ... | ... |
plugins/require_auth_to_comment/test/unit/require_auth_to_comment_plugin_test.rb
... | ... | @@ -19,7 +19,7 @@ class RequireAuthToCommentPluginTest < ActiveSupport::TestCase |
19 | 19 | should 'allow comments from authenticated users' do |
20 | 20 | plugin.context = logged_in(true) |
21 | 21 | plugin.filter_comment(comment) |
22 | - assert !comment.rejected? | |
22 | + refute comment.rejected? | |
23 | 23 | end |
24 | 24 | |
25 | 25 | should 'allow comments from unauthenticated users if allowed by profile' do |
... | ... | @@ -27,7 +27,7 @@ class RequireAuthToCommentPluginTest < ActiveSupport::TestCase |
27 | 27 | plugin.context.profile.allow_unauthenticated_comments = true |
28 | 28 | |
29 | 29 | plugin.filter_comment(comment) |
30 | - assert !comment.rejected? | |
30 | + refute comment.rejected? | |
31 | 31 | end |
32 | 32 | |
33 | 33 | should 'the default require type setting be hide_button' do |
... | ... | @@ -38,7 +38,7 @@ class RequireAuthToCommentPluginTest < ActiveSupport::TestCase |
38 | 38 | context = mock(); |
39 | 39 | context.expects(:environment).returns(environment) |
40 | 40 | plugin.expects(:context).returns(context) |
41 | - assert !plugin.display_login_popup? | |
41 | + refute plugin.display_login_popup? | |
42 | 42 | end |
43 | 43 | |
44 | 44 | should 'display_login_popup? be true if require_type is defined as display_login_popup' do |
... | ... | @@ -51,7 +51,7 @@ class RequireAuthToCommentPluginTest < ActiveSupport::TestCase |
51 | 51 | |
52 | 52 | should 'not display stylesheet if login popup is active' do |
53 | 53 | plugin.expects(:display_login_popup?).returns(true) |
54 | - assert !plugin.stylesheet? | |
54 | + refute plugin.stylesheet? | |
55 | 55 | end |
56 | 56 | |
57 | 57 | should 'display stylesheet if login popup is inactive' do | ... | ... |
plugins/send_email/test/unit/send_email_plugin_mail_test.rb
... | ... | @@ -14,17 +14,17 @@ class SendEmailPluginMailTest < ActiveSupport::TestCase |
14 | 14 | |
15 | 15 | should 'requires to field' do |
16 | 16 | mail = SendEmailPlugin::Mail.new(:subject => 'Hi', :message => 'Hi john', :environment => @environment) |
17 | - assert !mail.valid? | |
17 | + refute mail.valid? | |
18 | 18 | end |
19 | 19 | |
20 | 20 | should 'require message field' do |
21 | 21 | mail = SendEmailPlugin::Mail.new(:subject => 'Hi', :to => 'john@example.com', :environment => @environment) |
22 | - assert !mail.valid? | |
22 | + refute mail.valid? | |
23 | 23 | end |
24 | 24 | |
25 | 25 | should 'require environment field' do |
26 | 26 | mail = SendEmailPlugin::Mail.new(:subject => 'Hi', :to => 'john@example.com', :message => 'Hi john') |
27 | - assert !mail.valid? | |
27 | + refute mail.valid? | |
28 | 28 | end |
29 | 29 | |
30 | 30 | should 'have a default subject' do |
... | ... | @@ -34,18 +34,18 @@ class SendEmailPluginMailTest < ActiveSupport::TestCase |
34 | 34 | |
35 | 35 | should 'not accept invalid email address' do |
36 | 36 | mail = SendEmailPlugin::Mail.new(:subject => 'Hi', :message => 'Hi john', :to => 'invalid-mail-address', :environment => @environment) |
37 | - assert !mail.valid? | |
37 | + refute mail.valid? | |
38 | 38 | end |
39 | 39 | |
40 | 40 | should 'not accept email that is not in allowed address list' do |
41 | 41 | mail = SendEmailPlugin::Mail.new(:subject => 'Hi', :message => 'Hi john', :to => 'unknow@example.com', :environment => @environment) |
42 | - assert !mail.valid? | |
42 | + refute mail.valid? | |
43 | 43 | end |
44 | 44 | |
45 | 45 | should 'discard some keys on set params hash' do |
46 | 46 | mail = SendEmailPlugin::Mail.new(:params => {:action => 1, :controller => 2, :to => 3, :message => 4, :subject => 5, :age => 6}) |
47 | 47 | [:params].each do |k| |
48 | - assert !mail.params.include?(k) | |
48 | + refute mail.params.include?(k) | |
49 | 49 | end |
50 | 50 | assert mail.params.include?(:age) |
51 | 51 | end |
... | ... | @@ -57,7 +57,7 @@ class SendEmailPluginMailTest < ActiveSupport::TestCase |
57 | 57 | |
58 | 58 | should "invalid if just one listed in 'to' list was not allowed" do |
59 | 59 | mail = SendEmailPlugin::Mail.new(:subject => 'Hi', :message => 'Hi john', :to => 'john@example.com,notallowed@example.com,someother@example.com', :environment => @environment) |
60 | - assert !mail.valid? | |
60 | + refute mail.valid? | |
61 | 61 | end |
62 | 62 | |
63 | 63 | end | ... | ... |
plugins/shopping_cart/test/functional/shopping_cart_plugin_controller_test.rb
... | ... | @@ -40,8 +40,8 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase |
40 | 40 | should 'not add product to cart if it does not exists' do |
41 | 41 | assert_nothing_raised { get :add, :id => 9999 } |
42 | 42 | |
43 | - assert !product_in_cart?(product) | |
44 | - assert !response_ok? | |
43 | + refute product_in_cart?(product) | |
44 | + refute response_ok? | |
45 | 45 | assert_equal 3, reponse_error_code |
46 | 46 | end |
47 | 47 | |
... | ... | @@ -50,15 +50,15 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase |
50 | 50 | assert cart? |
51 | 51 | |
52 | 52 | get :remove, :id => product.id |
53 | - assert !cart? | |
53 | + refute cart? | |
54 | 54 | end |
55 | 55 | |
56 | 56 | should 'not try to remove a product if there is no cart' do |
57 | 57 | instantiate_cart |
58 | - assert !cart? | |
58 | + refute cart? | |
59 | 59 | |
60 | 60 | assert_nothing_raised { get :remove, :id => 9999 } |
61 | - assert !response_ok? | |
61 | + refute response_ok? | |
62 | 62 | assert_equal 2, reponse_error_code |
63 | 63 | end |
64 | 64 | |
... | ... | @@ -69,7 +69,7 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase |
69 | 69 | |
70 | 70 | get :remove, :id => product.id |
71 | 71 | assert cart? |
72 | - assert !product_in_cart?(product) | |
72 | + refute product_in_cart?(product) | |
73 | 73 | end |
74 | 74 | |
75 | 75 | should 'not try to remove a product that is not in the cart' do |
... | ... | @@ -77,16 +77,16 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase |
77 | 77 | assert cart? |
78 | 78 | assert_nothing_raised { get :remove, :id => 9999 } |
79 | 79 | |
80 | - assert !response_ok? | |
80 | + refute response_ok? | |
81 | 81 | assert_equal 4, reponse_error_code |
82 | 82 | end |
83 | 83 | |
84 | 84 | should 'not try to list the cart if there is no cart' do |
85 | 85 | instantiate_cart |
86 | - assert !cart? | |
86 | + refute cart? | |
87 | 87 | |
88 | 88 | assert_nothing_raised { get :list } |
89 | - assert !response_ok? | |
89 | + refute response_ok? | |
90 | 90 | assert_equal 2, reponse_error_code |
91 | 91 | end |
92 | 92 | |
... | ... | @@ -107,10 +107,10 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase |
107 | 107 | |
108 | 108 | should 'not try to update quantity the quantity of a product if there is no cart' do |
109 | 109 | instantiate_cart |
110 | - assert !cart? | |
110 | + refute cart? | |
111 | 111 | |
112 | 112 | assert_nothing_raised { get :update_quantity, :id => 9999, :quantity => 3 } |
113 | - assert !response_ok? | |
113 | + refute response_ok? | |
114 | 114 | assert_equal 2, reponse_error_code |
115 | 115 | end |
116 | 116 | |
... | ... | @@ -119,7 +119,7 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase |
119 | 119 | assert cart? |
120 | 120 | assert_nothing_raised { get :update_quantity, :id => 9999, :quantity => 3 } |
121 | 121 | |
122 | - assert !response_ok? | |
122 | + refute response_ok? | |
123 | 123 | assert_equal 4, reponse_error_code |
124 | 124 | end |
125 | 125 | |
... | ... | @@ -127,11 +127,11 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase |
127 | 127 | get :add, :id => product.id |
128 | 128 | |
129 | 129 | assert_nothing_raised { get :update_quantity, :id => product.id, :quantity => -1} |
130 | - assert !response_ok? | |
130 | + refute response_ok? | |
131 | 131 | assert_equal 5, reponse_error_code |
132 | 132 | |
133 | 133 | assert_nothing_raised { get :update_quantity, :id => product.id, :quantity => 'asdf'} |
134 | - assert !response_ok? | |
134 | + refute response_ok? | |
135 | 135 | assert_equal 5, reponse_error_code |
136 | 136 | end |
137 | 137 | |
... | ... | @@ -141,12 +141,12 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase |
141 | 141 | get :add, :id => another_product.id |
142 | 142 | |
143 | 143 | assert_nothing_raised { get :clean } |
144 | - assert !cart? | |
144 | + refute cart? | |
145 | 145 | end |
146 | 146 | |
147 | 147 | should 'not crash if there is no cart' do |
148 | 148 | instantiate_cart |
149 | - assert !cart? | |
149 | + refute cart? | |
150 | 150 | assert_nothing_raised { get :clean } |
151 | 151 | end |
152 | 152 | |
... | ... | @@ -185,12 +185,12 @@ class ShoppingCartPluginControllerTest < ActionController::TestCase |
185 | 185 | product1 = fast_create(Product, :profile_id => profile.id) |
186 | 186 | post :add, :id => product1.id |
187 | 187 | post :send_request, :customer => { :name => "Manuel", :email => "manuel@ceu.com" } |
188 | - assert !cart?, "cart expected to be empty!" | |
188 | + refute cart?, "cart expected to be empty!" | |
189 | 189 | end |
190 | 190 | |
191 | 191 | should 'not allow buy without any cart' do |
192 | 192 | get :buy |
193 | - assert !json_response[:ok] | |
193 | + refute json_response[:ok] | |
194 | 194 | assert_equal 2, json_response['error']['code'] |
195 | 195 | end |
196 | 196 | ... | ... |
plugins/shopping_cart/test/functional/shopping_cart_plugin_myprofile_controller_test.rb
... | ... | @@ -25,7 +25,7 @@ class ShoppingCartPluginMyprofileControllerTest < ActionController::TestCase |
25 | 25 | settings.save! |
26 | 26 | post :edit, :profile => profile.identifier, :settings => {:enabled => '0'} |
27 | 27 | |
28 | - assert !settings.enabled | |
28 | + refute settings.enabled | |
29 | 29 | end |
30 | 30 | |
31 | 31 | should 'be able to enable shopping cart delivery' do |
... | ... | @@ -41,7 +41,7 @@ class ShoppingCartPluginMyprofileControllerTest < ActionController::TestCase |
41 | 41 | settings.save! |
42 | 42 | post :edit, :profile => profile.identifier, :settings => {:delivery => '0'} |
43 | 43 | |
44 | - assert !settings.delivery | |
44 | + refute settings.delivery | |
45 | 45 | end |
46 | 46 | |
47 | 47 | should 'be able to choose the delivery price' do | ... | ... |
plugins/shopping_cart/test/unit/shopping_cart_plugin_test.rb
... | ... | @@ -29,6 +29,6 @@ class ShoppingCartPluginTest < ActiveSupport::TestCase |
29 | 29 | should 'be disabled by default on the enterprise' do |
30 | 30 | profile = fast_create(Enterprise) |
31 | 31 | settings = Noosfero::Plugin::Settings.new(profile, ShoppingCartPlugin) |
32 | - assert !settings.enabled | |
32 | + refute settings.enabled | |
33 | 33 | end |
34 | 34 | end | ... | ... |
plugins/solr/test/functional/search_controller_test.rb
... | ... | @@ -51,7 +51,7 @@ class SearchControllerTest < ActionController::TestCase |
51 | 51 | art.save! |
52 | 52 | |
53 | 53 | get 'articles', :query => 'article found' |
54 | - assert !assigns(:searches)[:articles][:facets].blank? | |
54 | + refute assigns(:searches)[:articles][:facets].blank? | |
55 | 55 | assert assigns(:searches)[:articles][:facets]['facet_fields']['solr_plugin_f_type_facet'][0][0] == 'Article' |
56 | 56 | assert assigns(:searches)[:articles][:facets]['facet_fields']['solr_plugin_f_profile_type_facet'][0][0] == 'Person' |
57 | 57 | assert assigns(:searches)[:articles][:facets]['facet_fields']['solr_plugin_f_category_facet'][0][0] == 'cat1' |
... | ... | @@ -69,7 +69,7 @@ class SearchControllerTest < ActionController::TestCase |
69 | 69 | |
70 | 70 | get 'people', :query => 'Hildebrando' |
71 | 71 | |
72 | - assert !assigns(:searches)[:people][:facets].blank? | |
72 | + refute assigns(:searches)[:people][:facets].blank? | |
73 | 73 | assert assigns(:searches)[:people][:facets]['facet_fields']['solr_plugin_f_region_facet'][0][0] == city.id.to_s |
74 | 74 | |
75 | 75 | categories_facet = assigns(:searches)[:people][:facets]['facet_fields']['solr_plugin_f_categories_facet'] |
... | ... | @@ -89,7 +89,7 @@ class SearchControllerTest < ActionController::TestCase |
89 | 89 | prod.save! |
90 | 90 | |
91 | 91 | get 'products', :query => 'Sound' |
92 | - assert !assigns(:searches)[:products][:facets].blank? | |
92 | + refute assigns(:searches)[:products][:facets].blank? | |
93 | 93 | assert assigns(:searches)[:products][:facets]['facet_fields']['solr_plugin_f_category_facet'][0][0] == @product_category.name |
94 | 94 | assert assigns(:searches)[:products][:facets]['facet_fields']['solr_plugin_f_region_facet'][0][0] == city.id.to_s |
95 | 95 | assert assigns(:searches)[:products][:facets]['facet_fields']['solr_plugin_f_qualifier_facet'][0][0] == "#{qualifier1.id} 0" | ... | ... |
plugins/solr/test/unit/acts_as_faceted_test.rb
... | ... | @@ -69,7 +69,7 @@ class ActsAsFacetedTest < ActiveSupport::TestCase |
69 | 69 | |
70 | 70 | should 'show facets option for solr' do |
71 | 71 | assert TestModel.facets_option_for_solr.include?(:f_type) |
72 | - assert !TestModel.facets_option_for_solr.include?(:f_published_at) | |
72 | + refute TestModel.facets_option_for_solr.include?(:f_published_at) | |
73 | 73 | end |
74 | 74 | |
75 | 75 | should 'show facets fields for solr' do | ... | ... |
plugins/solr/test/unit/profile_test.rb
... | ... | @@ -91,7 +91,7 @@ class ProfileTest < ActiveSupport::TestCase |
91 | 91 | p = create(Profile, :name => 'wanted') |
92 | 92 | |
93 | 93 | assert Profile.find_by_contents('wanted')[:results].include?(p) |
94 | - assert ! Profile.find_by_contents('not_wanted')[:results].include?(p) | |
94 | + refute Profile.find_by_contents('not_wanted')[:results].include?(p) | |
95 | 95 | end |
96 | 96 | |
97 | 97 | # This problem should be solved; talk to Bráulio if it fails | ... | ... |
plugins/spaminator/test/functional/spaminator_plugin_admin_controller_test.rb
... | ... | @@ -38,7 +38,7 @@ class SpaminatorPluginAdminControllerTest < ActionController::TestCase |
38 | 38 | get :withhold |
39 | 39 | reload_settings |
40 | 40 | |
41 | - assert !settings.deployed | |
41 | + refute settings.deployed | |
42 | 42 | end |
43 | 43 | |
44 | 44 | should 'make spaminator scan' do |
... | ... | @@ -70,7 +70,7 @@ class SpaminatorPluginAdminControllerTest < ActionController::TestCase |
70 | 70 | reload_settings |
71 | 71 | |
72 | 72 | assert settings.scheduled_scan.nil? |
73 | - assert !Delayed::Job.exists?(settings.scheduled_scan) | |
73 | + refute Delayed::Job.exists?(settings.scheduled_scan) | |
74 | 74 | end |
75 | 75 | |
76 | 76 | private | ... | ... |
plugins/spaminator/test/unit/spaminator_plugin/report_test.rb
... | ... | @@ -9,7 +9,7 @@ class SpaminatorPlugin::ReportTest < ActiveSupport::TestCase |
9 | 9 | |
10 | 10 | report.environment = Environment.default |
11 | 11 | report.valid? |
12 | - assert !report.errors.include?(:environment) | |
12 | + refute report.errors.include?(:environment) | |
13 | 13 | end |
14 | 14 | |
15 | 15 | should 'have scope of all reports from an environment' do | ... | ... |
plugins/spaminator/test/unit/spaminator_plugin/spaminator_test.rb
... | ... | @@ -87,7 +87,7 @@ class SpaminatorPlugin::SpaminatorTest < ActiveSupport::TestCase |
87 | 87 | |
88 | 88 | spaminator.send(:process_person_by_comments, person) |
89 | 89 | assert_equal 0, report.spammers_by_comments |
90 | - assert !person.abuser? | |
90 | + refute person.abuser? | |
91 | 91 | |
92 | 92 | fast_create(Comment, :author_id => person, :spam => true) |
93 | 93 | spaminator.send(:process_person_by_comments, person) |
... | ... | @@ -107,17 +107,17 @@ class SpaminatorPlugin::SpaminatorTest < ActiveSupport::TestCase |
107 | 107 | fast_create(Comment, :author_id => person) |
108 | 108 | |
109 | 109 | spaminator.send(:process_person_by_no_network, person) |
110 | - assert !person.abuser? | |
110 | + refute person.abuser? | |
111 | 111 | assert_equal 0, report.spammers_by_no_network |
112 | 112 | assert_equal 0, report.spams_by_no_network |
113 | 113 | assert person.visible |
114 | 114 | |
115 | 115 | c1.remove_member(person) |
116 | 116 | spaminator.send(:process_person_by_no_network, person) |
117 | - assert !person.abuser? | |
117 | + refute person.abuser? | |
118 | 118 | assert_equal 1, report.spammers_by_no_network |
119 | 119 | assert_equal 2, report.spams_by_no_network |
120 | - assert !person.visible | |
120 | + refute person.visible | |
121 | 121 | end |
122 | 122 | |
123 | 123 | should 'mark person as spammer' do |
... | ... | @@ -126,7 +126,7 @@ class SpaminatorPlugin::SpaminatorTest < ActiveSupport::TestCase |
126 | 126 | spaminator.send(:mark_as_spammer, person) |
127 | 127 | end |
128 | 128 | person.reload |
129 | - assert !person.visible | |
129 | + refute person.visible | |
130 | 130 | end |
131 | 131 | |
132 | 132 | should 'send email notification after disabling person' do | ... | ... |
plugins/statistics/test/unit/statistics_block_test.rb
... | ... | @@ -11,7 +11,7 @@ class StatisticsBlockTest < ActiveSupport::TestCase |
11 | 11 | ['community_counter', 'enterprise_counter', 'product_counter', 'category_counter', 'hit_counter'].map do |counter| |
12 | 12 | should "#{counter} be false by default" do |
13 | 13 | b = StatisticsBlock.new |
14 | - assert !b.is_visible?(counter) | |
14 | + refute b.is_visible?(counter) | |
15 | 15 | end |
16 | 16 | end |
17 | 17 | |
... | ... | @@ -41,7 +41,7 @@ class StatisticsBlockTest < ActiveSupport::TestCase |
41 | 41 | should 'is_visible? return false if setting is false' do |
42 | 42 | b = StatisticsBlock.new |
43 | 43 | b.community_counter = false |
44 | - assert !b.is_visible?('community_counter') | |
44 | + refute b.is_visible?('community_counter') | |
45 | 45 | end |
46 | 46 | |
47 | 47 | should 'templates return the Community templates of the Environment' do |
... | ... | @@ -349,7 +349,7 @@ class StatisticsBlockTest < ActiveSupport::TestCase |
349 | 349 | should 'is_template_counter_active? return false if setting is false' do |
350 | 350 | b = StatisticsBlock.new |
351 | 351 | b.templates_ids_counter = {'1' => 'false'} |
352 | - assert !b.is_template_counter_active?(1) | |
352 | + refute b.is_template_counter_active?(1) | |
353 | 353 | end |
354 | 354 | |
355 | 355 | should 'template_counter_count return the amount of communities of the Environment using a template' do | ... | ... |
plugins/stoa/test/functional/account_controller_test.rb
... | ... | @@ -38,7 +38,7 @@ class AccountControllerTest < ActionController::TestCase |
38 | 38 | should 'pass if confirmation value matches' do |
39 | 39 | #StoaPlugin::UspUser.stubs(:matches?).returns(true) |
40 | 40 | post :signup, :profile_data => {:usp_id => '12345678'}, :confirmation_field => 'cpf', :cpf => '12345678' |
41 | - assert !assigns(:person).errors.include?(:usp_id) | |
41 | + refute assigns(:person).errors.include?(:usp_id) | |
42 | 42 | end |
43 | 43 | |
44 | 44 | should 'include invitation_code param in the person\'s attributes' do | ... | ... |
plugins/stoa/test/functional/stoa_plugin_controller_test.rb
... | ... | @@ -99,7 +99,7 @@ class StoaPluginControllerTest < ActionController::TestCase |
99 | 99 | |
100 | 100 | post :authenticate, :login => user.login, :password => '123456', :fields => 'special' |
101 | 101 | |
102 | - assert !json_response.keys.include?('f1') | |
102 | + refute json_response.keys.include?('f1') | |
103 | 103 | assert json_response.keys.include?('f2') |
104 | 104 | assert json_response.keys.include?('f3') |
105 | 105 | end |
... | ... | @@ -153,7 +153,7 @@ class StoaPluginControllerTest < ActionController::TestCase |
153 | 153 | usp_id = '87654321' |
154 | 154 | StoaPlugin::UspUser.stubs(:exists?).with(usp_id).returns(false) |
155 | 155 | get :check_usp_id, :usp_id => usp_id |
156 | - assert !json_response['exists'] | |
156 | + refute json_response['exists'] | |
157 | 157 | end |
158 | 158 | |
159 | 159 | should 'check existent cpf' do |
... | ... | @@ -176,7 +176,7 @@ class StoaPluginControllerTest < ActionController::TestCase |
176 | 176 | user_with_cpf.stubs(:cpf).returns(nil) |
177 | 177 | StoaPlugin::UspUser.stubs(:find_by_codpes).with(usp_id_without_cpf).returns(user_without_cpf) |
178 | 178 | get :check_cpf, :usp_id => usp_id_without_cpf |
179 | - assert !json_response['exists'] | |
179 | + refute json_response['exists'] | |
180 | 180 | end |
181 | 181 | |
182 | 182 | private | ... | ... |
plugins/stoa/test/unit/person_api_test.rb
... | ... | @@ -98,7 +98,7 @@ class StoaPlugin::PersonApiTest < ActiveSupport::TestCase |
98 | 98 | create_article_with_tags(person.id, 'free_software') |
99 | 99 | |
100 | 100 | api = StoaPlugin::PersonApi.new(person) |
101 | - assert !api.tags.has_key?('noosfero') | |
101 | + refute api.tags.has_key?('noosfero') | |
102 | 102 | end |
103 | 103 | |
104 | 104 | should 'provide communities' do | ... | ... |
plugins/stoa/test/unit/person_test.rb
... | ... | @@ -33,12 +33,12 @@ class StoaPlugin::Person < ActiveSupport::TestCase |
33 | 33 | Task.create!(:code => 12345678) |
34 | 34 | person.invitation_code = 12345678 |
35 | 35 | person.valid? |
36 | - assert !person.errors.include?(:usp_id) | |
36 | + refute person.errors.include?(:usp_id) | |
37 | 37 | |
38 | 38 | person.invitation_code = nil |
39 | 39 | person.is_template = true |
40 | 40 | person.valid? |
41 | - assert !person.errors.include?(:usp_id) | |
41 | + refute person.errors.include?(:usp_id) | |
42 | 42 | end |
43 | 43 | |
44 | 44 | should 'allow multiple nil usp_id' do |
... | ... | @@ -47,7 +47,7 @@ class StoaPlugin::Person < ActiveSupport::TestCase |
47 | 47 | person = Person.new(:invitation_code => 87654321) |
48 | 48 | person.valid? |
49 | 49 | |
50 | - assert !person.errors.include?(:usp_id) | |
50 | + refute person.errors.include?(:usp_id) | |
51 | 51 | end |
52 | 52 | |
53 | 53 | should 'not allow person to be saved with a finished invitation that is not his own' do |
... | ... | @@ -68,7 +68,7 @@ class StoaPlugin::Person < ActiveSupport::TestCase |
68 | 68 | t.finish |
69 | 69 | |
70 | 70 | person.valid? |
71 | - assert !person.errors.include?(:usp_id) | |
71 | + refute person.errors.include?(:usp_id) | |
72 | 72 | end |
73 | 73 | |
74 | 74 | ... | ... |
plugins/stoa/test/unit/usp_user_test.rb
... | ... | @@ -21,19 +21,19 @@ class StoaPlugin::UspUserTest < ActiveSupport::TestCase |
21 | 21 | |
22 | 22 | should 'check existence of usp_id' do |
23 | 23 | assert StoaPlugin::UspUser.exists?(123456) |
24 | - assert !StoaPlugin::UspUser.exists?(654321) | |
24 | + refute StoaPlugin::UspUser.exists?(654321) | |
25 | 25 | end |
26 | 26 | |
27 | 27 | should 'check if usp_id matches with a cpf' do |
28 | 28 | assert StoaPlugin::UspUser.matches?(123456, :cpf, 12345678) |
29 | - assert !StoaPlugin::UspUser.matches?(123456, :cpf, 87654321) | |
30 | - assert !StoaPlugin::UspUser.matches?(654321, :cpf, 12345678) | |
29 | + refute StoaPlugin::UspUser.matches?(123456, :cpf, 87654321) | |
30 | + refute StoaPlugin::UspUser.matches?(654321, :cpf, 12345678) | |
31 | 31 | end |
32 | 32 | |
33 | 33 | should 'check if usp_id matches with a birth_date' do |
34 | 34 | assert StoaPlugin::UspUser.matches?(123456, :birth_date, '1970-01-30') |
35 | - assert !StoaPlugin::UspUser.matches?(123456, :birth_date, '1999-01-30') | |
36 | - assert !StoaPlugin::UspUser.matches?(654321, :birth_date, '1970-01-30') | |
35 | + refute StoaPlugin::UspUser.matches?(123456, :birth_date, '1999-01-30') | |
36 | + refute StoaPlugin::UspUser.matches?(654321, :birth_date, '1970-01-30') | |
37 | 37 | end |
38 | 38 | |
39 | 39 | should 'filter leading zeroes of id codes on exists and matches' do | ... | ... |
plugins/sub_organizations/test/unit/related_organizations_block_test.rb
... | ... | @@ -25,6 +25,6 @@ class RelatedOrganizationsBlockTest < ActiveSupport::TestCase |
25 | 25 | |
26 | 26 | assert @block.related_organizations.include?(child1) |
27 | 27 | assert @block.related_organizations.include?(child2) |
28 | - assert !@block.related_organizations.include?(org1) | |
28 | + refute @block.related_organizations.include?(org1) | |
29 | 29 | end |
30 | 30 | end | ... | ... |
plugins/sub_organizations/test/unit/sub_organizations_plugin/relation_test.rb
... | ... | @@ -28,7 +28,7 @@ class SubOrganizationsPlugin::RelationTest < ActiveSupport::TestCase |
28 | 28 | should 'not allow self relation' do |
29 | 29 | org = fast_create(Organization) |
30 | 30 | relation = SubOrganizationsPlugin::Relation.new(:parent => org, :child => org) |
31 | - assert !relation.valid? | |
31 | + refute relation.valid? | |
32 | 32 | assert relation.errors.include?(:child) |
33 | 33 | end |
34 | 34 | |
... | ... | @@ -60,7 +60,7 @@ class SubOrganizationsPlugin::RelationTest < ActiveSupport::TestCase |
60 | 60 | SubOrganizationsPlugin::Relation.create!(:parent => org1, :child => org2) |
61 | 61 | relation = SubOrganizationsPlugin::Relation.new(:parent => org2, :child => org1) |
62 | 62 | |
63 | - assert !relation.valid? | |
63 | + refute relation.valid? | |
64 | 64 | assert relation.errors.include?(:child) |
65 | 65 | end |
66 | 66 | |
... | ... | @@ -72,10 +72,10 @@ class SubOrganizationsPlugin::RelationTest < ActiveSupport::TestCase |
72 | 72 | r1 = SubOrganizationsPlugin::Relation.new(:parent => org2, :child => org3) |
73 | 73 | r2 = SubOrganizationsPlugin::Relation.new(:parent => org3, :child => org1) |
74 | 74 | |
75 | - assert !r1.valid? | |
75 | + refute r1.valid? | |
76 | 76 | assert r1.errors.include?(:child) |
77 | 77 | |
78 | - assert !r2.valid? | |
78 | + refute r2.valid? | |
79 | 79 | assert r2.errors.include?(:child) |
80 | 80 | end |
81 | 81 | ... | ... |
plugins/tolerance_time/test/unit/tolerance_time_plugin/publication_test.rb
... | ... | @@ -10,8 +10,8 @@ class ToleranceTimePlugin::PublicationTest < ActiveSupport::TestCase |
10 | 10 | publication.target = fast_create(Article) |
11 | 11 | publication.valid? |
12 | 12 | |
13 | - assert !publication.errors[:target_id].present? | |
14 | - assert !publication.errors[:target_type].present? | |
13 | + refute publication.errors[:target_id].present? | |
14 | + refute publication.errors[:target_type].present? | |
15 | 15 | end |
16 | 16 | |
17 | 17 | should 'validate uniqueness of target' do |
... | ... | @@ -51,9 +51,9 @@ class ToleranceTimePlugin::PublicationTest < ActiveSupport::TestCase |
51 | 51 | on_time_comment.save! |
52 | 52 | |
53 | 53 | assert expired_article.expired? |
54 | - assert !on_time_article.expired? | |
54 | + refute on_time_article.expired? | |
55 | 55 | assert expired_comment.expired? |
56 | - assert !on_time_comment.expired? | |
56 | + refute on_time_comment.expired? | |
57 | 57 | end |
58 | 58 | |
59 | 59 | should 'consider tolerance infinity if not defined' do |
... | ... | @@ -64,7 +64,7 @@ class ToleranceTimePlugin::PublicationTest < ActiveSupport::TestCase |
64 | 64 | article_publication.save! |
65 | 65 | ToleranceTimePlugin::Tolerance.create!(:profile => profile) |
66 | 66 | |
67 | - assert !article_publication.expired? | |
67 | + refute article_publication.expired? | |
68 | 68 | end |
69 | 69 | |
70 | 70 | should 'not crash if profile has no tolerance yet defined' do |
... | ... | @@ -74,6 +74,6 @@ class ToleranceTimePlugin::PublicationTest < ActiveSupport::TestCase |
74 | 74 | article_publication.created_at = 1000.years.ago |
75 | 75 | article_publication.save! |
76 | 76 | |
77 | - assert !article_publication.expired? | |
77 | + refute article_publication.expired? | |
78 | 78 | end |
79 | 79 | end | ... | ... |
plugins/tolerance_time/test/unit/tolerance_time_plugin/tolerance_test.rb
... | ... | @@ -8,7 +8,7 @@ class ToleranceTimePlugin::ToleranceTest < ActiveSupport::TestCase |
8 | 8 | |
9 | 9 | tolerance.profile = fast_create(Profile) |
10 | 10 | tolerance.valid? |
11 | - assert !tolerance.errors[:profile_id].present? | |
11 | + refute tolerance.errors[:profile_id].present? | |
12 | 12 | end |
13 | 13 | |
14 | 14 | should 'validate uniqueness of profile' do | ... | ... |
plugins/video/test/unit/video_block_test.rb
... | ... | @@ -36,19 +36,19 @@ class VideoBlockTest < ActiveSupport::TestCase |
36 | 36 | should "is_youtube return false when the url not contains youtube video ID" do |
37 | 37 | block = VideoBlock.new |
38 | 38 | block.url = "youtube.com/" |
39 | - assert !block.is_youtube? | |
39 | + refute block.is_youtube? | |
40 | 40 | end |
41 | 41 | |
42 | 42 | should "is_youtube return false when the url contains empty youtube video ID" do |
43 | 43 | block = VideoBlock.new |
44 | 44 | block.url = "youtube.com/?v=" |
45 | - assert !block.is_youtube? | |
45 | + refute block.is_youtube? | |
46 | 46 | end |
47 | 47 | |
48 | 48 | should "is_youtube return false when the url contains an invalid youtube link" do |
49 | 49 | block = VideoBlock.new |
50 | 50 | block.url = "http://www.yt.com/?v=XXXXX" |
51 | - assert !block.is_youtube? | |
51 | + refute block.is_youtube? | |
52 | 52 | end |
53 | 53 | |
54 | 54 | should "format embed video for youtube videos" do |
... | ... | @@ -131,19 +131,19 @@ class VideoBlockTest < ActiveSupport::TestCase |
131 | 131 | should "is_vimeo return false when the url not contains vimeo video ID" do |
132 | 132 | block = VideoBlock.new |
133 | 133 | block.url = "vimeo.com/home" |
134 | - assert !block.is_vimeo? | |
134 | + refute block.is_vimeo? | |
135 | 135 | end |
136 | 136 | |
137 | 137 | should "is_vimeo return false when the url contains empty vimeo video ID" do |
138 | 138 | block = VideoBlock.new |
139 | 139 | block.url = "vimeo.com/" |
140 | - assert !block.is_vimeo? | |
140 | + refute block.is_vimeo? | |
141 | 141 | end |
142 | 142 | |
143 | 143 | should "is_vimeo return false when the url contains an invalid vimeo link" do |
144 | 144 | block = VideoBlock.new |
145 | 145 | block.url = "http://www.vmsd.com/98979" |
146 | - assert !block.is_vimeo? | |
146 | + refute block.is_vimeo? | |
147 | 147 | end |
148 | 148 | |
149 | 149 | should "format embed video for vimeo videos" do |
... | ... | @@ -205,13 +205,13 @@ class VideoBlockTest < ActiveSupport::TestCase |
205 | 205 | should "is_video return false if url ends without mp4, ogg, ogv, webm" do |
206 | 206 | block = VideoBlock.new |
207 | 207 | block.url = "http://www.vmsd.com/98979.mp4r" |
208 | - assert !block.is_video_file? | |
208 | + refute block.is_video_file? | |
209 | 209 | block.url = "http://www.vmsd.com/98979.oggr" |
210 | - assert !block.is_video_file? | |
210 | + refute block.is_video_file? | |
211 | 211 | block.url = "http://www.vmsd.com/98979.ogvr" |
212 | - assert !block.is_video_file? | |
212 | + refute block.is_video_file? | |
213 | 213 | block.url = "http://www.vmsd.com/98979.webmr" |
214 | - assert !block.is_video_file? | |
214 | + refute block.is_video_file? | |
215 | 215 | end |
216 | 216 | |
217 | 217 | should 'display video block partial' do | ... | ... |
plugins/vote/test/functional/vote_plugin_profile_controller_test.rb
... | ... | @@ -27,7 +27,7 @@ class VotePluginProfileControllerTest < ActionController::TestCase |
27 | 27 | |
28 | 28 | should 'not vote if value is not allowed' do |
29 | 29 | xhr :post, :vote, :profile => profile.identifier, :id => comment.id, :model => 'comment', :vote => 4 |
30 | - assert !profile.voted_on?(comment) | |
30 | + refute profile.voted_on?(comment) | |
31 | 31 | end |
32 | 32 | |
33 | 33 | should 'not vote in a disallowed model' do |
... | ... | @@ -43,7 +43,7 @@ class VotePluginProfileControllerTest < ActionController::TestCase |
43 | 43 | should 'unlike comment' do |
44 | 44 | xhr :post, :vote, :profile => profile.identifier, :id => comment.id, :model => 'comment', :vote => 1 |
45 | 45 | xhr :post, :vote, :profile => profile.identifier, :id => comment.id, :model => 'comment', :vote => 1 |
46 | - assert !profile.voted_for?(comment) | |
46 | + refute profile.voted_for?(comment) | |
47 | 47 | end |
48 | 48 | |
49 | 49 | should 'dislike comment' do |
... | ... | @@ -54,7 +54,7 @@ class VotePluginProfileControllerTest < ActionController::TestCase |
54 | 54 | should 'undislike comment' do |
55 | 55 | xhr :post, :vote, :profile => profile.identifier, :id => comment.id, :model => 'comment', :vote => -1 |
56 | 56 | xhr :post, :vote, :profile => profile.identifier, :id => comment.id, :model => 'comment', :vote => -1 |
57 | - assert !profile.voted_against?(comment) | |
57 | + refute profile.voted_against?(comment) | |
58 | 58 | end |
59 | 59 | |
60 | 60 | should 'dislike a liked comment' do | ... | ... |
plugins/work_assignment/test/unit/work_assingment_plugin_test.rb
... | ... | @@ -15,7 +15,7 @@ class WorkAssignmentPluginTest < ActiveSupport::TestCase |
15 | 15 | }, |
16 | 16 | :without_protection => true |
17 | 17 | ) |
18 | - assert !WorkAssignmentPlugin.is_submission?(content) | |
18 | + refute WorkAssignmentPlugin.is_submission?(content) | |
19 | 19 | |
20 | 20 | work_assignment = WorkAssignmentPlugin::WorkAssignment.create!(:name => 'Work Assignment', :profile => organization) |
21 | 21 | content.parent = work_assignment |
... | ... | @@ -28,7 +28,7 @@ class WorkAssignmentPluginTest < ActiveSupport::TestCase |
28 | 28 | |
29 | 29 | should 'be able to download submission if work_assignment published submissions' do |
30 | 30 | submission = create_submission |
31 | - assert !WorkAssignmentPlugin.can_download_submission?(nil, submission) | |
31 | + refute WorkAssignmentPlugin.can_download_submission?(nil, submission) | |
32 | 32 | |
33 | 33 | work_assignment = submission.parent.parent |
34 | 34 | work_assignment.publish_submissions = true |
... | ... | @@ -41,7 +41,7 @@ class WorkAssignmentPluginTest < ActiveSupport::TestCase |
41 | 41 | should 'be able to download submission if the user is author of it' do |
42 | 42 | person = fast_create(Person) |
43 | 43 | submission = create_submission |
44 | - assert !WorkAssignmentPlugin.can_download_submission?(person, submission) | |
44 | + refute WorkAssignmentPlugin.can_download_submission?(person, submission) | |
45 | 45 | |
46 | 46 | submission = create_submission(person) |
47 | 47 | assert WorkAssignmentPlugin.can_download_submission?(person, submission) |
... | ... | @@ -50,7 +50,7 @@ class WorkAssignmentPluginTest < ActiveSupport::TestCase |
50 | 50 | should 'be able to download submission if the user has the view_private_content permission on the profile' do |
51 | 51 | person = fast_create(Person) |
52 | 52 | submission = create_submission |
53 | - assert !WorkAssignmentPlugin.can_download_submission?(person, submission) | |
53 | + refute WorkAssignmentPlugin.can_download_submission?(person, submission) | |
54 | 54 | |
55 | 55 | moderator = create_user_with_permission('moderator', 'view_private_content', submission.profile) |
56 | 56 | assert WorkAssignmentPlugin.can_download_submission?(moderator, submission) | ... | ... |
test/functional/account_controller_test.rb
... | ... | @@ -141,14 +141,14 @@ class AccountControllerTest < ActionController::TestCase |
141 | 141 | users(:johndoe).update_attribute :remember_token_expires_at, 5.minutes.ago |
142 | 142 | @request.cookies["auth_token"] = cookie_for(:johndoe) |
143 | 143 | get :index |
144 | - assert !@controller.send(:logged_in?) | |
144 | + refute @controller.send(:logged_in?) | |
145 | 145 | end |
146 | 146 | |
147 | 147 | should 'fail cookie login' do |
148 | 148 | users(:johndoe).remember_me |
149 | 149 | @request.cookies["auth_token"] = auth_token('invalid_auth_token') |
150 | 150 | get :index |
151 | - assert !@controller.send(:logged_in?) | |
151 | + refute @controller.send(:logged_in?) | |
152 | 152 | end |
153 | 153 | |
154 | 154 | def test_should_display_anonymous_user_options |
... | ... | @@ -186,7 +186,7 @@ class AccountControllerTest < ActionController::TestCase |
186 | 186 | post :change_password, :current_password => 'wrong', :new_password => 'blabla', :new_password_confirmation => 'blabla' |
187 | 187 | assert_response :success |
188 | 188 | assert_template 'change_password' |
189 | - assert ! User.find_by_login('ze').authenticated?('blabla') | |
189 | + refute User.find_by_login('ze').authenticated?('blabla') | |
190 | 190 | assert_equal users(:ze), @controller.send(:current_user) |
191 | 191 | end |
192 | 192 | |
... | ... | @@ -195,8 +195,8 @@ class AccountControllerTest < ActionController::TestCase |
195 | 195 | post :change_password, :current_password => 'test', :new_password => 'blabla', :new_password_confirmation => 'blibli' |
196 | 196 | assert_response :success |
197 | 197 | assert_template 'change_password' |
198 | - assert !assigns(:current_user).authenticated?('blabla') | |
199 | - assert !assigns(:current_user).authenticated?('blibli') | |
198 | + refute assigns(:current_user).authenticated?('blabla') | |
199 | + refute assigns(:current_user).authenticated?('blibli') | |
200 | 200 | assert_equal users(:ze), @controller.send(:current_user) |
201 | 201 | end |
202 | 202 | |
... | ... | @@ -281,7 +281,7 @@ class AccountControllerTest < ActionController::TestCase |
281 | 281 | assert_response :success |
282 | 282 | assert_template 'new_password' |
283 | 283 | |
284 | - assert !User.find(user.id).authenticated?('onepass') | |
284 | + refute User.find(user.id).authenticated?('onepass') | |
285 | 285 | end |
286 | 286 | |
287 | 287 | should 'display login popup' do |
... | ... | @@ -535,7 +535,7 @@ class AccountControllerTest < ActionController::TestCase |
535 | 535 | post :activate_enterprise, :enterprise_code => '0123456789', :answer => '1998', :terms_accepted => false |
536 | 536 | ent.reload |
537 | 537 | |
538 | - assert !ent.enabled | |
538 | + refute ent.enabled | |
539 | 539 | assert_not_includes ent.members, p |
540 | 540 | end |
541 | 541 | ... | ... |
test/functional/admin_panel_controller_test.rb
... | ... | @@ -102,7 +102,7 @@ class AdminPanelControllerTest < ActionController::TestCase |
102 | 102 | post :site_info, :environment => { :terms_of_use => content } |
103 | 103 | assert_redirected_to :action => 'index' |
104 | 104 | |
105 | - assert !Environment.default.has_terms_of_use? | |
105 | + refute Environment.default.has_terms_of_use? | |
106 | 106 | end |
107 | 107 | |
108 | 108 | should 'save subject and body of signup welcome text' do |
... | ... | @@ -113,7 +113,7 @@ class AdminPanelControllerTest < ActionController::TestCase |
113 | 113 | |
114 | 114 | assert_equal subject, Environment.default.signup_welcome_text[:subject] |
115 | 115 | assert_equal body, Environment.default.signup_welcome_text[:body] |
116 | - assert !Environment.default.signup_welcome_text.blank? | |
116 | + refute Environment.default.signup_welcome_text.blank? | |
117 | 117 | end |
118 | 118 | |
119 | 119 | should 'not save empty string as signup welcome text' do |
... | ... | @@ -121,7 +121,7 @@ class AdminPanelControllerTest < ActionController::TestCase |
121 | 121 | post :site_info, :environment => { :signup_welcome_text_body => content } |
122 | 122 | assert_redirected_to :action => 'index' |
123 | 123 | |
124 | - assert !Environment.default.has_signup_welcome_text? | |
124 | + refute Environment.default.has_signup_welcome_text? | |
125 | 125 | end |
126 | 126 | |
127 | 127 | should 'sanitize message for disabled enterprise with white_list' do |
... | ... | @@ -390,6 +390,6 @@ class AdminPanelControllerTest < ActionController::TestCase |
390 | 390 | assert_redirected_to :action => 'index' |
391 | 391 | |
392 | 392 | assert_equal body, Environment.default.signup_welcome_screen_body |
393 | - assert !Environment.default.signup_welcome_screen_body.blank? | |
393 | + refute Environment.default.signup_welcome_screen_body.blank? | |
394 | 394 | end |
395 | 395 | end | ... | ... |
test/functional/application_controller_test.rb
... | ... | @@ -150,7 +150,7 @@ class ApplicationControllerTest < ActionController::TestCase |
150 | 150 | class DoesNotUsesBlocksTestController < ApplicationController |
151 | 151 | no_design_blocks |
152 | 152 | end |
153 | - assert !DoesNotUsesBlocksTestController.new.send(:uses_design_blocks?) | |
153 | + refute DoesNotUsesBlocksTestController.new.send(:uses_design_blocks?) | |
154 | 154 | end |
155 | 155 | |
156 | 156 | should 'generate blocks' do | ... | ... |
test/functional/cms_controller_test.rb
... | ... | @@ -141,7 +141,7 @@ class CmsControllerTest < ActionController::TestCase |
141 | 141 | profile.description = 'a' * 600 |
142 | 142 | profile.save(:validate => false) |
143 | 143 | |
144 | - assert !profile.valid? | |
144 | + refute profile.valid? | |
145 | 145 | assert_not_equal a, profile.home_page |
146 | 146 | |
147 | 147 | post :set_home_page, :profile => profile.identifier, :id => a.id |
... | ... | @@ -779,9 +779,9 @@ class CmsControllerTest < ActionController::TestCase |
779 | 779 | post :new, :profile => profile.identifier, :type => 'TextileArticle', :parent_id => folder.id, :article => { :name => 'new-private-article'} |
780 | 780 | folder.reload |
781 | 781 | |
782 | - assert !assigns(:article).published? | |
782 | + refute assigns(:article).published? | |
783 | 783 | assert_equal 'new-private-article', folder.children[0].name |
784 | - assert !folder.children[0].published? | |
784 | + refute folder.children[0].published? | |
785 | 785 | end |
786 | 786 | |
787 | 787 | should 'publish the article in the selected community if community is not moderated' do |
... | ... | @@ -1310,7 +1310,7 @@ class CmsControllerTest < ActionController::TestCase |
1310 | 1310 | |
1311 | 1311 | UploadedFile.attachment_options[:thumbnails].each do |suffix, size| |
1312 | 1312 | assert File.exists?(UploadedFile.find(file_1.id).public_filename(suffix)) |
1313 | - assert !File.exists?(UploadedFile.find(file_2.id).public_filename(suffix)) | |
1313 | + refute File.exists?(UploadedFile.find(file_2.id).public_filename(suffix)) | |
1314 | 1314 | end |
1315 | 1315 | file_1.destroy |
1316 | 1316 | file_2.destroy |
... | ... | @@ -1553,7 +1553,7 @@ class CmsControllerTest < ActionController::TestCase |
1553 | 1553 | profile.articles << Blog.new(:name => 'Blog for test', :profile => profile, :display_posts_in_current_language => true) |
1554 | 1554 | post :edit, :profile => profile.identifier, :id => profile.blog.id, :article => { :display_posts_in_current_language => false } |
1555 | 1555 | profile.blog.reload |
1556 | - assert !profile.blog.display_posts_in_current_language? | |
1556 | + refute profile.blog.display_posts_in_current_language? | |
1557 | 1557 | end |
1558 | 1558 | |
1559 | 1559 | should 'update to true blog display posts in current language setting' do | ... | ... |
test/functional/comment_controller_test.rb
... | ... | @@ -417,7 +417,7 @@ class CommentControllerTest < ActionController::TestCase |
417 | 417 | login_as 'normaluser' # normaluser cannot remove other people's comments |
418 | 418 | xhr :post, :mark_as_spam, :profile => profile.identifier, :id => comment.id |
419 | 419 | comment.reload |
420 | - assert !comment.spam? | |
420 | + refute comment.spam? | |
421 | 421 | end |
422 | 422 | |
423 | 423 | should "not be able to mark as spam other people's comments if not moderator or admin and return json if is an ajax request" do |
... | ... | @@ -434,7 +434,7 @@ class CommentControllerTest < ActionController::TestCase |
434 | 434 | xhr :post, :mark_as_spam, :profile => profile.identifier, :id => comment.id |
435 | 435 | assert_response :success |
436 | 436 | comment.reload |
437 | - assert !comment.spam? | |
437 | + refute comment.spam? | |
438 | 438 | assert_match /\{\"ok\":false\}/, @response.body |
439 | 439 | end |
440 | 440 | ... | ... |
test/functional/environment_design_controller_test.rb
... | ... | @@ -207,9 +207,9 @@ class EnvironmentDesignControllerTest < ActionController::TestCase |
207 | 207 | |
208 | 208 | Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([TestBlockPlugin.new]) |
209 | 209 | assert @controller.available_blocks.include?(CustomBlock1) |
210 | - assert !@controller.available_blocks.include?(CustomBlock2) | |
211 | - assert !@controller.available_blocks.include?(CustomBlock3) | |
212 | - assert !@controller.available_blocks.include?(CustomBlock4) | |
210 | + refute @controller.available_blocks.include?(CustomBlock2) | |
211 | + refute @controller.available_blocks.include?(CustomBlock3) | |
212 | + refute @controller.available_blocks.include?(CustomBlock4) | |
213 | 213 | end |
214 | 214 | |
215 | 215 | should 'a block plugin with center position add new blocks only in this position' do |
... | ... | @@ -247,12 +247,12 @@ class EnvironmentDesignControllerTest < ActionController::TestCase |
247 | 247 | assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock1) |
248 | 248 | assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock2) |
249 | 249 | assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock3) |
250 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock4) | |
251 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock5) | |
252 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock6) | |
253 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock7) | |
254 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock8) | |
255 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock9) | |
250 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock4) | |
251 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock5) | |
252 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock6) | |
253 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock7) | |
254 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock8) | |
255 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock9) | |
256 | 256 | end |
257 | 257 | |
258 | 258 | should 'a block plugin with side position add new blocks only in this position' do |
... | ... | @@ -287,9 +287,9 @@ class EnvironmentDesignControllerTest < ActionController::TestCase |
287 | 287 | get :add_block |
288 | 288 | assert_response :success |
289 | 289 | |
290 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock1) | |
291 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock2) | |
292 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock3) | |
290 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock1) | |
291 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock2) | |
292 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock3) | |
293 | 293 | assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock4) |
294 | 294 | assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock5) |
295 | 295 | assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock6) |
... | ... | @@ -328,13 +328,13 @@ class EnvironmentDesignControllerTest < ActionController::TestCase |
328 | 328 | get :add_block |
329 | 329 | assert_response :success |
330 | 330 | |
331 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock1) | |
332 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock2) | |
333 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock3) | |
331 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock1) | |
332 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock2) | |
333 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock3) | |
334 | 334 | assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock4) |
335 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock5) | |
336 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock6) | |
337 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock7) | |
335 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock5) | |
336 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock6) | |
337 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock7) | |
338 | 338 | assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock8) |
339 | 339 | end |
340 | 340 | ... | ... |
test/functional/features_controller_test.rb
... | ... | @@ -38,7 +38,7 @@ class FeaturesControllerTest < ActionController::TestCase |
38 | 38 | v = Environment.find(environments(:anhetegua_net).id) |
39 | 39 | assert v.enabled?('feature2') |
40 | 40 | assert v.enabled?('feature2') |
41 | - assert !v.enabled?('feature3') | |
41 | + refute v.enabled?('feature3') | |
42 | 42 | end |
43 | 43 | |
44 | 44 | def test_update_disable_all |
... | ... | @@ -47,9 +47,9 @@ class FeaturesControllerTest < ActionController::TestCase |
47 | 47 | assert_redirected_to :action => 'index' |
48 | 48 | assert_kind_of String, session[:notice] |
49 | 49 | v = Environment.find(environments(:anhetegua_net).id) |
50 | - assert !v.enabled?('feature1') | |
51 | - assert !v.enabled?('feature2') | |
52 | - assert !v.enabled?('feature3') | |
50 | + refute v.enabled?('feature1') | |
51 | + refute v.enabled?('feature2') | |
52 | + refute v.enabled?('feature3') | |
53 | 53 | end |
54 | 54 | |
55 | 55 | def test_update_no_post | ... | ... |
test/functional/invite_controller_test.rb
... | ... | @@ -164,7 +164,7 @@ class InviteControllerTest < ActionController::TestCase |
164 | 164 | |
165 | 165 | assert ContactList.exists?(contact_list.id) |
166 | 166 | process_delayed_job_queue |
167 | - assert !ContactList.exists?(contact_list.id) | |
167 | + refute ContactList.exists?(contact_list.id) | |
168 | 168 | end |
169 | 169 | |
170 | 170 | should 'destroy contact_list after invitation when import is not manual' do |
... | ... | @@ -173,7 +173,7 @@ class InviteControllerTest < ActionController::TestCase |
173 | 173 | |
174 | 174 | assert ContactList.exists?(contact_list.id) |
175 | 175 | process_delayed_job_queue |
176 | - assert !ContactList.exists?(contact_list.id) | |
176 | + refute ContactList.exists?(contact_list.id) | |
177 | 177 | end |
178 | 178 | |
179 | 179 | should 'return empty hash as invitation data if contact list was not fetched' do | ... | ... |
test/functional/mailconf_controller_test.rb
... | ... | @@ -95,7 +95,7 @@ class MailconfControllerTest < ActionController::TestCase |
95 | 95 | login_as('ze') |
96 | 96 | assert user.enable_email! |
97 | 97 | post :disable, :profile => 'ze' |
98 | - assert !Profile['ze'].user.enable_email | |
98 | + refute Profile['ze'].user.enable_email | |
99 | 99 | end |
100 | 100 | |
101 | 101 | should 'go back on save' do | ... | ... |
test/functional/manage_products_controller_test.rb
... | ... | @@ -44,7 +44,7 @@ class ManageProductsControllerTest < ActionController::TestCase |
44 | 44 | assert_difference 'Product.count' do |
45 | 45 | post 'new', :profile => @enterprise.identifier, :product => {:name => 'test product'}, :selected_category_id => @product_category.id |
46 | 46 | assert assigns(:product) |
47 | - assert !assigns(:product).new_record? | |
47 | + refute assigns(:product).new_record? | |
48 | 48 | end |
49 | 49 | end |
50 | 50 | |
... | ... | @@ -86,7 +86,7 @@ class ManageProductsControllerTest < ActionController::TestCase |
86 | 86 | post :edit, :profile => @enterprise.identifier, :product => {:name => 'new test product'}, :id => product.id, :field => 'name' |
87 | 87 | assert_response :success |
88 | 88 | assert assigns(:product) |
89 | - assert ! assigns(:product).new_record? | |
89 | + refute assigns(:product).new_record? | |
90 | 90 | assert_equal product, Product.find_by_name('new test product') |
91 | 91 | end |
92 | 92 | |
... | ... | @@ -95,7 +95,7 @@ class ManageProductsControllerTest < ActionController::TestCase |
95 | 95 | post :edit, :profile => @enterprise.identifier, :product => {:description => 'A very good product!'}, :id => product.id, :field => 'info' |
96 | 96 | assert_response :success |
97 | 97 | assert assigns(:product) |
98 | - assert ! assigns(:product).new_record? | |
98 | + refute assigns(:product).new_record? | |
99 | 99 | assert_equal 'A very good product!', Product.find_by_name('test product').description |
100 | 100 | end |
101 | 101 | |
... | ... | @@ -104,7 +104,7 @@ class ManageProductsControllerTest < ActionController::TestCase |
104 | 104 | post :edit, :profile => @enterprise.identifier, :product => { :image_builder => { :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png') } }, :id => product.id, :field => 'image' |
105 | 105 | assert_response :success |
106 | 106 | assert assigns(:product) |
107 | - assert ! assigns(:product).new_record? | |
107 | + refute assigns(:product).new_record? | |
108 | 108 | assert_equal 'rails.png', Product.find_by_name('test product').image.filename |
109 | 109 | end |
110 | 110 | |
... | ... | @@ -129,7 +129,7 @@ class ManageProductsControllerTest < ActionController::TestCase |
129 | 129 | assert_response :redirect |
130 | 130 | assert_redirected_to :action => 'index' |
131 | 131 | assert assigns(:product) |
132 | - assert ! Product.find_by_name('test product') | |
132 | + refute Product.find_by_name('test product') | |
133 | 133 | end |
134 | 134 | end |
135 | 135 | |
... | ... | @@ -491,7 +491,7 @@ class ManageProductsControllerTest < ActionController::TestCase |
491 | 491 | resp = ActiveSupport::JSON.decode(@response.body) |
492 | 492 | assert_nil resp['name'] |
493 | 493 | assert_nil resp['id'] |
494 | - assert !resp['ok'] | |
494 | + refute resp['ok'] | |
495 | 495 | assert_match /blank/, resp['error_msg'] |
496 | 496 | end |
497 | 497 | |
... | ... | @@ -501,7 +501,7 @@ class ManageProductsControllerTest < ActionController::TestCase |
501 | 501 | resp = ActiveSupport::JSON.decode(@response.body) |
502 | 502 | assert_nil resp['name'] |
503 | 503 | assert_nil resp['id'] |
504 | - assert !resp['ok'] | |
504 | + refute resp['ok'] | |
505 | 505 | assert_match /too long/, resp['error_msg'] |
506 | 506 | end |
507 | 507 | ... | ... |
test/functional/organizations_controller_test.rb
... | ... | @@ -86,7 +86,7 @@ class OrganizationsControllerTest < ActionController::TestCase |
86 | 86 | |
87 | 87 | should 'activate organization profile' do |
88 | 88 | organization = fast_create(Organization, :visible => false, :environment_id => environment.id) |
89 | - assert !organization.visible? | |
89 | + refute organization.visible? | |
90 | 90 | |
91 | 91 | get :activate, {:id => organization.id} |
92 | 92 | organization.reload |
... | ... | @@ -101,7 +101,7 @@ class OrganizationsControllerTest < ActionController::TestCase |
101 | 101 | get :deactivate, {:id => organization.id} |
102 | 102 | organization.reload |
103 | 103 | |
104 | - assert !organization.visible | |
104 | + refute organization.visible | |
105 | 105 | end |
106 | 106 | |
107 | 107 | should 'destroy organization profile' do | ... | ... |
test/functional/profile_controller_test.rb
... | ... | @@ -595,7 +595,7 @@ class ProfileControllerTest < ActionController::TestCase |
595 | 595 | assert_response :success |
596 | 596 | assert_equal "Message successfully sent.", assigns(:message) |
597 | 597 | profile.reload |
598 | - assert !profile.scraps_received.empty? | |
598 | + refute profile.scraps_received.empty? | |
599 | 599 | end |
600 | 600 | |
601 | 601 | should "leave a scrap on another profile" do |
... | ... | @@ -608,7 +608,7 @@ class ProfileControllerTest < ActionController::TestCase |
608 | 608 | assert_response :success |
609 | 609 | assert_equal "Message successfully sent.", assigns(:message) |
610 | 610 | another_person.reload |
611 | - assert !another_person.scraps_received.empty? | |
611 | + refute another_person.scraps_received.empty? | |
612 | 612 | end |
613 | 613 | |
614 | 614 | should "the owner of scrap could remove it" do |
... | ... | @@ -729,7 +729,7 @@ class ProfileControllerTest < ActionController::TestCase |
729 | 729 | |
730 | 730 | should 'not see the friends activities in the current profile' do |
731 | 731 | p2 = create_user.person |
732 | - assert !profile.is_a_friend?(p2) | |
732 | + refute profile.is_a_friend?(p2) | |
733 | 733 | p3 = create_user.person |
734 | 734 | p3.add_friend(profile) |
735 | 735 | assert p3.is_a_friend?(profile) |
... | ... | @@ -753,7 +753,7 @@ class ProfileControllerTest < ActionController::TestCase |
753 | 753 | should 'see all the activities in the current profile network' do |
754 | 754 | p1= create_user.person |
755 | 755 | p2= create_user.person |
756 | - assert !p1.is_a_friend?(p2) | |
756 | + refute p1.is_a_friend?(p2) | |
757 | 757 | |
758 | 758 | p3= create_user.person |
759 | 759 | p3.add_friend(p1) |
... | ... | @@ -783,7 +783,7 @@ class ProfileControllerTest < ActionController::TestCase |
783 | 783 | should 'the network activity be visible only to profile followers' do |
784 | 784 | p1= create_user.person |
785 | 785 | p2= create_user.person |
786 | - assert !p1.is_a_friend?(p2) | |
786 | + refute p1.is_a_friend?(p2) | |
787 | 787 | |
788 | 788 | p3= create_user.person |
789 | 789 | p3.add_friend(p1) |
... | ... | @@ -826,7 +826,7 @@ class ProfileControllerTest < ActionController::TestCase |
826 | 826 | should 'the network activity be visible only to logged users' do |
827 | 827 | p1= create_user.person |
828 | 828 | p2= create_user.person |
829 | - assert !p1.is_a_friend?(p2) | |
829 | + refute p1.is_a_friend?(p2) | |
830 | 830 | p3= create_user.person |
831 | 831 | p3.add_friend(p1) |
832 | 832 | assert p3.is_a_friend?(p1) |
... | ... | @@ -862,7 +862,7 @@ class ProfileControllerTest < ActionController::TestCase |
862 | 862 | p1= fast_create(Person) |
863 | 863 | community = fast_create(Community) |
864 | 864 | p2= fast_create(Person) |
865 | - assert !p1.is_a_friend?(p2) | |
865 | + refute p1.is_a_friend?(p2) | |
866 | 866 | community.add_member(p1) |
867 | 867 | community.add_member(p2) |
868 | 868 | ActionTracker::Record.destroy_all |
... | ... | @@ -888,7 +888,7 @@ class ProfileControllerTest < ActionController::TestCase |
888 | 888 | should 'the self activity not crashes with user not logged in' do |
889 | 889 | p1= create_user.person |
890 | 890 | p2= create_user.person |
891 | - assert !p1.is_a_friend?(p2) | |
891 | + refute p1.is_a_friend?(p2) | |
892 | 892 | p3= create_user.person |
893 | 893 | p3.add_friend(p1) |
894 | 894 | assert p3.is_a_friend?(p1) |
... | ... | @@ -1404,7 +1404,7 @@ class ProfileControllerTest < ActionController::TestCase |
1404 | 1404 | login_as(profile.identifier) |
1405 | 1405 | get :index, :profile => profile.identifier |
1406 | 1406 | |
1407 | - assert !/This article makes me hungry/.match(@response.body), 'Spam comment was shown!' | |
1407 | + refute /This article makes me hungry/.match(@response.body), 'Spam comment was shown!' | |
1408 | 1408 | end |
1409 | 1409 | |
1410 | 1410 | should 'display comment in wall from non logged users after click in view all comments' do | ... | ... |
test/functional/profile_design_controller_test.rb
... | ... | @@ -203,12 +203,12 @@ class ProfileDesignControllerTest < ActionController::TestCase |
203 | 203 | assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock1) |
204 | 204 | assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock2) |
205 | 205 | assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock3) |
206 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock4) | |
207 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock5) | |
208 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock6) | |
209 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock7) | |
210 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock8) | |
211 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock9) | |
206 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock4) | |
207 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock5) | |
208 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock6) | |
209 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock7) | |
210 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock8) | |
211 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock9) | |
212 | 212 | end |
213 | 213 | |
214 | 214 | should 'a block plugin with side position add new blocks only in this position' do |
... | ... | @@ -242,9 +242,9 @@ class ProfileDesignControllerTest < ActionController::TestCase |
242 | 242 | get :add_block, :profile => 'designtestuser' |
243 | 243 | assert_response :success |
244 | 244 | |
245 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock1) | |
246 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock2) | |
247 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock3) | |
245 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock1) | |
246 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock2) | |
247 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock3) | |
248 | 248 | assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock4) |
249 | 249 | assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock5) |
250 | 250 | assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock6) |
... | ... | @@ -283,13 +283,13 @@ class ProfileDesignControllerTest < ActionController::TestCase |
283 | 283 | assert_response :success |
284 | 284 | |
285 | 285 | assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock1) |
286 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock2) | |
287 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock3) | |
288 | - assert !@controller.instance_variable_get('@center_block_types').include?(CustomBlock4) | |
286 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock2) | |
287 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock3) | |
288 | + refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock4) | |
289 | 289 | assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock5) |
290 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock6) | |
291 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock7) | |
292 | - assert !@controller.instance_variable_get('@side_block_types').include?(CustomBlock8) | |
290 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock6) | |
291 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock7) | |
292 | + refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock8) | |
293 | 293 | end |
294 | 294 | |
295 | 295 | should 'not edit main block with never option' do |
... | ... | @@ -726,7 +726,7 @@ class ProfileDesignControllerTest < ActionController::TestCase |
726 | 726 | end |
727 | 727 | |
728 | 728 | Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([TestBlockPlugin.new]) |
729 | - assert !@controller.available_blocks.include?(CustomBlock1) | |
729 | + refute @controller.available_blocks.include?(CustomBlock1) | |
730 | 730 | end |
731 | 731 | |
732 | 732 | should 'clone a block' do | ... | ... |
test/functional/profile_editor_controller_test.rb
... | ... | @@ -333,7 +333,7 @@ class ProfileEditorControllerTest < ActionController::TestCase |
333 | 333 | |
334 | 334 | post :edit, :profile => org.identifier, :profile_data => { :closed => 'false' } |
335 | 335 | org.reload |
336 | - assert !org.closed | |
336 | + refute org.closed | |
337 | 337 | end |
338 | 338 | |
339 | 339 | should 'not display option to close when it is enterprise' do |
... | ... | @@ -477,13 +477,13 @@ class ProfileEditorControllerTest < ActionController::TestCase |
477 | 477 | should 'not enable enterprise without confirmation' do |
478 | 478 | ent = fast_create(Enterprise, :enabled => false) |
479 | 479 | post :enable, :profile => ent.identifier |
480 | - assert !assigns(:to_enable).enabled? | |
480 | + refute assigns(:to_enable).enabled? | |
481 | 481 | end |
482 | 482 | |
483 | 483 | should 'disable enterprise after confirmation' do |
484 | 484 | ent = fast_create(Enterprise, :enabled => true) |
485 | 485 | post :disable, :profile => ent.identifier, :confirmation => 1 |
486 | - assert !assigns(:to_disable).enabled? | |
486 | + refute assigns(:to_disable).enabled? | |
487 | 487 | end |
488 | 488 | |
489 | 489 | should 'not disable enterprise without confirmation' do |
... | ... | @@ -915,7 +915,7 @@ class ProfileEditorControllerTest < ActionController::TestCase |
915 | 915 | should 'have welcome_page only for template' do |
916 | 916 | organization = fast_create(Organization, :is_template => false) |
917 | 917 | @controller.stubs(:profile).returns(organization) |
918 | - assert !@controller.send(:has_welcome_page) | |
918 | + refute @controller.send(:has_welcome_page) | |
919 | 919 | |
920 | 920 | organization = fast_create(Organization, :is_template => true) |
921 | 921 | @controller.stubs(:profile).returns(organization) |
... | ... | @@ -923,7 +923,7 @@ class ProfileEditorControllerTest < ActionController::TestCase |
923 | 923 | |
924 | 924 | person = fast_create(Person, :is_template => false) |
925 | 925 | @controller.stubs(:profile).returns(person) |
926 | - assert !@controller.send(:has_welcome_page) | |
926 | + refute @controller.send(:has_welcome_page) | |
927 | 927 | |
928 | 928 | person = fast_create(Person, :is_template => true) |
929 | 929 | @controller.stubs(:profile).returns(person) |
... | ... | @@ -948,7 +948,7 @@ class ProfileEditorControllerTest < ActionController::TestCase |
948 | 948 | |
949 | 949 | should 'create welcome_page with public false by default' do |
950 | 950 | get :welcome_page, :profile => fast_create(Person, :is_template => true).identifier |
951 | - assert !assigns(:welcome_page).published | |
951 | + refute assigns(:welcome_page).published | |
952 | 952 | end |
953 | 953 | |
954 | 954 | should 'update welcome page and redirect to index' do | ... | ... |
test/functional/region_validators_controller_test.rb
... | ... | @@ -26,7 +26,7 @@ class RegionValidatorsControllerTest < ActionController::TestCase |
26 | 26 | give_permission('ze', 'manage_environment_validators', environment) |
27 | 27 | region = Region.new(:name => 'my region') |
28 | 28 | environment.regions << region |
29 | - assert !region.new_record? | |
29 | + refute region.new_record? | |
30 | 30 | |
31 | 31 | @controller.expects(:environment).returns(environment).at_least_once |
32 | 32 | |
... | ... | @@ -42,7 +42,7 @@ class RegionValidatorsControllerTest < ActionController::TestCase |
42 | 42 | give_permission('ze', 'manage_environment_validators', environment) |
43 | 43 | region = Region.new(:name => 'my region') |
44 | 44 | environment.regions << region |
45 | - assert !region.new_record? | |
45 | + refute region.new_record? | |
46 | 46 | org = create(Organization, :name => "My frufru organization", :identifier => 'frufru', :environment_id => environment.id) |
47 | 47 | |
48 | 48 | @controller.expects(:environment).returns(environment).at_least_once |
... | ... | @@ -58,7 +58,7 @@ class RegionValidatorsControllerTest < ActionController::TestCase |
58 | 58 | give_permission('ze', 'manage_environment_validators', environment) |
59 | 59 | region = Region.new(:name => 'my region') |
60 | 60 | environment.regions << region |
61 | - assert !region.new_record? | |
61 | + refute region.new_record? | |
62 | 62 | org = create(Organization, :name => "My frufru organization", :identifier => 'frufru', :environment_id => environment.id) |
63 | 63 | |
64 | 64 | @controller.expects(:environment).returns(environment).at_least_once |
... | ... | @@ -75,7 +75,7 @@ class RegionValidatorsControllerTest < ActionController::TestCase |
75 | 75 | give_permission('ze', 'manage_environment_validators', environment) |
76 | 76 | region = Region.new(:name => 'my region') |
77 | 77 | environment.regions << region |
78 | - assert !region.new_record? | |
78 | + refute region.new_record? | |
79 | 79 | org = create(Organization, :name => "My frufru organization", :identifier => 'frufru', :environment_id => environment.id) |
80 | 80 | region.validators << org |
81 | 81 | |
... | ... | @@ -85,7 +85,7 @@ class RegionValidatorsControllerTest < ActionController::TestCase |
85 | 85 | assert_response :redirect |
86 | 86 | assert_redirected_to :action => 'region', :id => region.id |
87 | 87 | |
88 | - assert !Region.find(region.id).validators.include?(org) | |
88 | + refute Region.find(region.id).validators.include?(org) | |
89 | 89 | end |
90 | 90 | |
91 | 91 | end | ... | ... |
test/functional/search_controller_test.rb
... | ... | @@ -267,11 +267,11 @@ class SearchControllerTest < ActionController::TestCase |
267 | 267 | get :index, :query => 'something' |
268 | 268 | |
269 | 269 | assert assigns(:searches).has_key?(:articles) |
270 | - assert !assigns(:searches).has_key?(:enterprises) | |
271 | - assert !assigns(:searches).has_key?(:people) | |
272 | - assert !assigns(:searches).has_key?(:communities) | |
273 | - assert !assigns(:searches).has_key?(:products) | |
274 | - assert !assigns(:searches).has_key?(:events) | |
270 | + refute assigns(:searches).has_key?(:enterprises) | |
271 | + refute assigns(:searches).has_key?(:people) | |
272 | + refute assigns(:searches).has_key?(:communities) | |
273 | + refute assigns(:searches).has_key?(:products) | |
274 | + refute assigns(:searches).has_key?(:events) | |
275 | 275 | end |
276 | 276 | |
277 | 277 | should 'search all enabled assets in general search' do |
... | ... | @@ -288,7 +288,7 @@ class SearchControllerTest < ActionController::TestCase |
288 | 288 | [:articles, :enterprises, :people, :communities, :products, :events].select do |key, name| |
289 | 289 | !assigns(:environment).enabled?('disable_asset_' + key.to_s) |
290 | 290 | end.each do |asset| |
291 | - assert !assigns(:searches)[asset][:results].empty? | |
291 | + refute assigns(:searches)[asset][:results].empty? | |
292 | 292 | end |
293 | 293 | end |
294 | 294 | ... | ... |
test/functional/spam_controller_test.rb
... | ... | @@ -40,13 +40,13 @@ class SpamControllerTest < ActionController::TestCase |
40 | 40 | test "should remove comments" do |
41 | 41 | post :index, :profile => @community.identifier, :remove_comment => @spam_comment.id |
42 | 42 | |
43 | - assert !Comment.exists?(@spam_comment.id) | |
43 | + refute Comment.exists?(@spam_comment.id) | |
44 | 44 | end |
45 | 45 | |
46 | 46 | test "should remove suggest articles" do |
47 | 47 | post :index, :profile => @community.identifier, :remove_task => @spam_suggest_article.id |
48 | 48 | |
49 | - assert !SuggestArticle.exists?(@spam_suggest_article.id) | |
49 | + refute SuggestArticle.exists?(@spam_suggest_article.id) | |
50 | 50 | end |
51 | 51 | |
52 | 52 | should 'properly render spam that have replies' do | ... | ... |
test/functional/tasks_controller_test.rb
... | ... | @@ -517,7 +517,7 @@ class TasksControllerTest < ActionController::TestCase |
517 | 517 | post :change_responsible, :task_id => task.id, :responsible_id => person2.id, :old_responsible => nil |
518 | 518 | assert_equal person1, task.reload.responsible |
519 | 519 | json_response = ActiveSupport::JSON.decode(response.body) |
520 | - assert !json_response['success'] | |
520 | + refute json_response['success'] | |
521 | 521 | end |
522 | 522 | |
523 | 523 | should 'list tasks for user with only view_tasks permission' do | ... | ... |
test/functional/trusted_sites_controller_test.rb
... | ... | @@ -40,14 +40,14 @@ class TrustedSitesControllerTest < ActionController::TestCase |
40 | 40 | @controller.stubs(:add_trusted_site).returns(false) |
41 | 41 | post :create, :site => 'new.site.com' |
42 | 42 | assert_response :success # it actually failed, but was not redirected |
43 | - assert !assigns(:environment).trusted_sites_for_iframe.include?('new.site.com'), 'Site was included in the trusted_sites!?' | |
43 | + refute assigns(:environment).trusted_sites_for_iframe.include?('new.site.com'), 'Site was included in the trusted_sites!?' | |
44 | 44 | end |
45 | 45 | |
46 | 46 | should 'destroy site' do |
47 | 47 | post :create, :site => 'todel.site.com' |
48 | 48 | delete :destroy, :site => 'todel.site.com' |
49 | 49 | assert_redirected_to :action => :index |
50 | - assert ! assigns(:environment).trusted_sites_for_iframe.include?('todel.site.com'), 'Site was not removed from trusted_sites' | |
50 | + refute assigns(:environment).trusted_sites_for_iframe.include?('todel.site.com'), 'Site was not removed from trusted_sites' | |
51 | 51 | end |
52 | 52 | |
53 | 53 | should "get edit" do |
... | ... | @@ -64,7 +64,7 @@ class TrustedSitesControllerTest < ActionController::TestCase |
64 | 64 | post :create, :site => 'toedit.site.com' |
65 | 65 | post :update, :orig_site => 'toedit.site.com', :site => 'edited.site.com' |
66 | 66 | assert_redirected_to :action => :edit |
67 | - assert ! assigns(:environment).trusted_sites_for_iframe.include?('toedit.site.com'), 'Original site found. Site was not updated?' | |
67 | + refute assigns(:environment).trusted_sites_for_iframe.include?('toedit.site.com'), 'Original site found. Site was not updated?' | |
68 | 68 | assert assigns(:environment).trusted_sites_for_iframe.include?('edited.site.com'), 'New name for site not found. Site was not updated?' |
69 | 69 | end |
70 | 70 | |
... | ... | @@ -74,6 +74,6 @@ class TrustedSitesControllerTest < ActionController::TestCase |
74 | 74 | post :update, :orig_site => 'toedit.site.com', :site => 'edited.site.com' |
75 | 75 | assert_response :success # it actually failed, but was not redirected |
76 | 76 | assert assigns(:environment).trusted_sites_for_iframe.include?('toedit.site.com'), 'Original site not found. Site was updated?' |
77 | - assert !assigns(:environment).trusted_sites_for_iframe.include?('edited.site.com'), 'New name for site found. Site was updated?' | |
77 | + refute assigns(:environment).trusted_sites_for_iframe.include?('edited.site.com'), 'New name for site found. Site was updated?' | |
78 | 78 | end |
79 | 79 | end | ... | ... |
test/functional/users_controller_test.rb
test/integration/manage_friendships_test.rb
... | ... | @@ -31,7 +31,7 @@ class ManageFriendshipsTest < ActionController::IntegrationTest |
31 | 31 | follow_redirect! |
32 | 32 | |
33 | 33 | assert assigns(:friends).empty? |
34 | - assert !@person.is_a_friend?(@friend) | |
35 | - assert !@friend.is_a_friend?(@person) | |
34 | + refute @person.is_a_friend?(@friend) | |
35 | + refute @friend.is_a_friend?(@person) | |
36 | 36 | end |
37 | 37 | end | ... | ... |
test/integration/varnish_conf_test.rb
... | ... | @@ -3,7 +3,7 @@ require 'test/unit' |
3 | 3 | class VarnishConfTest < Test::Unit::TestCase |
4 | 4 | |
5 | 5 | def test_not_use_return_in_varnish_noosfero |
6 | - assert !system('grep "return.*pass" etc/noosfero/varnish-noosfero.vcl') | |
6 | + refute system('grep "return.*pass" etc/noosfero/varnish-noosfero.vcl') | |
7 | 7 | end |
8 | 8 | |
9 | 9 | end | ... | ... |
test/unit/abuse_complaint_test.rb
... | ... | @@ -6,7 +6,7 @@ class AbuseComplaintTest < ActiveSupport::TestCase |
6 | 6 | reported = fast_create(Profile) |
7 | 7 | abuse_complaint = AbuseComplaint.new |
8 | 8 | |
9 | - assert !abuse_complaint.valid? | |
9 | + refute abuse_complaint.valid? | |
10 | 10 | assert abuse_complaint.errors[:reported].any? |
11 | 11 | |
12 | 12 | abuse_complaint.reported = reported |
... | ... | @@ -54,6 +54,6 @@ class AbuseComplaintTest < ActiveSupport::TestCase |
54 | 54 | |
55 | 55 | reported.destroy |
56 | 56 | |
57 | - assert !AbuseComplaint.find_by_requestor_id(reported_id), "AbuseComplaint still exist!" | |
57 | + refute AbuseComplaint.find_by_requestor_id(reported_id), "AbuseComplaint still exist!" | |
58 | 58 | end |
59 | 59 | end | ... | ... |
test/unit/abuse_report_test.rb
... | ... | @@ -13,7 +13,7 @@ class AbuseReportTest < ActiveSupport::TestCase |
13 | 13 | should 'ensure presence of complaint, reporter and reported' do |
14 | 14 | abuse_report = AbuseReport.new(:reason => 'some reason') |
15 | 15 | |
16 | - assert !abuse_report.valid? | |
16 | + refute abuse_report.valid? | |
17 | 17 | assert abuse_report.invalid?(:reporter) |
18 | 18 | assert abuse_report.invalid?(:abuse_complaint) |
19 | 19 | ... | ... |
test/unit/action_tracker_notification_test.rb
... | ... | @@ -9,7 +9,7 @@ class ActionTrackerNotificationTest < ActiveSupport::TestCase |
9 | 9 | |
10 | 10 | a.profile_id= 1 |
11 | 11 | a.valid? |
12 | - assert !a.errors[:profile_id.to_s].present? | |
12 | + refute a.errors[:profile_id.to_s].present? | |
13 | 13 | end |
14 | 14 | |
15 | 15 | should "have the action tracker" do |
... | ... | @@ -19,7 +19,7 @@ class ActionTrackerNotificationTest < ActiveSupport::TestCase |
19 | 19 | |
20 | 20 | a.action_tracker_id= 1 |
21 | 21 | a.valid? |
22 | - assert !a.errors[:action_tracker_id.to_s].present? | |
22 | + refute a.errors[:action_tracker_id.to_s].present? | |
23 | 23 | end |
24 | 24 | |
25 | 25 | should "be associated to Person" do |
... | ... | @@ -58,7 +58,7 @@ class ActionTrackerNotificationTest < ActiveSupport::TestCase |
58 | 58 | |
59 | 59 | atn.profile_id = 2 |
60 | 60 | atn.valid? |
61 | - assert !atn.errors[:action_tracker_id.to_s].present? | |
61 | + refute atn.errors[:action_tracker_id.to_s].present? | |
62 | 62 | end |
63 | 63 | |
64 | 64 | should "the action_tracker_id be unique on scope of profile when created by ActionTracker::Record association" do | ... | ... |
test/unit/acts_as_having_settings_test.rb
... | ... | @@ -23,8 +23,8 @@ class ActsAsHavingSettingsTest < ActiveSupport::TestCase |
23 | 23 | block_class = Class.new(Block) |
24 | 24 | |
25 | 25 | block = block_class.new |
26 | - assert !block.respond_to?(:limit) | |
27 | - assert !block.respond_to?(:limit=) | |
26 | + refute block.respond_to?(:limit) | |
27 | + refute block.respond_to?(:limit=) | |
28 | 28 | |
29 | 29 | block_class.settings_items :limit |
30 | 30 | |
... | ... | @@ -89,7 +89,7 @@ class ActsAsHavingSettingsTest < ActiveSupport::TestCase |
89 | 89 | |
90 | 90 | should 'setting_changed be false if a setting passed as parameter was not changed' do |
91 | 91 | obj = TestClass.new |
92 | - assert !obj.setting_changed?('flag') | |
92 | + refute obj.setting_changed?('flag') | |
93 | 93 | end |
94 | 94 | |
95 | 95 | should 'setting_changed be false if a setting passed as parameter was changed with the same value' do |
... | ... | @@ -97,14 +97,14 @@ class ActsAsHavingSettingsTest < ActiveSupport::TestCase |
97 | 97 | obj.flag = true |
98 | 98 | obj.save |
99 | 99 | obj.flag = true |
100 | - assert !obj.setting_changed?('flag') | |
100 | + refute obj.setting_changed?('flag') | |
101 | 101 | end |
102 | 102 | |
103 | 103 | should 'setting_changed be false if a setting passed as parameter was not changed but another setting is changed' do |
104 | 104 | obj = TestClass.new(:name => 'some name') |
105 | 105 | obj.save |
106 | 106 | obj.name = 'antoher nme' |
107 | - assert !obj.setting_changed?('flag') | |
107 | + refute obj.setting_changed?('flag') | |
108 | 108 | end |
109 | 109 | |
110 | 110 | should 'setting_changed be true for all changed fields' do | ... | ... |
test/unit/add_friend_test.rb
... | ... | @@ -101,7 +101,7 @@ class AddFriendTest < ActiveSupport::TestCase |
101 | 101 | |
102 | 102 | task.group_for_person = 'short name' |
103 | 103 | task.valid? |
104 | - assert !task.errors[:group_for_person].present? | |
104 | + refute task.errors[:group_for_person].present? | |
105 | 105 | end |
106 | 106 | |
107 | 107 | should 'limit "group for friend" number of characters' do |
... | ... | @@ -115,7 +115,7 @@ class AddFriendTest < ActiveSupport::TestCase |
115 | 115 | |
116 | 116 | task.group_for_friend = 'short name' |
117 | 117 | task.valid? |
118 | - assert !task.errors[:group_for_friend].present? | |
118 | + refute task.errors[:group_for_friend].present? | |
119 | 119 | end |
120 | 120 | |
121 | 121 | should 'have target notification message if is organization and not moderated' do | ... | ... |
test/unit/application_helper_test.rb
... | ... | @@ -794,7 +794,7 @@ class ApplicationHelperTest < ActionView::TestCase |
794 | 794 | article = fast_create(Article, :name => 'my article') |
795 | 795 | response = content_id_to_str(article) |
796 | 796 | assert_equal String, response.class |
797 | - assert !response.empty? | |
797 | + refute response.empty? | |
798 | 798 | end |
799 | 799 | |
800 | 800 | should 'content_id_to_str return empty string when receiving nil' do | ... | ... |
test/unit/approve_article_test.rb
... | ... | @@ -85,7 +85,7 @@ class ApproveArticleTest < ActiveSupport::TestCase |
85 | 85 | community.stubs(:notification_emails).returns(['adm@example.com']) |
86 | 86 | |
87 | 87 | a = create(ApproveArticle, :name => '', :article => article, :target => community, :requestor => profile) |
88 | - assert !ActionMailer::Base.deliveries.empty? | |
88 | + refute ActionMailer::Base.deliveries.empty? | |
89 | 89 | end |
90 | 90 | |
91 | 91 | should 'not notify target if group is not moderated' do |
... | ... | @@ -167,7 +167,7 @@ class ApproveArticleTest < ActiveSupport::TestCase |
167 | 167 | a = create(ApproveArticle, :article => article, :target => community, :requestor => profile) |
168 | 168 | a.finish |
169 | 169 | |
170 | - assert !community.has_blog? | |
170 | + refute community.has_blog? | |
171 | 171 | assert_nil article.class.last.parent |
172 | 172 | end |
173 | 173 | ... | ... |
test/unit/approve_comment_test.rb
... | ... | @@ -162,7 +162,7 @@ class ApproveCommentTest < ActiveSupport::TestCase |
162 | 162 | |
163 | 163 | should 'accept_disabled be false if there is an article associated to task' do |
164 | 164 | a = ApproveComment.new(:comment_attributes => @comment.attributes.to_json) |
165 | - assert !a.accept_disabled? | |
165 | + refute a.accept_disabled? | |
166 | 166 | end |
167 | 167 | |
168 | 168 | should 'have target notification description' do | ... | ... |
test/unit/article_test.rb
... | ... | @@ -18,7 +18,7 @@ class ArticleTest < ActiveSupport::TestCase |
18 | 18 | |
19 | 19 | a.profile = profile |
20 | 20 | a.valid? |
21 | - assert !a.errors[:profile_id.to_s].present? | |
21 | + refute a.errors[:profile_id.to_s].present? | |
22 | 22 | end |
23 | 23 | |
24 | 24 | should 'require value for name' do |
... | ... | @@ -28,7 +28,7 @@ class ArticleTest < ActiveSupport::TestCase |
28 | 28 | |
29 | 29 | a.name = 'my article' |
30 | 30 | a.valid? |
31 | - assert !a.errors[:name.to_s].present? | |
31 | + refute a.errors[:name.to_s].present? | |
32 | 32 | end |
33 | 33 | |
34 | 34 | should 'limit length of names' do |
... | ... | @@ -38,7 +38,7 @@ class ArticleTest < ActiveSupport::TestCase |
38 | 38 | |
39 | 39 | a.name = 'a'*150 |
40 | 40 | a.valid? |
41 | - assert !a.errors[:name.to_s].present? | |
41 | + refute a.errors[:name.to_s].present? | |
42 | 42 | end |
43 | 43 | |
44 | 44 | should 'require value for slug and path if name is filled' do |
... | ... | @@ -53,8 +53,8 @@ class ArticleTest < ActiveSupport::TestCase |
53 | 53 | should 'not require value for slug and path if name is blank' do |
54 | 54 | a = Article.new |
55 | 55 | a.valid? |
56 | - assert !a.errors[:slug.to_s].present? | |
57 | - assert !a.errors[:path.to_s].present? | |
56 | + refute a.errors[:slug.to_s].present? | |
57 | + refute a.errors[:path.to_s].present? | |
58 | 58 | end |
59 | 59 | |
60 | 60 | should 'act as versioned' do |
... | ... | @@ -145,7 +145,7 @@ class ArticleTest < ActiveSupport::TestCase |
145 | 145 | a3 = profile.articles.build(:name => 'test') |
146 | 146 | a3.parent = a1 |
147 | 147 | a3.valid? |
148 | - assert !a3.errors[:slug.to_s].present? | |
148 | + refute a3.errors[:slug.to_s].present? | |
149 | 149 | a3.save! |
150 | 150 | |
151 | 151 | # cannot add another child of a1 with same slug |
... | ... | @@ -352,11 +352,11 @@ class ArticleTest < ActiveSupport::TestCase |
352 | 352 | end |
353 | 353 | |
354 | 354 | should 'identify itself as a non-folder' do |
355 | - assert !Article.new.folder?, 'should identify itself as non-folder' | |
355 | + refute Article.new.folder?, 'should identify itself as non-folder' | |
356 | 356 | end |
357 | 357 | |
358 | 358 | should 'identify itself as a non-blog' do |
359 | - assert !Article.new.blog?, 'should identify itself as non-blog' | |
359 | + refute Article.new.blog?, 'should identify itself as non-blog' | |
360 | 360 | end |
361 | 361 | |
362 | 362 | should 'always display if public content' do |
... | ... | @@ -425,7 +425,7 @@ class ArticleTest < ActiveSupport::TestCase |
425 | 425 | |
426 | 426 | assert_equivalent [c2, c3], art.categories(true) |
427 | 427 | assert_includes art.categories_including_virtual(true), c1 |
428 | - assert !art.categories_including_virtual(true).include?(c4) | |
428 | + refute art.categories_including_virtual(true).include?(c4) | |
429 | 429 | end |
430 | 430 | |
431 | 431 | should 'be able to create an article already with categories' do |
... | ... | @@ -459,7 +459,7 @@ class ArticleTest < ActiveSupport::TestCase |
459 | 459 | end |
460 | 460 | |
461 | 461 | should 'not accept Product category as category' do |
462 | - assert !Article.new.accept_category?(ProductCategory.new) | |
462 | + refute Article.new.accept_category?(ProductCategory.new) | |
463 | 463 | end |
464 | 464 | |
465 | 465 | should 'accept published attribute' do |
... | ... | @@ -471,7 +471,7 @@ class ArticleTest < ActiveSupport::TestCase |
471 | 471 | profile = fast_create(Profile, :name => 'test profile', :identifier => 'test_profile') |
472 | 472 | article = fast_create(Article, :name => 'test article', :profile_id => profile.id, :published => false) |
473 | 473 | |
474 | - assert !article.display_to?(nil) | |
474 | + refute article.display_to?(nil) | |
475 | 475 | end |
476 | 476 | |
477 | 477 | should 'say that not member of profile cannot see private article' do |
... | ... | @@ -479,7 +479,7 @@ class ArticleTest < ActiveSupport::TestCase |
479 | 479 | article = fast_create(Article, :name => 'test article', :profile_id => profile.id, :published => false) |
480 | 480 | person = create_user('test_user').person |
481 | 481 | |
482 | - assert !article.display_to?(person) | |
482 | + refute article.display_to?(person) | |
483 | 483 | end |
484 | 484 | |
485 | 485 | should 'say that member user can not see private article' do |
... | ... | @@ -488,7 +488,7 @@ class ArticleTest < ActiveSupport::TestCase |
488 | 488 | person = create_user('test_user').person |
489 | 489 | profile.affiliate(person, Profile::Roles.member(profile.environment.id)) |
490 | 490 | |
491 | - assert !article.display_to?(person) | |
491 | + refute article.display_to?(person) | |
492 | 492 | end |
493 | 493 | |
494 | 494 | should 'say that profile admin can see private article' do |
... | ... | @@ -526,7 +526,7 @@ class ArticleTest < ActiveSupport::TestCase |
526 | 526 | folder = fast_create(Folder, :name => 'my_intranet', :profile_id => profile.id, :published => false) |
527 | 527 | article = fast_create(Article, :name => 'my private article', :profile_id => profile.id, :parent_id => folder.id) |
528 | 528 | |
529 | - assert !article.published? | |
529 | + refute article.published? | |
530 | 530 | end |
531 | 531 | |
532 | 532 | should 'save as private' do |
... | ... | @@ -538,7 +538,7 @@ class ArticleTest < ActiveSupport::TestCase |
538 | 538 | article.save! |
539 | 539 | article.reload |
540 | 540 | |
541 | - assert !article.published? | |
541 | + refute article.published? | |
542 | 542 | end |
543 | 543 | |
544 | 544 | should 'not allow friends of private person see the article' do |
... | ... | @@ -549,7 +549,7 @@ class ArticleTest < ActiveSupport::TestCase |
549 | 549 | person.save! |
550 | 550 | friend.save! |
551 | 551 | |
552 | - assert !article.display_to?(friend) | |
552 | + refute article.display_to?(friend) | |
553 | 553 | end |
554 | 554 | |
555 | 555 | should 'display private articles to people who can view private content' do |
... | ... | @@ -661,7 +661,7 @@ class ArticleTest < ActiveSupport::TestCase |
661 | 661 | p = create_user('user_blog_test').person |
662 | 662 | folder = fast_create(Folder, :name => 'Not Blog', :profile_id => p.id) |
663 | 663 | a = fast_create(TextileArticle, :name => 'Not blog post', :profile_id => p.id, :parent_id => folder.id) |
664 | - assert !a.belongs_to_blog? | |
664 | + refute a.belongs_to_blog? | |
665 | 665 | end |
666 | 666 | |
667 | 667 | should 'has comments notifier true by default' do |
... | ... | @@ -690,7 +690,7 @@ class ArticleTest < ActiveSupport::TestCase |
690 | 690 | should 'moderate_comments? return false if moderate_comments variable is false' do |
691 | 691 | a = Article.new |
692 | 692 | a.moderate_comments= false |
693 | - assert !a.moderate_comments? | |
693 | + refute a.moderate_comments? | |
694 | 694 | end |
695 | 695 | |
696 | 696 | should 'hold hits count' do |
... | ... | @@ -761,7 +761,7 @@ class ArticleTest < ActiveSupport::TestCase |
761 | 761 | |
762 | 762 | should 'not be highlighted by default' do |
763 | 763 | a = Article.new |
764 | - assert !a.highlighted | |
764 | + refute a.highlighted | |
765 | 765 | end |
766 | 766 | |
767 | 767 | should 'get tagged with tag' do |
... | ... | @@ -1009,7 +1009,7 @@ class ArticleTest < ActiveSupport::TestCase |
1009 | 1009 | |
1010 | 1010 | should 'notifiable is false by default' do |
1011 | 1011 | a = fast_create(Article) |
1012 | - assert !a.notifiable? | |
1012 | + refute a.notifiable? | |
1013 | 1013 | end |
1014 | 1014 | |
1015 | 1015 | should 'not notify activity by default on create' do |
... | ... | @@ -1205,11 +1205,11 @@ class ArticleTest < ActiveSupport::TestCase |
1205 | 1205 | end |
1206 | 1206 | |
1207 | 1207 | should 'not be a forum by default' do |
1208 | - assert !fast_create(Article).forum? | |
1208 | + refute fast_create(Article).forum? | |
1209 | 1209 | end |
1210 | 1210 | |
1211 | 1211 | should 'not have posts by default' do |
1212 | - assert !fast_create(Article).has_posts? | |
1212 | + refute fast_create(Article).has_posts? | |
1213 | 1213 | end |
1214 | 1214 | |
1215 | 1215 | should 'get article galleries' do |
... | ... | @@ -1243,21 +1243,21 @@ class ArticleTest < ActiveSupport::TestCase |
1243 | 1243 | assert a.errors[:language.to_s].present? |
1244 | 1244 | a.language = 'en' |
1245 | 1245 | a.valid? |
1246 | - assert !a.errors[:language.to_s].present? | |
1246 | + refute a.errors[:language.to_s].present? | |
1247 | 1247 | end |
1248 | 1248 | |
1249 | 1249 | should 'language can be blank' do |
1250 | 1250 | a = build(Article) |
1251 | 1251 | a.valid? |
1252 | - assert !a.errors[:language.to_s].present? | |
1252 | + refute a.errors[:language.to_s].present? | |
1253 | 1253 | a.language = '' |
1254 | 1254 | a.valid? |
1255 | - assert !a.errors[:language.to_s].present? | |
1255 | + refute a.errors[:language.to_s].present? | |
1256 | 1256 | end |
1257 | 1257 | |
1258 | 1258 | should 'article is not translatable' do |
1259 | 1259 | a = build(Article) |
1260 | - assert !a.translatable? | |
1260 | + refute a.translatable? | |
1261 | 1261 | end |
1262 | 1262 | |
1263 | 1263 | should 'get native translation' do |
... | ... | @@ -1272,7 +1272,7 @@ class ArticleTest < ActiveSupport::TestCase |
1272 | 1272 | native_article = fast_create(Article, :language => 'pt', :profile_id => fast_create(Profile).id ) |
1273 | 1273 | article_translation = fast_create(Article, :language => 'en', :translation_of_id => native_article.id) |
1274 | 1274 | possible_translations = native_article.possible_translations |
1275 | - assert !possible_translations.include?('en') | |
1275 | + refute possible_translations.include?('en') | |
1276 | 1276 | assert possible_translations.include?('pt') |
1277 | 1277 | end |
1278 | 1278 | |
... | ... | @@ -1286,7 +1286,7 @@ class ArticleTest < ActiveSupport::TestCase |
1286 | 1286 | assert a.errors[:language.to_s].present? |
1287 | 1287 | a.language = 'es' |
1288 | 1288 | a.valid? |
1289 | - assert !a.errors[:language.to_s].present? | |
1289 | + refute a.errors[:language.to_s].present? | |
1290 | 1290 | end |
1291 | 1291 | |
1292 | 1292 | should 'verify if native translation is already in use' do |
... | ... | @@ -1298,7 +1298,7 @@ class ArticleTest < ActiveSupport::TestCase |
1298 | 1298 | assert a.errors[:language.to_s].present? |
1299 | 1299 | a.language = 'es' |
1300 | 1300 | a.valid? |
1301 | - assert !a.errors[:language.to_s].present? | |
1301 | + refute a.errors[:language.to_s].present? | |
1302 | 1302 | end |
1303 | 1303 | |
1304 | 1304 | should 'translation have a language' do |
... | ... | @@ -1309,7 +1309,7 @@ class ArticleTest < ActiveSupport::TestCase |
1309 | 1309 | assert a.errors[:language.to_s].present? |
1310 | 1310 | a.language = 'en' |
1311 | 1311 | a.valid? |
1312 | - assert !a.errors[:language.to_s].present? | |
1312 | + refute a.errors[:language.to_s].present? | |
1313 | 1313 | end |
1314 | 1314 | |
1315 | 1315 | should 'native translation have a language' do |
... | ... | @@ -1387,10 +1387,10 @@ class ArticleTest < ActiveSupport::TestCase |
1387 | 1387 | |
1388 | 1388 | should 'not list own language as a possible translation if language has changed' do |
1389 | 1389 | a = build(Article, :language => 'pt', :profile_id => fast_create(Profile).id) |
1390 | - assert !a.possible_translations.include?('pt') | |
1390 | + refute a.possible_translations.include?('pt') | |
1391 | 1391 | a = fast_create(Article, :language => 'pt', :profile_id => fast_create(Profile).id ) |
1392 | 1392 | a.language = 'en' |
1393 | - assert !a.possible_translations.include?('en') | |
1393 | + refute a.possible_translations.include?('en') | |
1394 | 1394 | end |
1395 | 1395 | |
1396 | 1396 | should 'list own language as a possible translation if language has not changed' do |
... | ... | @@ -1430,7 +1430,7 @@ class ArticleTest < ActiveSupport::TestCase |
1430 | 1430 | end |
1431 | 1431 | |
1432 | 1432 | should 'tiny mce editor is disabled by default' do |
1433 | - assert !Article.new.tiny_mce? | |
1433 | + refute Article.new.tiny_mce? | |
1434 | 1434 | end |
1435 | 1435 | |
1436 | 1436 | should 'return only folders' do |
... | ... | @@ -1474,19 +1474,19 @@ class ArticleTest < ActiveSupport::TestCase |
1474 | 1474 | |
1475 | 1475 | should 'not accept uploads if has no parent' do |
1476 | 1476 | child = fast_create(UploadedFile) |
1477 | - assert !child.accept_uploads? | |
1477 | + refute child.accept_uploads? | |
1478 | 1478 | end |
1479 | 1479 | |
1480 | 1480 | should 'not accept uploads if parent is a blog' do |
1481 | 1481 | folder = fast_create(Blog) |
1482 | 1482 | child = fast_create(UploadedFile, :parent_id => folder.id) |
1483 | - assert !child.accept_uploads? | |
1483 | + refute child.accept_uploads? | |
1484 | 1484 | end |
1485 | 1485 | |
1486 | 1486 | should 'not accept uploads if parent is a forum' do |
1487 | 1487 | folder = fast_create(Forum) |
1488 | 1488 | child = fast_create(UploadedFile, :parent_id => folder.id) |
1489 | - assert !child.accept_uploads? | |
1489 | + refute child.accept_uploads? | |
1490 | 1490 | end |
1491 | 1491 | |
1492 | 1492 | should 'get images paths in article body' do |
... | ... | @@ -1684,7 +1684,7 @@ class ArticleTest < ActiveSupport::TestCase |
1684 | 1684 | should 'not crash on allow_edit without a current user' do |
1685 | 1685 | a = build(Article) |
1686 | 1686 | a.allow_members_to_edit = true |
1687 | - assert !a.allow_edit?(nil) | |
1687 | + refute a.allow_edit?(nil) | |
1688 | 1688 | end |
1689 | 1689 | |
1690 | 1690 | should 'allow author to edit topic' do |
... | ... | @@ -1834,13 +1834,13 @@ class ArticleTest < ActiveSupport::TestCase |
1834 | 1834 | p = create_user('user_forum_test').person |
1835 | 1835 | blog = fast_create(Blog, :name => 'Not Forum', :profile_id => p.id) |
1836 | 1836 | a = fast_create(TextileArticle, :name => 'Not forum post', :profile_id => p.id, :parent_id => blog.id) |
1837 | - assert !a.belongs_to_forum? | |
1837 | + refute a.belongs_to_forum? | |
1838 | 1838 | end |
1839 | 1839 | |
1840 | 1840 | should 'not belongs to forum if do not have a parent' do |
1841 | 1841 | p = create_user('user_forum_test').person |
1842 | 1842 | a = fast_create(TextileArticle, :name => 'Orphan post', :profile_id => p.id) |
1843 | - assert !a.belongs_to_forum? | |
1843 | + refute a.belongs_to_forum? | |
1844 | 1844 | end |
1845 | 1845 | |
1846 | 1846 | should 'save image on create article' do |
... | ... | @@ -1998,7 +1998,7 @@ class ArticleTest < ActiveSupport::TestCase |
1998 | 1998 | should 'display_filter do not show person private content to non friends' do |
1999 | 1999 | user = create_user('someuser').person |
2000 | 2000 | p = fast_create(Person) |
2001 | - assert !p.is_a_friend?(user) | |
2001 | + refute p.is_a_friend?(user) | |
2002 | 2002 | user.stubs(:has_permission?).with(:view_private_content, p).returns(false) |
2003 | 2003 | Article.delete_all |
2004 | 2004 | a = fast_create(Article, :published => false, :show_to_followers => true, :profile_id => p.id) |
... | ... | @@ -2010,7 +2010,7 @@ class ArticleTest < ActiveSupport::TestCase |
2010 | 2010 | should 'display_filter do not show community private content to non members' do |
2011 | 2011 | user = create_user('someuser').person |
2012 | 2012 | p = fast_create(Community) |
2013 | - assert !user.is_member_of?(p) | |
2013 | + refute user.is_member_of?(p) | |
2014 | 2014 | user.stubs(:has_permission?).with(:view_private_content, p).returns(false) |
2015 | 2015 | Article.delete_all |
2016 | 2016 | a = fast_create(Article, :published => false, :show_to_followers => true, :profile_id => p.id) |
... | ... | @@ -2022,7 +2022,7 @@ class ArticleTest < ActiveSupport::TestCase |
2022 | 2022 | should 'display_filter show community public content even it has no followers defined' do |
2023 | 2023 | user = create_user('someuser').person |
2024 | 2024 | p = fast_create(Community) |
2025 | - assert !user.is_member_of?(p) | |
2025 | + refute user.is_member_of?(p) | |
2026 | 2026 | user.stubs(:has_permission?).with(:view_private_content, p).returns(false) |
2027 | 2027 | Article.delete_all |
2028 | 2028 | a = fast_create(Article, :published => true, :show_to_followers => true, :profile_id => p.id) |
... | ... | @@ -2034,7 +2034,7 @@ class ArticleTest < ActiveSupport::TestCase |
2034 | 2034 | should 'display_filter show person public content even it has no followers defined' do |
2035 | 2035 | user = create_user('someuser').person |
2036 | 2036 | p = fast_create(Community) |
2037 | - assert !user.is_a_friend?(p) | |
2037 | + refute user.is_a_friend?(p) | |
2038 | 2038 | user.stubs(:has_permission?).with(:view_private_content, p).returns(false) |
2039 | 2039 | Article.delete_all |
2040 | 2040 | a = fast_create(Article, :published => true, :show_to_followers => true, :profile_id => p.id) |
... | ... | @@ -2046,8 +2046,8 @@ class ArticleTest < ActiveSupport::TestCase |
2046 | 2046 | should 'display_filter do not show person private content to non friends passing nil as profile parameter' do |
2047 | 2047 | user = create_user('someuser').person |
2048 | 2048 | p = fast_create(Person) |
2049 | - assert !p.is_a_friend?(user) | |
2050 | - assert !user.is_admin? | |
2049 | + refute p.is_a_friend?(user) | |
2050 | + refute user.is_admin? | |
2051 | 2051 | Article.delete_all |
2052 | 2052 | fast_create(Article, :published => false, :profile_id => p.id) |
2053 | 2053 | assert_equal [], Article.display_filter(user, nil) |
... | ... | @@ -2056,8 +2056,8 @@ class ArticleTest < ActiveSupport::TestCase |
2056 | 2056 | should 'display_filter show person public content to non friends passing nil as profile parameter' do |
2057 | 2057 | user = create_user('someuser').person |
2058 | 2058 | p = fast_create(Person) |
2059 | - assert !p.is_a_friend?(user) | |
2060 | - assert !user.is_admin? | |
2059 | + refute p.is_a_friend?(user) | |
2060 | + refute user.is_admin? | |
2061 | 2061 | Article.delete_all |
2062 | 2062 | a1 = fast_create(Article, :profile_id => p.id) |
2063 | 2063 | a2 = fast_create(Article) |
... | ... | @@ -2067,7 +2067,7 @@ class ArticleTest < ActiveSupport::TestCase |
2067 | 2067 | should 'display_filter do not show community private content to non members passing nil as profile parameter' do |
2068 | 2068 | user = create_user('someuser').person |
2069 | 2069 | p = fast_create(Community) |
2070 | - assert !user.is_member_of?(p) | |
2070 | + refute user.is_member_of?(p) | |
2071 | 2071 | Article.delete_all |
2072 | 2072 | fast_create(Article, :published => false, :profile_id => p.id) |
2073 | 2073 | assert_equal [], Article.display_filter(user, nil) |
... | ... | @@ -2076,7 +2076,7 @@ class ArticleTest < ActiveSupport::TestCase |
2076 | 2076 | should 'display_filter show community public content to non members passing nil as profile parameter' do |
2077 | 2077 | user = create_user('someuser').person |
2078 | 2078 | p = fast_create(Community) |
2079 | - assert !user.is_member_of?(p) | |
2079 | + refute user.is_member_of?(p) | |
2080 | 2080 | Article.delete_all |
2081 | 2081 | a1 = fast_create(Article, :profile_id => p.id) |
2082 | 2082 | a2 = fast_create(Article) |
... | ... | @@ -2099,7 +2099,7 @@ class ArticleTest < ActiveSupport::TestCase |
2099 | 2099 | should 'display_filter not show public content of private community for non members' do |
2100 | 2100 | user = create_user('someuser').person |
2101 | 2101 | p = fast_create(Community, :public_profile => false) |
2102 | - assert !user.is_member_of?(p) | |
2102 | + refute user.is_member_of?(p) | |
2103 | 2103 | user.stubs(:has_permission?).with(:view_private_content, p).returns(false) |
2104 | 2104 | Article.delete_all |
2105 | 2105 | a = fast_create(Article, :published => true, :profile_id => p.id) |
... | ... | @@ -2141,7 +2141,7 @@ class ArticleTest < ActiveSupport::TestCase |
2141 | 2141 | should 'display_filter not show public content of private person for non friends' do |
2142 | 2142 | user = create_user('someuser').person |
2143 | 2143 | p = fast_create(Person, :public_profile => false) |
2144 | - assert !user.is_a_friend?(p) | |
2144 | + refute user.is_a_friend?(p) | |
2145 | 2145 | user.stubs(:has_permission?).with(:view_private_content, p).returns(false) |
2146 | 2146 | Article.delete_all |
2147 | 2147 | a = fast_create(Article, :published => true, :profile_id => p.id) | ... | ... |
test/unit/block_test.rb
... | ... | @@ -238,11 +238,11 @@ class BlockTest < ActiveSupport::TestCase |
238 | 238 | block = MyBlock.new |
239 | 239 | |
240 | 240 | assert block.visible?({:value => 2}) |
241 | - assert !block.visible?({:value => 3}) | |
241 | + refute block.visible?({:value => 3}) | |
242 | 242 | end |
243 | 243 | |
244 | 244 | should 'not be embedable by default' do |
245 | - assert !Block.new.embedable? | |
245 | + refute Block.new.embedable? | |
246 | 246 | end |
247 | 247 | |
248 | 248 | should 'generate embed code' do |
... | ... | @@ -275,13 +275,13 @@ class BlockTest < ActiveSupport::TestCase |
275 | 275 | should 'do not display block to logged users for display_user = not_logged' do |
276 | 276 | block = Block.new |
277 | 277 | block.display_user = 'not_logged' |
278 | - assert !block.display_to_user?(User.new) | |
278 | + refute block.display_to_user?(User.new) | |
279 | 279 | end |
280 | 280 | |
281 | 281 | should 'do not display block to not logged users for display_user = logged' do |
282 | 282 | block = Block.new |
283 | 283 | block.display_user = 'logged' |
284 | - assert !block.display_to_user?(nil) | |
284 | + refute block.display_to_user?(nil) | |
285 | 285 | end |
286 | 286 | |
287 | 287 | should 'display block to not logged users for display_user = not_logged' do |
... | ... | @@ -293,7 +293,7 @@ class BlockTest < ActiveSupport::TestCase |
293 | 293 | should 'not be visible if display_to_user? is false' do |
294 | 294 | block = Block.new |
295 | 295 | block.expects(:display_to_user?).once.returns(false) |
296 | - assert !block.visible?({}) | |
296 | + refute block.visible?({}) | |
297 | 297 | end |
298 | 298 | |
299 | 299 | should 'accept user as parameter on cache_key without change its value' do |
... | ... | @@ -322,7 +322,7 @@ class BlockTest < ActiveSupport::TestCase |
322 | 322 | block = create(Block, :box_id => box.id) |
323 | 323 | block.display_user = 'followers' |
324 | 324 | block.save! |
325 | - assert !block.display_to_user?(user.person) | |
325 | + refute block.display_to_user?(user.person) | |
326 | 326 | end |
327 | 327 | |
328 | 328 | should 'display block to friends of person for display_user = friends' do |
... | ... | @@ -346,7 +346,7 @@ class BlockTest < ActiveSupport::TestCase |
346 | 346 | block = create(Block, :box_id => box.id) |
347 | 347 | block.display_user = 'followers' |
348 | 348 | block.save! |
349 | - assert !block.display_to_user?(person_friend) | |
349 | + refute block.display_to_user?(person_friend) | |
350 | 350 | end |
351 | 351 | |
352 | 352 | should 'get limit as a number when limit is string' do | ... | ... |
test/unit/blog_test.rb
... | ... | @@ -118,7 +118,7 @@ class BlogTest < ActiveSupport::TestCase |
118 | 118 | p = create_user('testuser').person |
119 | 119 | blog = build(Blog, :profile => p, :name => 'Blog test', :external_feed_builder => {:enabled => true}) |
120 | 120 | blog.save |
121 | - assert ! blog.valid? | |
121 | + refute blog.valid? | |
122 | 122 | end |
123 | 123 | |
124 | 124 | should 'remove external feed when removing blog' do |
... | ... | @@ -178,15 +178,15 @@ class BlogTest < ActiveSupport::TestCase |
178 | 178 | |
179 | 179 | blog.visualization_format = 'short' |
180 | 180 | blog.valid? |
181 | - assert !blog.errors[:visualization_format.to_s].present? | |
181 | + refute blog.errors[:visualization_format.to_s].present? | |
182 | 182 | |
183 | 183 | blog.visualization_format = 'full' |
184 | 184 | blog.valid? |
185 | - assert !blog.errors[:visualization_format.to_s].present? | |
185 | + refute blog.errors[:visualization_format.to_s].present? | |
186 | 186 | |
187 | 187 | blog.visualization_format = 'compact' |
188 | 188 | blog.valid? |
189 | - assert !blog.errors[:visualization_format.to_s].present? | |
189 | + refute blog.errors[:visualization_format.to_s].present? | |
190 | 190 | end |
191 | 191 | |
192 | 192 | should 'have posts' do |
... | ... | @@ -195,8 +195,8 @@ class BlogTest < ActiveSupport::TestCase |
195 | 195 | |
196 | 196 | should 'not display posts in current language by default' do |
197 | 197 | blog = Blog.new |
198 | - assert !blog.display_posts_in_current_language | |
199 | - assert !blog.display_posts_in_current_language? | |
198 | + refute blog.display_posts_in_current_language | |
199 | + refute blog.display_posts_in_current_language? | |
200 | 200 | end |
201 | 201 | |
202 | 202 | should 'update display posts in current language setting' do |
... | ... | @@ -205,8 +205,8 @@ class BlogTest < ActiveSupport::TestCase |
205 | 205 | blog = p.blog |
206 | 206 | blog.display_posts_in_current_language = false |
207 | 207 | assert blog.save! && blog.reload |
208 | - assert !blog.reload.display_posts_in_current_language | |
209 | - assert !blog.reload.display_posts_in_current_language? | |
208 | + refute blog.reload.display_posts_in_current_language | |
209 | + refute blog.reload.display_posts_in_current_language? | |
210 | 210 | end |
211 | 211 | |
212 | 212 | #FIXME This should be used until there is a migration to fix all blogs that |
... | ... | @@ -223,7 +223,7 @@ class BlogTest < ActiveSupport::TestCase |
223 | 223 | |
224 | 224 | should 'not accept uploads' do |
225 | 225 | folder = fast_create(Blog) |
226 | - assert !folder.accept_uploads? | |
226 | + refute folder.accept_uploads? | |
227 | 227 | end |
228 | 228 | |
229 | 229 | should 'know when blog has or when has no posts' do |
... | ... | @@ -231,7 +231,7 @@ class BlogTest < ActiveSupport::TestCase |
231 | 231 | blog = Blog.create!(:profile => p, :name => 'Blog test') |
232 | 232 | assert blog.empty? |
233 | 233 | fast_create(TextileArticle, :parent_id => blog.id) |
234 | - assert ! blog.empty? | |
234 | + refute blog.empty? | |
235 | 235 | end |
236 | 236 | |
237 | 237 | should 'set cover image' do | ... | ... |
test/unit/box_test.rb
... | ... | @@ -18,15 +18,15 @@ class BoxTest < ActiveSupport::TestCase |
18 | 18 | should 'list allowed blocks for center box' do |
19 | 19 | blocks = Box.new.tap { |b| b.position = 1 }.acceptable_blocks |
20 | 20 | |
21 | - assert !blocks.include?('.block') | |
22 | - assert !blocks.include?('.disabled-enterprise-message-block') | |
23 | - assert !blocks.include?('.featured-products-block') | |
24 | - assert !blocks.include?('.products-block') | |
25 | - assert !blocks.include?('.profile-info-block') | |
26 | - assert !blocks.include?('.profile-list-block') | |
27 | - assert !blocks.include?('.profile-search-block') | |
28 | - assert !blocks.include?('.slideshow-block') | |
29 | - assert !blocks.include?('.location-block') | |
21 | + refute blocks.include?('.block') | |
22 | + refute blocks.include?('.disabled-enterprise-message-block') | |
23 | + refute blocks.include?('.featured-products-block') | |
24 | + refute blocks.include?('.products-block') | |
25 | + refute blocks.include?('.profile-info-block') | |
26 | + refute blocks.include?('.profile-list-block') | |
27 | + refute blocks.include?('.profile-search-block') | |
28 | + refute blocks.include?('.slideshow-block') | |
29 | + refute blocks.include?('.location-block') | |
30 | 30 | |
31 | 31 | assert blocks.include?('.article-block') |
32 | 32 | assert blocks.include?('.blog-archives-block') |
... | ... | @@ -51,9 +51,9 @@ class BoxTest < ActiveSupport::TestCase |
51 | 51 | should 'list allowed blocks for box at position 2' do |
52 | 52 | blocks = Box.new.tap { |b| b.position = 2 }.acceptable_blocks |
53 | 53 | |
54 | - assert !blocks.include?('.main-block') | |
55 | - assert !blocks.include?('.block') | |
56 | - assert !blocks.include?('.profile-list-block') | |
54 | + refute blocks.include?('.main-block') | |
55 | + refute blocks.include?('.block') | |
56 | + refute blocks.include?('.profile-list-block') | |
57 | 57 | |
58 | 58 | assert blocks.include?('.article-block') |
59 | 59 | assert blocks.include?('.blog-archives-block') |
... | ... | @@ -129,7 +129,7 @@ class BoxTest < ActiveSupport::TestCase |
129 | 129 | assert blocks.include?('box-test_plugin-block') |
130 | 130 | |
131 | 131 | blocks = build(Box, :position => 1, :owner => Community.new).acceptable_blocks |
132 | - assert !blocks.include?('box-test_plugin-block') | |
132 | + refute blocks.include?('box-test_plugin-block') | |
133 | 133 | end |
134 | 134 | |
135 | 135 | should 'list only boxes with a postion greater than zero' do | ... | ... |
test/unit/boxes_helper_test.rb
... | ... | @@ -106,7 +106,7 @@ class BoxesHelperTest < ActionView::TestCase |
106 | 106 | end |
107 | 107 | |
108 | 108 | should 'add invisible CSS class name for invisible blocks' do |
109 | - assert !block_css_classes(build(Block, :display => 'always')).split.any? { |item| item == 'invisible-block'} | |
109 | + refute block_css_classes(build(Block, :display => 'always')).split.any? { |item| item == 'invisible-block'} | |
110 | 110 | assert block_css_classes(build(Block, :display => 'never')).split.any? { |item| item == 'invisible-block'} |
111 | 111 | end |
112 | 112 | ... | ... |
test/unit/category_test.rb
... | ... | @@ -17,7 +17,7 @@ class CategoryTest < ActiveSupport::TestCase |
17 | 17 | def test_mandatory_field_name |
18 | 18 | c = Category.new |
19 | 19 | c.name = 'product category for testing' |
20 | - assert !c.valid? | |
20 | + refute c.valid? | |
21 | 21 | assert c.errors[:environment_id.to_s].present? |
22 | 22 | end |
23 | 23 | |
... | ... | @@ -75,14 +75,14 @@ class CategoryTest < ActiveSupport::TestCase |
75 | 75 | sub_cat = build(Category, :name => 'subcategory_name') |
76 | 76 | sub_cat.stubs(:parent).returns(cat) |
77 | 77 | sub_cat.parent = cat |
78 | - assert !sub_cat.top_level? | |
78 | + refute sub_cat.top_level? | |
79 | 79 | end |
80 | 80 | |
81 | 81 | def test_leaf |
82 | 82 | cat = build(Category, :name => 'category_name') |
83 | 83 | sub_cat = build(Category, :name => 'subcategory_name') |
84 | 84 | cat.stubs(:children).returns([sub_cat]) |
85 | - assert !cat.leaf? | |
85 | + refute cat.leaf? | |
86 | 86 | end |
87 | 87 | |
88 | 88 | def test_not_leaf |
... | ... | @@ -132,7 +132,7 @@ class CategoryTest < ActiveSupport::TestCase |
132 | 132 | c1 = create(Category, :environment_id => @env.id) |
133 | 133 | c2 = build(Category, :slug => c1.slug, :environment_id => @env.id) |
134 | 134 | |
135 | - assert !c2.valid? | |
135 | + refute c2.valid? | |
136 | 136 | assert c2.errors[:slug.to_s].present? |
137 | 137 | end |
138 | 138 | ... | ... |
test/unit/certifier_test.rb
... | ... | @@ -14,7 +14,7 @@ class CertifierTest < ActiveSupport::TestCase |
14 | 14 | |
15 | 15 | should 'environment is mandatory' do |
16 | 16 | certifier = Certifier.new(:name => 'Certifier without environment') |
17 | - assert !certifier.valid? | |
17 | + refute certifier.valid? | |
18 | 18 | |
19 | 19 | certifier.environment = fast_create(Environment) |
20 | 20 | assert certifier.valid? |
... | ... | @@ -34,7 +34,7 @@ class CertifierTest < ActiveSupport::TestCase |
34 | 34 | should 'name is mandatory' do |
35 | 35 | env_one = fast_create(Environment) |
36 | 36 | certifier = env_one.certifiers.new |
37 | - assert !certifier.valid? | |
37 | + refute certifier.valid? | |
38 | 38 | |
39 | 39 | certifier.name = 'Certifier name' |
40 | 40 | assert certifier.valid? | ... | ... |
test/unit/change_password_test.rb
... | ... | @@ -16,7 +16,7 @@ class ChangePasswordTest < ActiveSupport::TestCase |
16 | 16 | change.status = Task::Status::FINISHED |
17 | 17 | change.password = 'right' |
18 | 18 | change.password_confirmation = 'wrong' |
19 | - assert !change.valid? | |
19 | + refute change.valid? | |
20 | 20 | assert change.errors[:password.to_s].present? |
21 | 21 | |
22 | 22 | ... | ... |
test/unit/comment_helper_test.rb
... | ... | @@ -71,7 +71,7 @@ class CommentHelperTest < ActiveSupport::TestCase |
71 | 71 | should 'do not return link for report abuse action when comment has no author' do |
72 | 72 | comment = Comment.new |
73 | 73 | link = link_for_report_abuse(comment) |
74 | - assert !link | |
74 | + refute link | |
75 | 75 | end |
76 | 76 | |
77 | 77 | should 'return link for mark comment as spam' do | ... | ... |