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