Commit c25b36bbf8f3f0a4012a0cccaad20f7b269aca87
1 parent
f6dc326c
Exists in
master
and in
29 other branches
using a better semantic to test false results
ruby-minitest offers "refuse" as a syntatic sugar to "assert not"
Showing
152 changed files
with
746 additions
and
746 deletions
Show diff stats
plugins/breadcrumbs/test/functional/profile_design_controller_test.rb
@@ -37,8 +37,8 @@ class ProfileDesignControllerTest < ActionController::TestCase | @@ -37,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 |
test/unit/comment_test.rb
@@ -328,7 +328,7 @@ class CommentTest < ActiveSupport::TestCase | @@ -328,7 +328,7 @@ class CommentTest < ActiveSupport::TestCase | ||
328 | 328 | ||
329 | should 'be able to reject a comment' do | 329 | should 'be able to reject a comment' do |
330 | c = Comment.new | 330 | c = Comment.new |
331 | - assert !c.rejected? | 331 | + refute c.rejected? |
332 | 332 | ||
333 | c.reject! | 333 | c.reject! |
334 | assert c.rejected? | 334 | assert c.rejected? |
@@ -408,15 +408,15 @@ class CommentTest < ActiveSupport::TestCase | @@ -408,15 +408,15 @@ class CommentTest < ActiveSupport::TestCase | ||
408 | c = Comment.new | 408 | c = Comment.new |
409 | c.spam = true | 409 | c.spam = true |
410 | assert c.spam? | 410 | assert c.spam? |
411 | - assert !c.ham? | 411 | + refute c.ham? |
412 | 412 | ||
413 | c.spam = false | 413 | c.spam = false |
414 | assert c.ham? | 414 | assert c.ham? |
415 | - assert !c.spam? | 415 | + refute c.spam? |
416 | 416 | ||
417 | c.spam = nil | 417 | c.spam = nil |
418 | - assert !c.spam? | ||
419 | - assert !c.ham? | 418 | + refute c.spam? |
419 | + refute c.ham? | ||
420 | end | 420 | end |
421 | 421 | ||
422 | should 'be able to select non-spam comments' do | 422 | should 'be able to select non-spam comments' do |
@@ -547,7 +547,7 @@ class CommentTest < ActiveSupport::TestCase | @@ -547,7 +547,7 @@ class CommentTest < ActiveSupport::TestCase | ||
547 | article = Article.new | 547 | article = Article.new |
548 | comment = build(Comment, :article => article) | 548 | comment = build(Comment, :article => article) |
549 | 549 | ||
550 | - assert !comment.need_moderation? | 550 | + refute comment.need_moderation? |
551 | end | 551 | end |
552 | 552 | ||
553 | should 'not need moderation if the comment author is the article author' do | 553 | should 'not need moderation if the comment author is the article author' do |
@@ -560,7 +560,7 @@ class CommentTest < ActiveSupport::TestCase | @@ -560,7 +560,7 @@ class CommentTest < ActiveSupport::TestCase | ||
560 | comment = build(Comment, :article => article) | 560 | comment = build(Comment, :article => article) |
561 | comment.stubs(:author).returns(author) | 561 | comment.stubs(:author).returns(author) |
562 | 562 | ||
563 | - assert !comment.need_moderation? | 563 | + refute comment.need_moderation? |
564 | end | 564 | end |
565 | 565 | ||
566 | should 'need moderation if article is moderated and the comment has no author' do | 566 | should 'need moderation if article is moderated and the comment has no author' do |
@@ -589,7 +589,7 @@ class CommentTest < ActiveSupport::TestCase | @@ -589,7 +589,7 @@ class CommentTest < ActiveSupport::TestCase | ||
589 | should 'not be able to destroy comment without user' do | 589 | should 'not be able to destroy comment without user' do |
590 | comment = Comment.new | 590 | comment = Comment.new |
591 | 591 | ||
592 | - assert !comment.can_be_destroyed_by?(nil) | 592 | + refute comment.can_be_destroyed_by?(nil) |
593 | end | 593 | end |
594 | 594 | ||
595 | should 'not be able to destroy comment' do | 595 | should 'not be able to destroy comment' do |
@@ -599,7 +599,7 @@ class CommentTest < ActiveSupport::TestCase | @@ -599,7 +599,7 @@ class CommentTest < ActiveSupport::TestCase | ||
599 | comment = build(Comment, :article => article) | 599 | comment = build(Comment, :article => article) |
600 | user.expects(:has_permission?).with(:moderate_comments, profile).returns(false) | 600 | user.expects(:has_permission?).with(:moderate_comments, profile).returns(false) |
601 | 601 | ||
602 | - assert !comment.can_be_destroyed_by?(user) | 602 | + refute comment.can_be_destroyed_by?(user) |
603 | end | 603 | end |
604 | 604 | ||
605 | should 'be able to destroy comment if is the author' do | 605 | should 'be able to destroy comment if is the author' do |
@@ -631,7 +631,7 @@ class CommentTest < ActiveSupport::TestCase | @@ -631,7 +631,7 @@ class CommentTest < ActiveSupport::TestCase | ||
631 | should 'not be able to mark comment as spam without user' do | 631 | should 'not be able to mark comment as spam without user' do |
632 | comment = Comment.new | 632 | comment = Comment.new |
633 | 633 | ||
634 | - assert !comment.can_be_marked_as_spam_by?(nil) | 634 | + refute comment.can_be_marked_as_spam_by?(nil) |
635 | end | 635 | end |
636 | 636 | ||
637 | should 'not be able to mark comment as spam' do | 637 | should 'not be able to mark comment as spam' do |
@@ -641,7 +641,7 @@ class CommentTest < ActiveSupport::TestCase | @@ -641,7 +641,7 @@ class CommentTest < ActiveSupport::TestCase | ||
641 | comment = build(Comment, :article => article) | 641 | comment = build(Comment, :article => article) |
642 | user.expects(:has_permission?).with(:moderate_comments, profile).returns(false) | 642 | user.expects(:has_permission?).with(:moderate_comments, profile).returns(false) |
643 | 643 | ||
644 | - assert !comment.can_be_marked_as_spam_by?(user) | 644 | + refute comment.can_be_marked_as_spam_by?(user) |
645 | end | 645 | end |
646 | 646 | ||
647 | should 'be able to mark comment as spam if is the profile' do | 647 | should 'be able to mark comment as spam if is the profile' do |
@@ -666,14 +666,14 @@ class CommentTest < ActiveSupport::TestCase | @@ -666,14 +666,14 @@ class CommentTest < ActiveSupport::TestCase | ||
666 | should 'not be able to update comment without user' do | 666 | should 'not be able to update comment without user' do |
667 | comment = Comment.new | 667 | comment = Comment.new |
668 | 668 | ||
669 | - assert !comment.can_be_updated_by?(nil) | 669 | + refute comment.can_be_updated_by?(nil) |
670 | end | 670 | end |
671 | 671 | ||
672 | should 'not be able to update comment' do | 672 | should 'not be able to update comment' do |
673 | user = Person.new | 673 | user = Person.new |
674 | comment = Comment.new | 674 | comment = Comment.new |
675 | 675 | ||
676 | - assert !comment.can_be_updated_by?(user) | 676 | + refute comment.can_be_updated_by?(user) |
677 | end | 677 | end |
678 | 678 | ||
679 | should 'be able to update comment if is the author' do | 679 | should 'be able to update comment if is the author' do |
@@ -714,10 +714,10 @@ class CommentTest < ActiveSupport::TestCase | @@ -714,10 +714,10 @@ class CommentTest < ActiveSupport::TestCase | ||
714 | should 'like a comment' do | 714 | should 'like a comment' do |
715 | comment = create_comment | 715 | comment = create_comment |
716 | person = create_user('voter').person | 716 | person = create_user('voter').person |
717 | - assert !comment.voted_by?(person, true) | 717 | + refute comment.voted_by?(person, true) |
718 | person.vote_for(comment) | 718 | person.vote_for(comment) |
719 | assert comment.voted_by?(person, true) | 719 | assert comment.voted_by?(person, true) |
720 | - assert !comment.voted_by?(person, false) | 720 | + refute comment.voted_by?(person, false) |
721 | end | 721 | end |
722 | 722 | ||
723 | should 'count voters for' do | 723 | should 'count voters for' do |
test/unit/community_test.rb
@@ -28,9 +28,9 @@ class CommunityTest < ActiveSupport::TestCase | @@ -28,9 +28,9 @@ class CommunityTest < ActiveSupport::TestCase | ||
28 | should 'create default set of blocks' do | 28 | should 'create default set of blocks' do |
29 | c = create(Community, :environment => Environment.default, :name => 'my new community') | 29 | c = create(Community, :environment => Environment.default, :name => 'my new community') |
30 | 30 | ||
31 | - assert !c.boxes[0].blocks.empty?, 'person must have blocks in area 1' | ||
32 | - assert !c.boxes[1].blocks.empty?, 'person must have blocks in area 2' | ||
33 | - assert !c.boxes[2].blocks.empty?, 'person must have blocks in area 3' | 31 | + refute c.boxes[0].blocks.empty?, 'person must have blocks in area 1' |
32 | + refute c.boxes[1].blocks.empty?, 'person must have blocks in area 2' | ||
33 | + refute c.boxes[2].blocks.empty?, 'person must have blocks in area 3' | ||
34 | end | 34 | end |
35 | 35 | ||
36 | should 'create a default set of articles' do | 36 | should 'create a default set of articles' do |
@@ -82,7 +82,7 @@ class CommunityTest < ActiveSupport::TestCase | @@ -82,7 +82,7 @@ class CommunityTest < ActiveSupport::TestCase | ||
82 | 82 | ||
83 | c.destroy | 83 | c.destroy |
84 | relationships.each do |i| | 84 | relationships.each do |i| |
85 | - assert !RoleAssignment.exists?(i.id) | 85 | + refute RoleAssignment.exists?(i.id) |
86 | end | 86 | end |
87 | end | 87 | end |
88 | 88 | ||
@@ -118,24 +118,24 @@ class CommunityTest < ActiveSupport::TestCase | @@ -118,24 +118,24 @@ class CommunityTest < ActiveSupport::TestCase | ||
118 | e = Environment.default | 118 | e = Environment.default |
119 | e.expects(:required_community_fields).returns(['contact_phone']).at_least_once | 119 | e.expects(:required_community_fields).returns(['contact_phone']).at_least_once |
120 | community = build(Community, :name => 'My community', :environment => e) | 120 | community = build(Community, :name => 'My community', :environment => e) |
121 | - assert ! community.valid? | 121 | + refute community.valid? |
122 | assert community.errors[:contact_phone.to_s].present? | 122 | assert community.errors[:contact_phone.to_s].present? |
123 | 123 | ||
124 | community.contact_phone = '99999' | 124 | community.contact_phone = '99999' |
125 | community.valid? | 125 | community.valid? |
126 | - assert ! community.errors[:contact_phone.to_s].present? | 126 | + refute community.errors[:contact_phone.to_s].present? |
127 | end | 127 | end |
128 | 128 | ||
129 | should 'not require fields if community is a template' do | 129 | should 'not require fields if community is a template' do |
130 | e = Environment.default | 130 | e = Environment.default |
131 | e.expects(:required_community_fields).returns(['contact_phone']).at_least_once | 131 | e.expects(:required_community_fields).returns(['contact_phone']).at_least_once |
132 | community = build(Community, :name => 'My community', :environment => e) | 132 | community = build(Community, :name => 'My community', :environment => e) |
133 | - assert ! community.valid? | 133 | + refute community.valid? |
134 | assert community.errors[:contact_phone.to_s].present? | 134 | assert community.errors[:contact_phone.to_s].present? |
135 | 135 | ||
136 | community.is_template = true | 136 | community.is_template = true |
137 | community.valid? | 137 | community.valid? |
138 | - assert ! community.errors[:contact_phone.to_s].present? | 138 | + refute community.errors[:contact_phone.to_s].present? |
139 | end | 139 | end |
140 | 140 | ||
141 | should 'return newest text articles as news' do | 141 | should 'return newest text articles as news' do |
@@ -262,11 +262,11 @@ class CommunityTest < ActiveSupport::TestCase | @@ -262,11 +262,11 @@ class CommunityTest < ActiveSupport::TestCase | ||
262 | p2 = fast_create(Person) | 262 | p2 = fast_create(Person) |
263 | p3 = fast_create(Person) | 263 | p3 = fast_create(Person) |
264 | 264 | ||
265 | - assert !p1.is_member_of?(c) | 265 | + refute p1.is_member_of?(c) |
266 | c.add_member(p1) | 266 | c.add_member(p1) |
267 | assert p1.is_member_of?(c) | 267 | assert p1.is_member_of?(c) |
268 | 268 | ||
269 | - assert !p3.is_member_of?(c) | 269 | + refute p3.is_member_of?(c) |
270 | c.add_member(p3) | 270 | c.add_member(p3) |
271 | assert p3.is_member_of?(c) | 271 | assert p3.is_member_of?(c) |
272 | 272 | ||
@@ -288,7 +288,7 @@ class CommunityTest < ActiveSupport::TestCase | @@ -288,7 +288,7 @@ class CommunityTest < ActiveSupport::TestCase | ||
288 | process_delayed_job_queue | 288 | process_delayed_job_queue |
289 | community.add_member(p3) | 289 | community.add_member(p3) |
290 | assert p1.is_member_of?(community) | 290 | assert p1.is_member_of?(community) |
291 | - assert !p2.is_member_of?(community) | 291 | + refute p2.is_member_of?(community) |
292 | assert p3.is_member_of?(community) | 292 | assert p3.is_member_of?(community) |
293 | process_delayed_job_queue | 293 | process_delayed_job_queue |
294 | end | 294 | end |
@@ -409,14 +409,14 @@ class CommunityTest < ActiveSupport::TestCase | @@ -409,14 +409,14 @@ class CommunityTest < ActiveSupport::TestCase | ||
409 | 409 | ||
410 | member = create_user('memberuser').person | 410 | member = create_user('memberuser').person |
411 | c.add_member(member) | 411 | c.add_member(member) |
412 | - assert !c.is_admin?(member) | 412 | + refute c.is_admin?(member) |
413 | end | 413 | end |
414 | 414 | ||
415 | should 'a moderator user not be a community admin' do | 415 | should 'a moderator user not be a community admin' do |
416 | c = fast_create(Community, :name => 'my test profile', :identifier => 'mytestprofile') | 416 | c = fast_create(Community, :name => 'my test profile', :identifier => 'mytestprofile') |
417 | moderator = create_user('moderatoruser').person | 417 | moderator = create_user('moderatoruser').person |
418 | c.add_moderator(moderator) | 418 | c.add_moderator(moderator) |
419 | - assert !c.is_admin?(moderator) | 419 | + refute c.is_admin?(moderator) |
420 | end | 420 | end |
421 | 421 | ||
422 | end | 422 | end |
test/unit/contact_test.rb
@@ -4,16 +4,16 @@ class ContactTest < ActiveSupport::TestCase | @@ -4,16 +4,16 @@ class ContactTest < ActiveSupport::TestCase | ||
4 | 4 | ||
5 | should 'validates required fields' do | 5 | should 'validates required fields' do |
6 | contact = Contact.new | 6 | contact = Contact.new |
7 | - assert !contact.valid? | 7 | + refute contact.valid? |
8 | 8 | ||
9 | contact.subject = 'Hi' | 9 | contact.subject = 'Hi' |
10 | - assert !contact.valid? | 10 | + refute contact.valid? |
11 | 11 | ||
12 | contact.name = 'john' | 12 | contact.name = 'john' |
13 | - assert !contact.valid? | 13 | + refute contact.valid? |
14 | 14 | ||
15 | contact.email = 'visitor@invalid.com' | 15 | contact.email = 'visitor@invalid.com' |
16 | - assert !contact.valid? | 16 | + refute contact.valid? |
17 | 17 | ||
18 | contact.message = 'Hi, all' | 18 | contact.message = 'Hi, all' |
19 | assert contact.valid? | 19 | assert contact.valid? |
@@ -40,8 +40,8 @@ class ContactTest < ActiveSupport::TestCase | @@ -40,8 +40,8 @@ class ContactTest < ActiveSupport::TestCase | ||
40 | should 'not deliver message if contact is invalid' do | 40 | should 'not deliver message if contact is invalid' do |
41 | ent = fast_create(Enterprise, :name => 'my enterprise', :identifier => 'myent') | 41 | ent = fast_create(Enterprise, :name => 'my enterprise', :identifier => 'myent') |
42 | c = Contact.new(:name => 'john', :subject => 'hi', :message => 'hi, all', :dest => ent) | 42 | c = Contact.new(:name => 'john', :subject => 'hi', :message => 'hi, all', :dest => ent) |
43 | - assert !c.valid? | ||
44 | - assert !c.deliver | 43 | + refute c.valid? |
44 | + refute c.deliver | ||
45 | end | 45 | end |
46 | 46 | ||
47 | should 'use sender name and environment noreply_email on from' do | 47 | should 'use sender name and environment noreply_email on from' do |
test/unit/create_community_test.rb
@@ -23,7 +23,7 @@ class CreateCommunityTest < ActiveSupport::TestCase | @@ -23,7 +23,7 @@ class CreateCommunityTest < ActiveSupport::TestCase | ||
23 | assert task.errors[:requestor_id.to_s].present? | 23 | assert task.errors[:requestor_id.to_s].present? |
24 | task.requestor = person | 24 | task.requestor = person |
25 | task.valid? | 25 | task.valid? |
26 | - assert !task.errors[:requestor_id.to_s].present? | 26 | + refute task.errors[:requestor_id.to_s].present? |
27 | end | 27 | end |
28 | 28 | ||
29 | should 'actually create a community when finishing the task and associate the task requestor as its admin' do | 29 | should 'actually create a community when finishing the task and associate the task requestor as its admin' do |
test/unit/create_enterprise_test.rb
@@ -26,7 +26,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase | @@ -26,7 +26,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase | ||
26 | 26 | ||
27 | task.foundation_year = 2006 | 27 | task.foundation_year = 2006 |
28 | task.valid? | 28 | task.valid? |
29 | - assert !task.errors[:foundation_year.to_s].present? | 29 | + refute task.errors[:foundation_year.to_s].present? |
30 | end | 30 | end |
31 | 31 | ||
32 | should 'require a requestor' do | 32 | should 'require a requestor' do |
@@ -37,7 +37,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase | @@ -37,7 +37,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase | ||
37 | assert task.errors[:requestor_id.to_s].present? | 37 | assert task.errors[:requestor_id.to_s].present? |
38 | task.requestor = create_user('testuser').person | 38 | task.requestor = create_user('testuser').person |
39 | task.valid? | 39 | task.valid? |
40 | - assert !task.errors[:requestor_id.to_s].present? | 40 | + refute task.errors[:requestor_id.to_s].present? |
41 | end | 41 | end |
42 | 42 | ||
43 | should 'require a target (validator organization)' do | 43 | should 'require a target (validator organization)' do |
@@ -49,7 +49,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase | @@ -49,7 +49,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase | ||
49 | task.target = Organization.create!(:name => "My organization", :identifier => 'validator_organization') | 49 | task.target = Organization.create!(:name => "My organization", :identifier => 'validator_organization') |
50 | 50 | ||
51 | task.valid? | 51 | task.valid? |
52 | - assert !task.errors[:target_id.to_s].present? | 52 | + refute task.errors[:target_id.to_s].present? |
53 | end | 53 | end |
54 | 54 | ||
55 | should 'require that the informed target (validator organization) actually validates for the chosen region' do | 55 | should 'require that the informed target (validator organization) actually validates for the chosen region' do |
@@ -69,7 +69,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase | @@ -69,7 +69,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase | ||
69 | region.validators << validator | 69 | region.validators << validator |
70 | 70 | ||
71 | task.valid? | 71 | task.valid? |
72 | - assert !task.errors[:target.to_s].present? | 72 | + refute task.errors[:target.to_s].present? |
73 | end | 73 | end |
74 | 74 | ||
75 | should 'cancel task when rejected ' do | 75 | should 'cancel task when rejected ' do |
@@ -84,7 +84,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase | @@ -84,7 +84,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase | ||
84 | task.reject_explanation = nil | 84 | task.reject_explanation = nil |
85 | 85 | ||
86 | task.valid? | 86 | task.valid? |
87 | - assert !task.errors[:reject_explanation.to_s].present? | 87 | + refute task.errors[:reject_explanation.to_s].present? |
88 | 88 | ||
89 | task.status = Task::Status::CANCELLED | 89 | task.status = Task::Status::CANCELLED |
90 | task.valid? | 90 | task.valid? |
@@ -92,7 +92,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase | @@ -92,7 +92,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase | ||
92 | 92 | ||
93 | task.reject_explanation = 'bla bla bla' | 93 | task.reject_explanation = 'bla bla bla' |
94 | task.valid? | 94 | task.valid? |
95 | - assert !task.errors[:reject_explanation.to_s].present? | 95 | + refute task.errors[:reject_explanation.to_s].present? |
96 | end | 96 | end |
97 | 97 | ||
98 | should 'finish task when approved' do | 98 | should 'finish task when approved' do |
@@ -130,7 +130,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase | @@ -130,7 +130,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase | ||
130 | 130 | ||
131 | task.finish | 131 | task.finish |
132 | 132 | ||
133 | - assert !enterprise.new_record? | 133 | + refute enterprise.new_record? |
134 | assert_equal person.user, enterprise.user | 134 | assert_equal person.user, enterprise.user |
135 | assert_equal environment, enterprise.environment | 135 | assert_equal environment, enterprise.environment |
136 | 136 | ||
@@ -167,7 +167,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase | @@ -167,7 +167,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase | ||
167 | 167 | ||
168 | task.finish | 168 | task.finish |
169 | 169 | ||
170 | - assert !enterprise.new_record? | 170 | + refute enterprise.new_record? |
171 | assert_equal person.user, enterprise.user | 171 | assert_equal person.user, enterprise.user |
172 | assert_equal environment, enterprise.environment | 172 | assert_equal environment, enterprise.environment |
173 | 173 | ||
@@ -203,7 +203,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase | @@ -203,7 +203,7 @@ class CreateEnterpriseTest < ActiveSupport::TestCase | ||
203 | :requestor_id => person.id, | 203 | :requestor_id => person.id, |
204 | }) | 204 | }) |
205 | 205 | ||
206 | - assert !task.valid? && task.valid_before_selecting_target? | 206 | + refute task.valid? && task.valid_before_selecting_target? |
207 | 207 | ||
208 | task.target = validator | 208 | task.target = validator |
209 | assert task.valid? | 209 | assert task.valid? |
test/unit/disabled_enterprise_message_block_test.rb
@@ -19,7 +19,7 @@ class DisabledEnterpriseMessageBlockTest < ActiveSupport::TestCase | @@ -19,7 +19,7 @@ class DisabledEnterpriseMessageBlockTest < ActiveSupport::TestCase | ||
19 | end | 19 | end |
20 | 20 | ||
21 | should 'not be editable' do | 21 | should 'not be editable' do |
22 | - assert !DisabledEnterpriseMessageBlock.new.editable? | 22 | + refute DisabledEnterpriseMessageBlock.new.editable? |
23 | end | 23 | end |
24 | 24 | ||
25 | end | 25 | end |
test/unit/domain_test.rb
@@ -22,7 +22,7 @@ class DomainTest < ActiveSupport::TestCase | @@ -22,7 +22,7 @@ class DomainTest < ActiveSupport::TestCase | ||
22 | should 'allow domains with dot' do | 22 | should 'allow domains with dot' do |
23 | domain = build(Domain, :name => 'test.org') | 23 | domain = build(Domain, :name => 'test.org') |
24 | domain.valid? | 24 | domain.valid? |
25 | - assert !domain.errors[:name.to_s].present? | 25 | + refute domain.errors[:name.to_s].present? |
26 | end | 26 | end |
27 | 27 | ||
28 | should 'not allow domains with upper cased letters' do | 28 | should 'not allow domains with upper cased letters' do |
@@ -34,13 +34,13 @@ class DomainTest < ActiveSupport::TestCase | @@ -34,13 +34,13 @@ class DomainTest < ActiveSupport::TestCase | ||
34 | should 'allow domains with hyphen' do | 34 | should 'allow domains with hyphen' do |
35 | domain = build(Domain, :name => 'test-domain.org') | 35 | domain = build(Domain, :name => 'test-domain.org') |
36 | domain.valid? | 36 | domain.valid? |
37 | - assert !domain.errors[:name.to_s].present? | 37 | + refute domain.errors[:name.to_s].present? |
38 | end | 38 | end |
39 | 39 | ||
40 | should 'allow domains with underscore' do | 40 | should 'allow domains with underscore' do |
41 | domain = build(Domain, :name => 'test_domain.org') | 41 | domain = build(Domain, :name => 'test_domain.org') |
42 | domain.valid? | 42 | domain.valid? |
43 | - assert !domain.errors[:name.to_s].present? | 43 | + refute domain.errors[:name.to_s].present? |
44 | end | 44 | end |
45 | 45 | ||
46 | def test_owner | 46 | def test_owner |
@@ -63,7 +63,7 @@ class DomainTest < ActiveSupport::TestCase | @@ -63,7 +63,7 @@ class DomainTest < ActiveSupport::TestCase | ||
63 | 63 | ||
64 | d.name = 'example.net' | 64 | d.name = 'example.net' |
65 | d.valid? | 65 | d.valid? |
66 | - assert !d.errors[:name.to_s].present? | 66 | + refute d.errors[:name.to_s].present? |
67 | end | 67 | end |
68 | 68 | ||
69 | def test_find_by_name | 69 | def test_find_by_name |
@@ -71,8 +71,8 @@ class DomainTest < ActiveSupport::TestCase | @@ -71,8 +71,8 @@ class DomainTest < ActiveSupport::TestCase | ||
71 | fast_create(Domain, :name => 'example.net') | 71 | fast_create(Domain, :name => 'example.net') |
72 | d1 = Domain.find_by_name('example.net') | 72 | d1 = Domain.find_by_name('example.net') |
73 | d2 = Domain.find_by_name('www.example.net') | 73 | d2 = Domain.find_by_name('www.example.net') |
74 | - assert !d1.nil? | ||
75 | - assert !d2.nil? | 74 | + refute d1.nil? |
75 | + refute d2.nil? | ||
76 | assert d1 == d2 | 76 | assert d1 == d2 |
77 | end | 77 | end |
78 | 78 | ||
@@ -81,7 +81,7 @@ class DomainTest < ActiveSupport::TestCase | @@ -81,7 +81,7 @@ class DomainTest < ActiveSupport::TestCase | ||
81 | assert create(Domain, :name => 'example.net') | 81 | assert create(Domain, :name => 'example.net') |
82 | 82 | ||
83 | d = build(Domain, :name => 'example.net') | 83 | d = build(Domain, :name => 'example.net') |
84 | - assert !d.valid? | 84 | + refute d.valid? |
85 | assert d.errors[:name.to_s].present? | 85 | assert d.errors[:name.to_s].present? |
86 | end | 86 | end |
87 | 87 |
test/unit/email_activation_test.rb
@@ -24,7 +24,7 @@ class EmailActivationTest < ActiveSupport::TestCase | @@ -24,7 +24,7 @@ class EmailActivationTest < ActiveSupport::TestCase | ||
24 | 24 | ||
25 | should 'enable user email when finish' do | 25 | should 'enable user email when finish' do |
26 | ze = create_user('zezinho', :environment_id => Environment.default.id) | 26 | ze = create_user('zezinho', :environment_id => Environment.default.id) |
27 | - assert !ze.enable_email | 27 | + refute ze.enable_email |
28 | task = fast_create(EmailActivation, :requestor_id => ze.person.id, :target_id => Environment.default.id) | 28 | task = fast_create(EmailActivation, :requestor_id => ze.person.id, :target_id => Environment.default.id) |
29 | task.finish | 29 | task.finish |
30 | ze.reload | 30 | ze.reload |
@@ -33,7 +33,7 @@ class EmailActivationTest < ActiveSupport::TestCase | @@ -33,7 +33,7 @@ class EmailActivationTest < ActiveSupport::TestCase | ||
33 | 33 | ||
34 | should 'deliver email after enabling mailbox' do | 34 | should 'deliver email after enabling mailbox' do |
35 | ze = create_user('zezinho', :environment_id => Environment.default.id, :email => 'ze@example.com') | 35 | ze = create_user('zezinho', :environment_id => Environment.default.id, :email => 'ze@example.com') |
36 | - assert !ze.enable_email | 36 | + refute ze.enable_email |
37 | task = EmailActivation.create!(:requestor => ze.person, :target => Environment.default) | 37 | task = EmailActivation.create!(:requestor => ze.person, :target => Environment.default) |
38 | task.finish | 38 | task.finish |
39 | 39 | ||
@@ -46,7 +46,7 @@ class EmailActivationTest < ActiveSupport::TestCase | @@ -46,7 +46,7 @@ class EmailActivationTest < ActiveSupport::TestCase | ||
46 | assert task.save! | 46 | assert task.save! |
47 | 47 | ||
48 | another_task = EmailActivation.new(:requestor => ze.person, :target => Environment.default) | 48 | another_task = EmailActivation.new(:requestor => ze.person, :target => Environment.default) |
49 | - assert !another_task.save, "Should not be able to save another task" | 49 | + refute another_task.save, "Should not be able to save another task" |
50 | end | 50 | end |
51 | 51 | ||
52 | should 'deliver activation email notification' do | 52 | should 'deliver activation email notification' do |
test/unit/enterprise_activation_test.rb
@@ -26,7 +26,7 @@ class EnterpriseActivationTest < ActiveSupport::TestCase | @@ -26,7 +26,7 @@ class EnterpriseActivationTest < ActiveSupport::TestCase | ||
26 | ent = Enterprise.create!(:name => 'my enterprise', :identifier => 'myent') | 26 | ent = Enterprise.create!(:name => 'my enterprise', :identifier => 'myent') |
27 | t.enterprise = ent | 27 | t.enterprise = ent |
28 | t.valid? | 28 | t.valid? |
29 | - assert !t.errors[:enterprise].any?, "must validate after enterprise is set" | 29 | + refute t.errors[:enterprise].any?, "must validate after enterprise is set" |
30 | end | 30 | end |
31 | 31 | ||
32 | should 'activate enterprise when finished' do | 32 | should 'activate enterprise when finished' do |
test/unit/enterprise_test.rb
@@ -25,15 +25,15 @@ class EnterpriseTest < ActiveSupport::TestCase | @@ -25,15 +25,15 @@ class EnterpriseTest < ActiveSupport::TestCase | ||
25 | 25 | ||
26 | p.identifier = 'rightformat2007' | 26 | p.identifier = 'rightformat2007' |
27 | p.valid? | 27 | p.valid? |
28 | - assert ! p.errors[:identifier.to_s].present? | 28 | + refute p.errors[:identifier.to_s].present? |
29 | 29 | ||
30 | p.identifier = 'rightformat' | 30 | p.identifier = 'rightformat' |
31 | p.valid? | 31 | p.valid? |
32 | - assert ! p.errors[:identifier.to_s].present? | 32 | + refute p.errors[:identifier.to_s].present? |
33 | 33 | ||
34 | p.identifier = 'right_format' | 34 | p.identifier = 'right_format' |
35 | p.valid? | 35 | p.valid? |
36 | - assert ! p.errors[:identifier.to_s].present? | 36 | + refute p.errors[:identifier.to_s].present? |
37 | end | 37 | end |
38 | 38 | ||
39 | def test_has_domains | 39 | def test_has_domains |
@@ -83,9 +83,9 @@ class EnterpriseTest < ActiveSupport::TestCase | @@ -83,9 +83,9 @@ class EnterpriseTest < ActiveSupport::TestCase | ||
83 | should 'create default set of blocks' do | 83 | should 'create default set of blocks' do |
84 | e = create(Enterprise, :name => 'my new community', :identifier => 'mynewcommunity') | 84 | e = create(Enterprise, :name => 'my new community', :identifier => 'mynewcommunity') |
85 | 85 | ||
86 | - assert !e.boxes[0].blocks.empty?, 'enterprise must have blocks in area 1' | ||
87 | - assert !e.boxes[1].blocks.empty?, 'enterprise must have blocks in area 2' | ||
88 | - assert !e.boxes[2].blocks.empty?, 'enterprise must have blocks in area 3' | 86 | + refute e.boxes[0].blocks.empty?, 'enterprise must have blocks in area 1' |
87 | + refute e.boxes[1].blocks.empty?, 'enterprise must have blocks in area 2' | ||
88 | + refute e.boxes[2].blocks.empty?, 'enterprise must have blocks in area 3' | ||
89 | end | 89 | end |
90 | 90 | ||
91 | should 'allow to add new members if has no members' do | 91 | should 'allow to add new members if has no members' do |
@@ -147,7 +147,7 @@ class EnterpriseTest < ActiveSupport::TestCase | @@ -147,7 +147,7 @@ class EnterpriseTest < ActiveSupport::TestCase | ||
147 | ent.data[:blocked] = true | 147 | ent.data[:blocked] = true |
148 | ent.save | 148 | ent.save |
149 | ent.unblock | 149 | ent.unblock |
150 | - assert !Enterprise.find(ent.id).blocked? | 150 | + refute Enterprise.find(ent.id).blocked? |
151 | end | 151 | end |
152 | 152 | ||
153 | should 'enable and make user admin' do | 153 | should 'enable and make user admin' do |
@@ -302,29 +302,29 @@ class EnterpriseTest < ActiveSupport::TestCase | @@ -302,29 +302,29 @@ class EnterpriseTest < ActiveSupport::TestCase | ||
302 | e = Environment.default | 302 | e = Environment.default |
303 | e.expects(:required_enterprise_fields).returns(['contact_phone']).at_least_once | 303 | e.expects(:required_enterprise_fields).returns(['contact_phone']).at_least_once |
304 | enterprise = build(Enterprise, :environment => e) | 304 | enterprise = build(Enterprise, :environment => e) |
305 | - assert ! enterprise.valid? | 305 | + refute enterprise.valid? |
306 | assert enterprise.errors[:contact_phone.to_s].present? | 306 | assert enterprise.errors[:contact_phone.to_s].present? |
307 | 307 | ||
308 | enterprise.contact_phone = '99999' | 308 | enterprise.contact_phone = '99999' |
309 | enterprise.valid? | 309 | enterprise.valid? |
310 | - assert ! enterprise.errors[:contact_phone.to_s].present? | 310 | + refute enterprise.errors[:contact_phone.to_s].present? |
311 | end | 311 | end |
312 | 312 | ||
313 | should 'not require fields if enterprise is a template' do | 313 | should 'not require fields if enterprise is a template' do |
314 | e = Environment.default | 314 | e = Environment.default |
315 | e.expects(:required_enterprise_fields).returns(['contact_phone']).at_least_once | 315 | e.expects(:required_enterprise_fields).returns(['contact_phone']).at_least_once |
316 | enterprise = build(Enterprise, :environment => e) | 316 | enterprise = build(Enterprise, :environment => e) |
317 | - assert ! enterprise.valid? | 317 | + refute enterprise.valid? |
318 | assert enterprise.errors[:contact_phone.to_s].present? | 318 | assert enterprise.errors[:contact_phone.to_s].present? |
319 | 319 | ||
320 | enterprise.is_template = true | 320 | enterprise.is_template = true |
321 | enterprise.valid? | 321 | enterprise.valid? |
322 | - assert ! enterprise.errors[:contact_phone.to_s].present? | 322 | + refute enterprise.errors[:contact_phone.to_s].present? |
323 | end | 323 | end |
324 | 324 | ||
325 | should 'enable contact' do | 325 | should 'enable contact' do |
326 | enterprise = build(Enterprise, :enable_contact_us => false) | 326 | enterprise = build(Enterprise, :enable_contact_us => false) |
327 | - assert !enterprise.enable_contact? | 327 | + refute enterprise.enable_contact? |
328 | enterprise.enable_contact_us = true | 328 | enterprise.enable_contact_us = true |
329 | assert enterprise.enable_contact? | 329 | assert enterprise.enable_contact? |
330 | end | 330 | end |
@@ -370,7 +370,7 @@ class EnterpriseTest < ActiveSupport::TestCase | @@ -370,7 +370,7 @@ class EnterpriseTest < ActiveSupport::TestCase | ||
370 | e.disable('enterprises_are_validated_when_created') | 370 | e.disable('enterprises_are_validated_when_created') |
371 | e.save | 371 | e.save |
372 | enterprise = create(Enterprise, :name => 'test enteprise', :identifier => 'test_ent2') | 372 | enterprise = create(Enterprise, :name => 'test enteprise', :identifier => 'test_ent2') |
373 | - assert !enterprise.validated | 373 | + refute enterprise.validated |
374 | end | 374 | end |
375 | 375 | ||
376 | should 'have inactive_template when creating enterprise and feature is enabled' do | 376 | should 'have inactive_template when creating enterprise and feature is enabled' do |
@@ -437,11 +437,11 @@ class EnterpriseTest < ActiveSupport::TestCase | @@ -437,11 +437,11 @@ class EnterpriseTest < ActiveSupport::TestCase | ||
437 | p2 = fast_create(Person) | 437 | p2 = fast_create(Person) |
438 | p3 = fast_create(Person) | 438 | p3 = fast_create(Person) |
439 | 439 | ||
440 | - assert !p1.is_member_of?(e) | 440 | + refute p1.is_member_of?(e) |
441 | e.add_member(p1) | 441 | e.add_member(p1) |
442 | assert p1.is_member_of?(e) | 442 | assert p1.is_member_of?(e) |
443 | 443 | ||
444 | - assert !p3.is_member_of?(e) | 444 | + refute p3.is_member_of?(e) |
445 | e.add_member(p3) | 445 | e.add_member(p3) |
446 | assert p3.is_member_of?(e) | 446 | assert p3.is_member_of?(e) |
447 | 447 | ||
@@ -514,14 +514,14 @@ class EnterpriseTest < ActiveSupport::TestCase | @@ -514,14 +514,14 @@ class EnterpriseTest < ActiveSupport::TestCase | ||
514 | 514 | ||
515 | member = create_user('memberuser').person | 515 | member = create_user('memberuser').person |
516 | c.add_member(member) | 516 | c.add_member(member) |
517 | - assert !c.is_admin?(member) | 517 | + refute c.is_admin?(member) |
518 | end | 518 | end |
519 | 519 | ||
520 | should 'a moderator user not be a community admin' do | 520 | should 'a moderator user not be a community admin' do |
521 | c = fast_create(Enterprise, :name => 'my test profile', :identifier => 'mytestprofile') | 521 | c = fast_create(Enterprise, :name => 'my test profile', :identifier => 'mytestprofile') |
522 | moderator = create_user('moderatoruser').person | 522 | moderator = create_user('moderatoruser').person |
523 | c.add_moderator(moderator) | 523 | c.add_moderator(moderator) |
524 | - assert !c.is_admin?(moderator) | 524 | + refute c.is_admin?(moderator) |
525 | end | 525 | end |
526 | 526 | ||
527 | 527 |
test/unit/environment_mailing_test.rb
@@ -20,7 +20,7 @@ class EnvironmentMailingTest < ActiveSupport::TestCase | @@ -20,7 +20,7 @@ class EnvironmentMailingTest < ActiveSupport::TestCase | ||
20 | 20 | ||
21 | mailing.source_id = environment.id | 21 | mailing.source_id = environment.id |
22 | mailing.valid? | 22 | mailing.valid? |
23 | - assert !mailing.errors[:source_id].any? | 23 | + refute mailing.errors[:source_id].any? |
24 | end | 24 | end |
25 | 25 | ||
26 | should 'return environment name' do | 26 | should 'return environment name' do |
@@ -95,7 +95,7 @@ class EnvironmentMailingTest < ActiveSupport::TestCase | @@ -95,7 +95,7 @@ class EnvironmentMailingTest < ActiveSupport::TestCase | ||
95 | mailing = create_mailing(environment, :person => person_1) | 95 | mailing = create_mailing(environment, :person => person_1) |
96 | process_delayed_job_queue | 96 | process_delayed_job_queue |
97 | 97 | ||
98 | - assert !mailing.mailing_sents.find_by_person_id(recipient.id) | 98 | + refute mailing.mailing_sents.find_by_person_id(recipient.id) |
99 | end | 99 | end |
100 | 100 | ||
101 | def new_mailing(environment) | 101 | def new_mailing(environment) |
test/unit/environment_test.rb
@@ -11,7 +11,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -11,7 +11,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
11 | 11 | ||
12 | vc2 = build(Environment, :name => 'Another Test Community') | 12 | vc2 = build(Environment, :name => 'Another Test Community') |
13 | vc2.is_default = true | 13 | vc2.is_default = true |
14 | - assert !vc2.valid? | 14 | + refute vc2.valid? |
15 | assert vc2.errors[:is_default.to_s].present? | 15 | assert vc2.errors[:is_default.to_s].present? |
16 | 16 | ||
17 | assert_equal vc, Environment.default | 17 | assert_equal vc, Environment.default |
@@ -38,7 +38,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -38,7 +38,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
38 | v.enable('feature1', false) | 38 | v.enable('feature1', false) |
39 | assert v.enabled?('feature1') | 39 | assert v.enabled?('feature1') |
40 | v.disable('feature1', false) | 40 | v.disable('feature1', false) |
41 | - assert !v.enabled?('feature1') | 41 | + refute v.enabled?('feature1') |
42 | end | 42 | end |
43 | 43 | ||
44 | def test_enabled_features | 44 | def test_enabled_features |
@@ -50,7 +50,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -50,7 +50,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
50 | 50 | ||
51 | def test_enabled_features_no_features_enabled | 51 | def test_enabled_features_no_features_enabled |
52 | v = fast_create(Environment) | 52 | v = fast_create(Environment) |
53 | - assert !v.enabled?('feature1') && !v.enabled?('feature2') && !v.enabled?('feature3') | 53 | + refute v.enabled?('feature1') && !v.enabled?('feature2') && !v.enabled?('feature3') |
54 | end | 54 | end |
55 | 55 | ||
56 | def test_default_enabled_features_are_enabled | 56 | def test_default_enabled_features_are_enabled |
@@ -66,7 +66,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -66,7 +66,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
66 | assert v.errors[:name.to_s].present? | 66 | assert v.errors[:name.to_s].present? |
67 | v.name = 'blablabla' | 67 | v.name = 'blablabla' |
68 | v.valid? | 68 | v.valid? |
69 | - assert !v.errors[:name.to_s].present? | 69 | + refute v.errors[:name.to_s].present? |
70 | end | 70 | end |
71 | 71 | ||
72 | def test_terms_of_use | 72 | def test_terms_of_use |
@@ -84,12 +84,12 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -84,12 +84,12 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
84 | v.terms_of_use = "" | 84 | v.terms_of_use = "" |
85 | assert v.save | 85 | assert v.save |
86 | v.reload | 86 | v.reload |
87 | - assert !v.has_terms_of_use? | 87 | + refute v.has_terms_of_use? |
88 | end | 88 | end |
89 | 89 | ||
90 | def test_has_terms_of_use | 90 | def test_has_terms_of_use |
91 | v = Environment.new | 91 | v = Environment.new |
92 | - assert !v.has_terms_of_use? | 92 | + refute v.has_terms_of_use? |
93 | v.terms_of_use = 'some terms of use' | 93 | v.terms_of_use = 'some terms of use' |
94 | assert v.has_terms_of_use? | 94 | assert v.has_terms_of_use? |
95 | end | 95 | end |
@@ -105,11 +105,11 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -105,11 +105,11 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
105 | 105 | ||
106 | def test_has_terms_of_enterprise_use | 106 | def test_has_terms_of_enterprise_use |
107 | v = Environment.new | 107 | v = Environment.new |
108 | - assert !v.has_terms_of_enterprise_use? | 108 | + refute v.has_terms_of_enterprise_use? |
109 | v.terms_of_enterprise_use = 'some terms of enterprise use' | 109 | v.terms_of_enterprise_use = 'some terms of enterprise use' |
110 | assert v.has_terms_of_enterprise_use? | 110 | assert v.has_terms_of_enterprise_use? |
111 | v.terms_of_enterprise_use = '' | 111 | v.terms_of_enterprise_use = '' |
112 | - assert !v.has_terms_of_enterprise_use? | 112 | + refute v.has_terms_of_enterprise_use? |
113 | end | 113 | end |
114 | 114 | ||
115 | def test_should_list_top_level_categories | 115 | def test_should_list_top_level_categories |
@@ -122,7 +122,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -122,7 +122,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
122 | assert_equal 2, cats.size | 122 | assert_equal 2, cats.size |
123 | assert cats.include?(cat1) | 123 | assert cats.include?(cat1) |
124 | assert cats.include?(cat2) | 124 | assert cats.include?(cat2) |
125 | - assert !cats.include?(subcat) | 125 | + refute cats.include?(subcat) |
126 | end | 126 | end |
127 | 127 | ||
128 | def test_should_list_all_categories | 128 | def test_should_list_all_categories |
@@ -157,18 +157,18 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -157,18 +157,18 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
157 | should 'list displayable categories' do | 157 | should 'list displayable categories' do |
158 | env = fast_create(Environment) | 158 | env = fast_create(Environment) |
159 | cat1 = create(Category, :environment => env, :name => 'category one', :display_color => 'ffa500') | 159 | cat1 = create(Category, :environment => env, :name => 'category one', :display_color => 'ffa500') |
160 | - assert ! cat1.new_record? | 160 | + refute cat1.new_record? |
161 | 161 | ||
162 | # subcategories should be ignored | 162 | # subcategories should be ignored |
163 | subcat1 = create(Category, :environment => env, :name => 'subcategory one', :parent_id => cat1.id) | 163 | subcat1 = create(Category, :environment => env, :name => 'subcategory one', :parent_id => cat1.id) |
164 | - assert ! subcat1.new_record? | 164 | + refute subcat1.new_record? |
165 | 165 | ||
166 | cat2 = create(Category, :environment => env, :name => 'category two') | 166 | cat2 = create(Category, :environment => env, :name => 'category two') |
167 | - assert !cat2.new_record? | 167 | + refute cat2.new_record? |
168 | 168 | ||
169 | assert_equal 1, env.display_categories.size | 169 | assert_equal 1, env.display_categories.size |
170 | assert env.display_categories.include?(cat1) | 170 | assert env.display_categories.include?(cat1) |
171 | - assert !env.display_categories.include?(cat2) | 171 | + refute env.display_categories.include?(cat2) |
172 | end | 172 | end |
173 | 173 | ||
174 | should 'have regions' do | 174 | should 'have regions' do |
@@ -192,7 +192,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -192,7 +192,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
192 | 192 | ||
193 | env.contact_email = 'test@example.com' | 193 | env.contact_email = 'test@example.com' |
194 | env.valid? | 194 | env.valid? |
195 | - assert !env.errors[:contact_email.to_s].present? | 195 | + refute env.errors[:contact_email.to_s].present? |
196 | end | 196 | end |
197 | 197 | ||
198 | should 'notify contact email' do | 198 | should 'notify contact email' do |
@@ -512,10 +512,10 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -512,10 +512,10 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
512 | assert_kind_of Person, e.person_default_template | 512 | assert_kind_of Person, e.person_default_template |
513 | 513 | ||
514 | # the templates must be private | 514 | # the templates must be private |
515 | - assert !e.enterprise_default_template.visible? | ||
516 | - assert !e.inactive_enterprise_template.visible? | ||
517 | - assert !e.community_default_template.visible? | ||
518 | - assert !e.person_default_template.visible? | 515 | + refute e.enterprise_default_template.visible? |
516 | + refute e.inactive_enterprise_template.visible? | ||
517 | + refute e.community_default_template.visible? | ||
518 | + refute e.person_default_template.visible? | ||
519 | end | 519 | end |
520 | 520 | ||
521 | should 'person_templates return all templates of person' do | 521 | should 'person_templates return all templates of person' do |
@@ -710,7 +710,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -710,7 +710,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
710 | 710 | ||
711 | p2 = fast_create(Person, :is_template => true, :environment_id => env.id) | 711 | p2 = fast_create(Person, :is_template => true, :environment_id => env.id) |
712 | env.person_default_template= p2.id | 712 | env.person_default_template= p2.id |
713 | - assert !env.is_default_template?(p1) | 713 | + refute env.is_default_template?(p1) |
714 | end | 714 | end |
715 | 715 | ||
716 | should 'is_default_template? method identify a community default template as default' do | 716 | should 'is_default_template? method identify a community default template as default' do |
@@ -722,7 +722,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -722,7 +722,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
722 | 722 | ||
723 | c2 = fast_create(Community, :is_template => true, :environment_id => env.id) | 723 | c2 = fast_create(Community, :is_template => true, :environment_id => env.id) |
724 | env.community_default_template= c2.id | 724 | env.community_default_template= c2.id |
725 | - assert !env.is_default_template?(c1) | 725 | + refute env.is_default_template?(c1) |
726 | end | 726 | end |
727 | 727 | ||
728 | should 'is_default_template? method identify a enterprise default template as default' do | 728 | should 'is_default_template? method identify a enterprise default template as default' do |
@@ -734,7 +734,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -734,7 +734,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
734 | 734 | ||
735 | e2 = fast_create(Enterprise, :is_template => true, :environment_id => env.id) | 735 | e2 = fast_create(Enterprise, :is_template => true, :environment_id => env.id) |
736 | env.enterprise_default_template= e2.id | 736 | env.enterprise_default_template= e2.id |
737 | - assert !env.is_default_template?(e1) | 737 | + refute env.is_default_template?(e1) |
738 | end | 738 | end |
739 | 739 | ||
740 | should 'have a layout template' do | 740 | should 'have a layout template' do |
@@ -772,7 +772,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -772,7 +772,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
772 | env.custom_person_fields = { 'birth_date' => {'required' => 'true', 'active' => 'true'}, 'cell_phone' => {'required' => 'true', 'active' => 'true'}} | 772 | env.custom_person_fields = { 'birth_date' => {'required' => 'true', 'active' => 'true'}, 'cell_phone' => {'required' => 'true', 'active' => 'true'}} |
773 | expected_hash = {'cell_phone' => {'required' => 'true', 'active' => 'true', 'signup' => 'true'}} | 773 | expected_hash = {'cell_phone' => {'required' => 'true', 'active' => 'true', 'signup' => 'true'}} |
774 | assert(env.custom_person_fields.merge(expected_hash) == env.custom_person_fields) | 774 | assert(env.custom_person_fields.merge(expected_hash) == env.custom_person_fields) |
775 | - assert ! env.custom_person_fields.keys.include?('birth_date') | 775 | + refute env.custom_person_fields.keys.include?('birth_date') |
776 | end | 776 | end |
777 | 777 | ||
778 | should 'add schooling_status if custom_person_fields has schooling' do | 778 | should 'add schooling_status if custom_person_fields has schooling' do |
@@ -782,7 +782,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -782,7 +782,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
782 | env.custom_person_fields = { 'schooling' => {'required' => 'true', 'active' => 'true'}} | 782 | env.custom_person_fields = { 'schooling' => {'required' => 'true', 'active' => 'true'}} |
783 | expected_hash = {'schooling' => {'required' => 'true', 'active' => 'true', 'signup' => 'true'}, 'schooling_status' => {'required' => 'true', 'signup' => 'true', 'active' => 'true'}} | 783 | expected_hash = {'schooling' => {'required' => 'true', 'active' => 'true', 'signup' => 'true'}, 'schooling_status' => {'required' => 'true', 'signup' => 'true', 'active' => 'true'}} |
784 | assert(env.custom_person_fields.merge(expected_hash) == env.custom_person_fields) | 784 | assert(env.custom_person_fields.merge(expected_hash) == env.custom_person_fields) |
785 | - assert ! env.custom_person_fields.keys.include?('birth_date') | 785 | + refute env.custom_person_fields.keys.include?('birth_date') |
786 | end | 786 | end |
787 | 787 | ||
788 | should 'return person_fields status' do | 788 | should 'return person_fields status' do |
@@ -846,7 +846,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -846,7 +846,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
846 | 846 | ||
847 | env.custom_enterprise_fields = { 'contact_email' => {'required' => 'true', 'active' => 'true'}, 'contact_person' => {'required' => 'true', 'active' => 'true'}} | 847 | env.custom_enterprise_fields = { 'contact_email' => {'required' => 'true', 'active' => 'true'}, 'contact_person' => {'required' => 'true', 'active' => 'true'}} |
848 | assert_equal({'contact_person' => {'required' => 'true', 'signup' => 'true', 'active' => 'true'}}, env.custom_enterprise_fields) | 848 | assert_equal({'contact_person' => {'required' => 'true', 'signup' => 'true', 'active' => 'true'}}, env.custom_enterprise_fields) |
849 | - assert ! env.custom_enterprise_fields.keys.include?('contact_email') | 849 | + refute env.custom_enterprise_fields.keys.include?('contact_email') |
850 | end | 850 | end |
851 | 851 | ||
852 | should 'return enteprise_fields status' do | 852 | should 'return enteprise_fields status' do |
@@ -889,7 +889,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -889,7 +889,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
889 | 889 | ||
890 | env.custom_community_fields = { 'contact_email' => {'required' => 'true', 'active' => 'true'}, 'contact_person' => {'required' => 'true', 'active' => 'true'}} | 890 | env.custom_community_fields = { 'contact_email' => {'required' => 'true', 'active' => 'true'}, 'contact_person' => {'required' => 'true', 'active' => 'true'}} |
891 | assert_equal({'contact_person' => {'required' => 'true', 'signup' => 'true', 'active' => 'true'}}, env.custom_community_fields) | 891 | assert_equal({'contact_person' => {'required' => 'true', 'signup' => 'true', 'active' => 'true'}}, env.custom_community_fields) |
892 | - assert ! env.custom_community_fields.keys.include?('contact_email') | 892 | + refute env.custom_community_fields.keys.include?('contact_email') |
893 | end | 893 | end |
894 | 894 | ||
895 | should 'return community_fields status' do | 895 | should 'return community_fields status' do |
@@ -1165,7 +1165,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -1165,7 +1165,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
1165 | should "terms of use not be an blank string" do | 1165 | should "terms of use not be an blank string" do |
1166 | v = fast_create(Environment) | 1166 | v = fast_create(Environment) |
1167 | v.terms_of_use = ' ' | 1167 | v.terms_of_use = ' ' |
1168 | - assert !v.has_terms_of_use? | 1168 | + refute v.has_terms_of_use? |
1169 | end | 1169 | end |
1170 | 1170 | ||
1171 | should 'have currency unit attribute' do | 1171 | should 'have currency unit attribute' do |
@@ -1410,7 +1410,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -1410,7 +1410,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
1410 | 1410 | ||
1411 | environment.reports_lower_bound = 5 | 1411 | environment.reports_lower_bound = 5 |
1412 | environment.valid? | 1412 | environment.valid? |
1413 | - assert !environment.errors[:reports_lower_bound.to_s].present? | 1413 | + refute environment.errors[:reports_lower_bound.to_s].present? |
1414 | end | 1414 | end |
1415 | 1415 | ||
1416 | should 'be able to enable or disable a plugin with the class or class name' do | 1416 | should 'be able to enable or disable a plugin with the class or class name' do |
@@ -1424,7 +1424,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -1424,7 +1424,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
1424 | 1424 | ||
1425 | environment.disable_plugin(Plugin.to_s) | 1425 | environment.disable_plugin(Plugin.to_s) |
1426 | environment.reload | 1426 | environment.reload |
1427 | - assert !environment.plugin_enabled?(Plugin) | 1427 | + refute environment.plugin_enabled?(Plugin) |
1428 | end | 1428 | end |
1429 | 1429 | ||
1430 | should 'activate on database all available plugins' do | 1430 | should 'activate on database all available plugins' do |
@@ -1492,7 +1492,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -1492,7 +1492,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
1492 | Environment.login_redirection_options.keys.each do |redirection| | 1492 | Environment.login_redirection_options.keys.each do |redirection| |
1493 | environment.redirection_after_login = redirection | 1493 | environment.redirection_after_login = redirection |
1494 | environment.save | 1494 | environment.save |
1495 | - assert !environment.errors[:redirection_after_login.to_s].present? | 1495 | + refute environment.errors[:redirection_after_login.to_s].present? |
1496 | end | 1496 | end |
1497 | end | 1497 | end |
1498 | 1498 | ||
@@ -1513,7 +1513,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -1513,7 +1513,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
1513 | Environment.signup_redirection_options.keys.each do |redirection| | 1513 | Environment.signup_redirection_options.keys.each do |redirection| |
1514 | environment.redirection_after_signup = redirection | 1514 | environment.redirection_after_signup = redirection |
1515 | environment.save | 1515 | environment.save |
1516 | - assert !environment.errors[:redirection_after_signup.to_s].present? | 1516 | + refute environment.errors[:redirection_after_signup.to_s].present? |
1517 | end | 1517 | end |
1518 | end | 1518 | end |
1519 | 1519 | ||
@@ -1537,14 +1537,14 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -1537,14 +1537,14 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
1537 | 1537 | ||
1538 | should 'not consider signup welcome text if not defined' do | 1538 | should 'not consider signup welcome text if not defined' do |
1539 | env = Environment.default | 1539 | env = Environment.default |
1540 | - assert !env.has_signup_welcome_text? | 1540 | + refute env.has_signup_welcome_text? |
1541 | end | 1541 | end |
1542 | 1542 | ||
1543 | should 'not consider signup welcome text if nil' do | 1543 | should 'not consider signup welcome text if nil' do |
1544 | env = Environment.default | 1544 | env = Environment.default |
1545 | 1545 | ||
1546 | env.signup_welcome_text = nil | 1546 | env.signup_welcome_text = nil |
1547 | - assert !env.has_signup_welcome_text? | 1547 | + refute env.has_signup_welcome_text? |
1548 | end | 1548 | end |
1549 | 1549 | ||
1550 | should 'not consider signup welcome text if body is nil' do | 1550 | should 'not consider signup welcome text if body is nil' do |
@@ -1553,7 +1553,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -1553,7 +1553,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
1553 | env.signup_welcome_text = { | 1553 | env.signup_welcome_text = { |
1554 | :subject => 'Welcome to the environment', | 1554 | :subject => 'Welcome to the environment', |
1555 | } | 1555 | } |
1556 | - assert !env.has_signup_welcome_text? | 1556 | + refute env.has_signup_welcome_text? |
1557 | end | 1557 | end |
1558 | 1558 | ||
1559 | should 'consider signup welcome text if subject is nil but body is defined' do | 1559 | should 'consider signup welcome text if subject is nil but body is defined' do |
@@ -1604,7 +1604,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -1604,7 +1604,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
1604 | 1604 | ||
1605 | environment.default_language = 'en' | 1605 | environment.default_language = 'en' |
1606 | environment.valid? | 1606 | environment.valid? |
1607 | - assert !environment.errors[:default_language.to_s].present? | 1607 | + refute environment.errors[:default_language.to_s].present? |
1608 | end | 1608 | end |
1609 | 1609 | ||
1610 | should 'define default locale or use the config default locale' do | 1610 | should 'define default locale or use the config default locale' do |
@@ -1627,7 +1627,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -1627,7 +1627,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
1627 | 1627 | ||
1628 | environment.languages = ['en'] | 1628 | environment.languages = ['en'] |
1629 | environment.valid? | 1629 | environment.valid? |
1630 | - assert !environment.errors[:languages.to_s].present? | 1630 | + refute environment.errors[:languages.to_s].present? |
1631 | end | 1631 | end |
1632 | 1632 | ||
1633 | should 'define locales or use the config locales' do | 1633 | should 'define locales or use the config locales' do |
@@ -1655,14 +1655,14 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -1655,14 +1655,14 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
1655 | 1655 | ||
1656 | should 'not consider custom welcome screen text if not defined' do | 1656 | should 'not consider custom welcome screen text if not defined' do |
1657 | env = Environment.default | 1657 | env = Environment.default |
1658 | - assert !env.has_custom_welcome_screen? | 1658 | + refute env.has_custom_welcome_screen? |
1659 | end | 1659 | end |
1660 | 1660 | ||
1661 | should 'not consider custom welcome screen text if nil' do | 1661 | should 'not consider custom welcome screen text if nil' do |
1662 | env = Environment.default | 1662 | env = Environment.default |
1663 | 1663 | ||
1664 | env.signup_welcome_screen_body = nil | 1664 | env.signup_welcome_screen_body = nil |
1665 | - assert !env.has_custom_welcome_screen? | 1665 | + refute env.has_custom_welcome_screen? |
1666 | end | 1666 | end |
1667 | 1667 | ||
1668 | should 'consider signup welcome screen if body is defined' do | 1668 | should 'consider signup welcome screen if body is defined' do |
@@ -1699,7 +1699,7 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -1699,7 +1699,7 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
1699 | should 'has_license be false if there is no license in enviroment' do | 1699 | should 'has_license be false if there is no license in enviroment' do |
1700 | e = fast_create(Environment) | 1700 | e = fast_create(Environment) |
1701 | 1701 | ||
1702 | - assert !e.has_license? | 1702 | + refute e.has_license? |
1703 | end | 1703 | end |
1704 | 1704 | ||
1705 | should 'validates_inclusion_of date format' do | 1705 | should 'validates_inclusion_of date format' do |
@@ -1711,23 +1711,23 @@ class EnvironmentTest < ActiveSupport::TestCase | @@ -1711,23 +1711,23 @@ class EnvironmentTest < ActiveSupport::TestCase | ||
1711 | 1711 | ||
1712 | environment.date_format = "numbers_with_year" | 1712 | environment.date_format = "numbers_with_year" |
1713 | environment.valid? | 1713 | environment.valid? |
1714 | - assert !environment.errors[:date_format.to_s].present? | 1714 | + refute environment.errors[:date_format.to_s].present? |
1715 | 1715 | ||
1716 | environment.date_format = "numbers" | 1716 | environment.date_format = "numbers" |
1717 | environment.valid? | 1717 | environment.valid? |
1718 | - assert !environment.errors[:date_format.to_s].present? | 1718 | + refute environment.errors[:date_format.to_s].present? |
1719 | 1719 | ||
1720 | environment.date_format = "month_name_with_year" | 1720 | environment.date_format = "month_name_with_year" |
1721 | environment.valid? | 1721 | environment.valid? |
1722 | - assert !environment.errors[:date_format.to_s].present? | 1722 | + refute environment.errors[:date_format.to_s].present? |
1723 | 1723 | ||
1724 | environment.date_format = "month_name" | 1724 | environment.date_format = "month_name" |
1725 | environment.valid? | 1725 | environment.valid? |
1726 | - assert !environment.errors[:date_format.to_s].present? | 1726 | + refute environment.errors[:date_format.to_s].present? |
1727 | 1727 | ||
1728 | environment.date_format = "past_time" | 1728 | environment.date_format = "past_time" |
1729 | environment.valid? | 1729 | environment.valid? |
1730 | - assert !environment.errors[:date_format.to_s].present? | 1730 | + refute environment.errors[:date_format.to_s].present? |
1731 | end | 1731 | end |
1732 | 1732 | ||
1733 | end | 1733 | end |
test/unit/event_test.rb
@@ -47,7 +47,7 @@ class EventTest < ActiveSupport::TestCase | @@ -47,7 +47,7 @@ class EventTest < ActiveSupport::TestCase | ||
47 | assert e.errors[:start_date.to_s].present? | 47 | assert e.errors[:start_date.to_s].present? |
48 | e.start_date = Date.today | 48 | e.start_date = Date.today |
49 | e.valid? | 49 | e.valid? |
50 | - assert !e.errors[:start_date.to_s].present? | 50 | + refute e.errors[:start_date.to_s].present? |
51 | end | 51 | end |
52 | 52 | ||
53 | should 'have a end date' do | 53 | should 'have a end date' do |
@@ -67,7 +67,7 @@ class EventTest < ActiveSupport::TestCase | @@ -67,7 +67,7 @@ class EventTest < ActiveSupport::TestCase | ||
67 | 67 | ||
68 | e.end_date = Date.new(2008,01,05) | 68 | e.end_date = Date.new(2008,01,05) |
69 | e.valid? | 69 | e.valid? |
70 | - assert !e.errors[:start_date.to_s].present? | 70 | + refute e.errors[:start_date.to_s].present? |
71 | end | 71 | end |
72 | 72 | ||
73 | should 'find by range of dates' do | 73 | should 'find by range of dates' do |
@@ -223,8 +223,8 @@ class EventTest < ActiveSupport::TestCase | @@ -223,8 +223,8 @@ class EventTest < ActiveSupport::TestCase | ||
223 | assert month_events.include?(current_month_event_1) | 223 | assert month_events.include?(current_month_event_1) |
224 | assert month_events.include?(current_month_event_2) | 224 | assert month_events.include?(current_month_event_2) |
225 | 225 | ||
226 | - assert !month_events.include?(last_month_event) | ||
227 | - assert !month_events.include?(next_month_event) | 226 | + refute month_events.include?(last_month_event) |
227 | + refute month_events.include?(next_month_event) | ||
228 | end | 228 | end |
229 | 229 | ||
230 | should 'event by month ordered by start date'do | 230 | should 'event by month ordered by start date'do |
@@ -339,7 +339,7 @@ class EventTest < ActiveSupport::TestCase | @@ -339,7 +339,7 @@ class EventTest < ActiveSupport::TestCase | ||
339 | 339 | ||
340 | event = Event.new(:profile => profile) | 340 | event = Event.new(:profile => profile) |
341 | 341 | ||
342 | - assert !event.translatable? | 342 | + refute event.translatable? |
343 | end | 343 | end |
344 | 344 | ||
345 | should 'be translatable if there is languages on environment' do | 345 | should 'be translatable if there is languages on environment' do |
@@ -348,7 +348,7 @@ class EventTest < ActiveSupport::TestCase | @@ -348,7 +348,7 @@ class EventTest < ActiveSupport::TestCase | ||
348 | profile = fast_create(Person, :environment_id => environment.id) | 348 | profile = fast_create(Person, :environment_id => environment.id) |
349 | event = fast_create(Event, :profile_id => profile.id) | 349 | event = fast_create(Event, :profile_id => profile.id) |
350 | 350 | ||
351 | - assert !event.translatable? | 351 | + refute event.translatable? |
352 | 352 | ||
353 | 353 | ||
354 | environment.languages = ['en','pt','fr'] | 354 | environment.languages = ['en','pt','fr'] |
test/unit/external_feed_test.rb
@@ -21,7 +21,7 @@ class ExternalFeedTest < ActiveSupport::TestCase | @@ -21,7 +21,7 @@ class ExternalFeedTest < ActiveSupport::TestCase | ||
21 | blog = create_blog | 21 | blog = create_blog |
22 | e = create(:external_feed, blog: blog) | 22 | e = create(:external_feed, blog: blog) |
23 | assert e.add_item('Article title', 'http://orig.link.invalid', Time.now, 'Content for external post') | 23 | assert e.add_item('Article title', 'http://orig.link.invalid', Time.now, 'Content for external post') |
24 | - assert !e.add_item('Article title', 'http://orig.link.invalid', Time.now, 'Content for external post') | 24 | + refute e.add_item('Article title', 'http://orig.link.invalid', Time.now, 'Content for external post') |
25 | assert_equal 1, e.blog.posts.size | 25 | assert_equal 1, e.blog.posts.size |
26 | end | 26 | end |
27 | 27 | ||
@@ -61,7 +61,7 @@ class ExternalFeedTest < ActiveSupport::TestCase | @@ -61,7 +61,7 @@ class ExternalFeedTest < ActiveSupport::TestCase | ||
61 | 61 | ||
62 | should 'require address if enabled' do | 62 | should 'require address if enabled' do |
63 | e = build(ExternalFeed, :enabled => true, :address => nil) | 63 | e = build(ExternalFeed, :enabled => true, :address => nil) |
64 | - assert !e.valid? | 64 | + refute e.valid? |
65 | assert e.errors[:address].present? | 65 | assert e.errors[:address].present? |
66 | end | 66 | end |
67 | 67 |
test/unit/feed_handler_test.rb
@@ -104,13 +104,13 @@ class FeedHandlerTest < ActiveSupport::TestCase | @@ -104,13 +104,13 @@ class FeedHandlerTest < ActiveSupport::TestCase | ||
104 | 104 | ||
105 | # in the first 4 errors, we are ok | 105 | # in the first 4 errors, we are ok |
106 | 4.times { handler.process(container) } | 106 | 4.times { handler.process(container) } |
107 | - assert !container.error_message.blank?, 'should set the error message for the first <max_errors> errors (%s)' % container_class | 107 | + refute container.error_message.blank?, 'should set the error message for the first <max_errors> errors (%s)' % container_class |
108 | assert container.enabled, 'must keep container enabled during the first <max_errors> errors (%s)' % container_class | 108 | assert container.enabled, 'must keep container enabled during the first <max_errors> errors (%s)' % container_class |
109 | 109 | ||
110 | # 5 errors it too much | 110 | # 5 errors it too much |
111 | handler.process(container) | 111 | handler.process(container) |
112 | - assert !container.error_message.blank?, 'must set error message in container after <max_errors> errors (%s)' % container_class | ||
113 | - assert !container.enabled, 'must disable continer after <max_errors> errors (%s)' % container_class | 112 | + refute container.error_message.blank?, 'must set error message in container after <max_errors> errors (%s)' % container_class |
113 | + refute container.enabled, 'must disable continer after <max_errors> errors (%s)' % container_class | ||
114 | end | 114 | end |
115 | 115 | ||
116 | should "reenable after <disabled_period> (#{container_class})" do | 116 | should "reenable after <disabled_period> (#{container_class})" do |
test/unit/forum_test.rb
@@ -107,7 +107,7 @@ class ForumTest < ActiveSupport::TestCase | @@ -107,7 +107,7 @@ class ForumTest < ActiveSupport::TestCase | ||
107 | 107 | ||
108 | should 'not accept uploads' do | 108 | should 'not accept uploads' do |
109 | folder = fast_create(Forum) | 109 | folder = fast_create(Forum) |
110 | - assert !folder.accept_uploads? | 110 | + refute folder.accept_uploads? |
111 | end | 111 | end |
112 | 112 | ||
113 | should 'be notifiable' do | 113 | should 'be notifiable' do |
@@ -180,7 +180,7 @@ class ForumTest < ActiveSupport::TestCase | @@ -180,7 +180,7 @@ class ForumTest < ActiveSupport::TestCase | ||
180 | forum = Forum.new(:profile => person) | 180 | forum = Forum.new(:profile => person) |
181 | 181 | ||
182 | assert forum.can_create_topic?(person) | 182 | assert forum.can_create_topic?(person) |
183 | - assert !forum.can_create_topic?(someone) | 183 | + refute forum.can_create_topic?(someone) |
184 | end | 184 | end |
185 | 185 | ||
186 | should 'always allow topic creation to profile admins' do | 186 | should 'always allow topic creation to profile admins' do |
@@ -192,7 +192,7 @@ class ForumTest < ActiveSupport::TestCase | @@ -192,7 +192,7 @@ class ForumTest < ActiveSupport::TestCase | ||
192 | forum = Forum.new(:profile => profile) | 192 | forum = Forum.new(:profile => profile) |
193 | 193 | ||
194 | assert forum.can_create_topic?(admin) | 194 | assert forum.can_create_topic?(admin) |
195 | - assert !forum.can_create_topic?(someone) | 195 | + refute forum.can_create_topic?(someone) |
196 | end | 196 | end |
197 | 197 | ||
198 | should 'always allow topic creation to environment admins' do | 198 | should 'always allow topic creation to environment admins' do |
@@ -205,7 +205,7 @@ class ForumTest < ActiveSupport::TestCase | @@ -205,7 +205,7 @@ class ForumTest < ActiveSupport::TestCase | ||
205 | forum = Forum.new(:profile => profile) | 205 | forum = Forum.new(:profile => profile) |
206 | 206 | ||
207 | assert forum.can_create_topic?(admin) | 207 | assert forum.can_create_topic?(admin) |
208 | - assert !forum.can_create_topic?(someone) | 208 | + refute forum.can_create_topic?(someone) |
209 | end | 209 | end |
210 | 210 | ||
211 | should 'allow only person friends to create topics when topic_creation is related' do | 211 | should 'allow only person friends to create topics when topic_creation is related' do |
@@ -217,7 +217,7 @@ class ForumTest < ActiveSupport::TestCase | @@ -217,7 +217,7 @@ class ForumTest < ActiveSupport::TestCase | ||
217 | forum = Forum.new(:profile => person, :topic_creation => 'related') | 217 | forum = Forum.new(:profile => person, :topic_creation => 'related') |
218 | 218 | ||
219 | assert forum.can_create_topic?(friend) | 219 | assert forum.can_create_topic?(friend) |
220 | - assert !forum.can_create_topic?(someone) | 220 | + refute forum.can_create_topic?(someone) |
221 | end | 221 | end |
222 | 222 | ||
223 | should 'allow only group members to create topics when topic_creation is related' do | 223 | should 'allow only group members to create topics when topic_creation is related' do |
@@ -229,7 +229,7 @@ class ForumTest < ActiveSupport::TestCase | @@ -229,7 +229,7 @@ class ForumTest < ActiveSupport::TestCase | ||
229 | forum = Forum.new(:profile => organization, :topic_creation => 'related') | 229 | forum = Forum.new(:profile => organization, :topic_creation => 'related') |
230 | 230 | ||
231 | assert forum.can_create_topic?(member) | 231 | assert forum.can_create_topic?(member) |
232 | - assert !forum.can_create_topic?(someone) | 232 | + refute forum.can_create_topic?(someone) |
233 | end | 233 | end |
234 | 234 | ||
235 | should 'allow every user to create topics when topic_creation is users' do | 235 | should 'allow every user to create topics when topic_creation is users' do |
@@ -238,6 +238,6 @@ class ForumTest < ActiveSupport::TestCase | @@ -238,6 +238,6 @@ class ForumTest < ActiveSupport::TestCase | ||
238 | forum = Forum.new(:profile => profile, :topic_creation => 'users') | 238 | forum = Forum.new(:profile => profile, :topic_creation => 'users') |
239 | 239 | ||
240 | assert forum.can_create_topic?(user) | 240 | assert forum.can_create_topic?(user) |
241 | - assert !forum.can_create_topic?(nil) | 241 | + refute forum.can_create_topic?(nil) |
242 | end | 242 | end |
243 | end | 243 | end |
test/unit/image_test.rb
@@ -47,7 +47,7 @@ class ImageTest < ActiveSupport::TestCase | @@ -47,7 +47,7 @@ class ImageTest < ActiveSupport::TestCase | ||
47 | end | 47 | end |
48 | 48 | ||
49 | should 'return false by default in thumbnails_processed' do | 49 | should 'return false by default in thumbnails_processed' do |
50 | - assert !Image.new.thumbnails_processed | 50 | + refute Image.new.thumbnails_processed |
51 | end | 51 | end |
52 | 52 | ||
53 | should 'set thumbnails_processed to true' do | 53 | should 'set thumbnails_processed to true' do |
test/unit/input_test.rb
@@ -11,7 +11,7 @@ class InputTest < ActiveSupport::TestCase | @@ -11,7 +11,7 @@ class InputTest < ActiveSupport::TestCase | ||
11 | 11 | ||
12 | input.product_category = product_category | 12 | input.product_category = product_category |
13 | input.valid? | 13 | input.valid? |
14 | - assert !input.errors[:product_category.to_s].present? | 14 | + refute input.errors[:product_category.to_s].present? |
15 | end | 15 | end |
16 | 16 | ||
17 | should 'require product' do | 17 | should 'require product' do |
@@ -24,7 +24,7 @@ class InputTest < ActiveSupport::TestCase | @@ -24,7 +24,7 @@ class InputTest < ActiveSupport::TestCase | ||
24 | 24 | ||
25 | input.product = product | 25 | input.product = product |
26 | input.valid? | 26 | input.valid? |
27 | - assert !input.errors[:product.to_s].present? | 27 | + refute input.errors[:product.to_s].present? |
28 | end | 28 | end |
29 | 29 | ||
30 | should 'store inputs ordered by position' do | 30 | should 'store inputs ordered by position' do |
@@ -64,7 +64,7 @@ class InputTest < ActiveSupport::TestCase | @@ -64,7 +64,7 @@ class InputTest < ActiveSupport::TestCase | ||
64 | 64 | ||
65 | should 'dont have price details when price related fields was not filled' do | 65 | should 'dont have price details when price related fields was not filled' do |
66 | input = Input.new | 66 | input = Input.new |
67 | - assert !input.has_price_details? | 67 | + refute input.has_price_details? |
68 | end | 68 | end |
69 | 69 | ||
70 | should 'has price details if price_per_unit filled' do | 70 | should 'has price details if price_per_unit filled' do |
@@ -79,7 +79,7 @@ class InputTest < ActiveSupport::TestCase | @@ -79,7 +79,7 @@ class InputTest < ActiveSupport::TestCase | ||
79 | 79 | ||
80 | should 'not have price details if only unit is filled' do | 80 | should 'not have price details if only unit is filled' do |
81 | input = build(Input, :unit => Unit.new) | 81 | input = build(Input, :unit => Unit.new) |
82 | - assert !input.has_price_details? | 82 | + refute input.has_price_details? |
83 | end | 83 | end |
84 | 84 | ||
85 | should 'accept price_per_unit in american\'s or brazilian\'s currency format' do | 85 | should 'accept price_per_unit in american\'s or brazilian\'s currency format' do |
test/unit/invite_friend_test.rb
@@ -116,10 +116,10 @@ class InviteFriendTest < ActiveSupport::TestCase | @@ -116,10 +116,10 @@ class InviteFriendTest < ActiveSupport::TestCase | ||
116 | p = create_user('testuser1').person | 116 | p = create_user('testuser1').person |
117 | 117 | ||
118 | task1 = InviteFriend.new(:person => p, :friend => p, :message => 'click here: <url>') | 118 | task1 = InviteFriend.new(:person => p, :friend => p, :message => 'click here: <url>') |
119 | - assert !task1.save | 119 | + refute task1.save |
120 | 120 | ||
121 | task2 = InviteFriend.new(:person => p, :friend_name => 'Myself', :friend_email => p.user.email, :message => 'click here: <url>') | 121 | task2 = InviteFriend.new(:person => p, :friend_name => 'Myself', :friend_email => p.user.email, :message => 'click here: <url>') |
122 | - assert !task2.save | 122 | + refute task2.save |
123 | end | 123 | end |
124 | 124 | ||
125 | should 'have target notification description' do | 125 | should 'have target notification description' do |
test/unit/invite_member_test.rb
@@ -107,10 +107,10 @@ class InviteMemberTest < ActiveSupport::TestCase | @@ -107,10 +107,10 @@ class InviteMemberTest < ActiveSupport::TestCase | ||
107 | p = create_user('testuser1').person | 107 | p = create_user('testuser1').person |
108 | 108 | ||
109 | task1 = build(InviteMember, :person => p, :friend => p, :message => 'click here: <url>') | 109 | task1 = build(InviteMember, :person => p, :friend => p, :message => 'click here: <url>') |
110 | - assert !task1.save | 110 | + refute task1.save |
111 | 111 | ||
112 | task2 = build(InviteMember, :person => p, :friend_name => 'Myself', :friend_email => p.user.email, :message => 'click here: <url>') | 112 | task2 = build(InviteMember, :person => p, :friend_name => 'Myself', :friend_email => p.user.email, :message => 'click here: <url>') |
113 | - assert !task2.save | 113 | + refute task2.save |
114 | end | 114 | end |
115 | 115 | ||
116 | should 'have target notification description' do | 116 | should 'have target notification description' do |
test/unit/license_test.rb
@@ -10,8 +10,8 @@ class LicenseTest < ActiveSupport::TestCase | @@ -10,8 +10,8 @@ class LicenseTest < ActiveSupport::TestCase | ||
10 | license.name = 'GPLv3' | 10 | license.name = 'GPLv3' |
11 | license.environment = Environment.default | 11 | license.environment = Environment.default |
12 | license.valid? | 12 | license.valid? |
13 | - assert !license.errors[:name].any? | ||
14 | - assert !license.errors[:environment].any? | 13 | + refute license.errors[:name].any? |
14 | + refute license.errors[:environment].any? | ||
15 | end | 15 | end |
16 | 16 | ||
17 | should 'fill in slug before creation' do | 17 | should 'fill in slug before creation' do |
test/unit/mailing_test.rb
@@ -27,7 +27,7 @@ class MailingTest < ActiveSupport::TestCase | @@ -27,7 +27,7 @@ class MailingTest < ActiveSupport::TestCase | ||
27 | 27 | ||
28 | mailing.source_id = Environment.default.id | 28 | mailing.source_id = Environment.default.id |
29 | mailing.valid? | 29 | mailing.valid? |
30 | - assert !mailing.errors[:source_id.to_s].present? | 30 | + refute mailing.errors[:source_id.to_s].present? |
31 | end | 31 | end |
32 | 32 | ||
33 | should 'require subject' do | 33 | should 'require subject' do |
@@ -37,7 +37,7 @@ class MailingTest < ActiveSupport::TestCase | @@ -37,7 +37,7 @@ class MailingTest < ActiveSupport::TestCase | ||
37 | 37 | ||
38 | mailing.subject = 'Hello :)' | 38 | mailing.subject = 'Hello :)' |
39 | mailing.valid? | 39 | mailing.valid? |
40 | - assert !mailing.errors[:subject.to_s].present? | 40 | + refute mailing.errors[:subject.to_s].present? |
41 | end | 41 | end |
42 | 42 | ||
43 | should 'require body' do | 43 | should 'require body' do |
@@ -47,7 +47,7 @@ class MailingTest < ActiveSupport::TestCase | @@ -47,7 +47,7 @@ class MailingTest < ActiveSupport::TestCase | ||
47 | 47 | ||
48 | mailing.body = 'We have some news!' | 48 | mailing.body = 'We have some news!' |
49 | mailing.valid? | 49 | mailing.valid? |
50 | - assert !mailing.errors[:body.to_s].present? | 50 | + refute mailing.errors[:body.to_s].present? |
51 | end | 51 | end |
52 | 52 | ||
53 | should 'return source' do | 53 | should 'return source' do |
test/unit/main_block_test.rb
@@ -26,7 +26,7 @@ class MainBlockTest < ActiveSupport::TestCase | @@ -26,7 +26,7 @@ class MainBlockTest < ActiveSupport::TestCase | ||
26 | env = Environment.new | 26 | env = Environment.new |
27 | block = MainBlock.new(:display => 'never') | 27 | block = MainBlock.new(:display => 'never') |
28 | block.stubs(:owner).returns(env) | 28 | block.stubs(:owner).returns(env) |
29 | - assert !block.visible? | 29 | + refute block.visible? |
30 | end | 30 | end |
31 | 31 | ||
32 | should 'guarantee main block is always visible to everybody' do | 32 | should 'guarantee main block is always visible to everybody' do |
test/unit/moderate_user_registration_test.rb
@@ -15,7 +15,7 @@ class ModerateUserRegistrationTest < ActiveSupport::TestCase | @@ -15,7 +15,7 @@ class ModerateUserRegistrationTest < ActiveSupport::TestCase | ||
15 | t.email = user.email | 15 | t.email = user.email |
16 | t.target= environment | 16 | t.target= environment |
17 | t.save! | 17 | t.save! |
18 | - assert !user.activated? | 18 | + refute user.activated? |
19 | t.perform | 19 | t.perform |
20 | assert environment.users.find_by_id(user.id).activated? | 20 | assert environment.users.find_by_id(user.id).activated? |
21 | end | 21 | end |
test/unit/multi_tenancy.rb
@@ -31,7 +31,7 @@ class MultiTenancyTest < ActiveSupport::TestCase | @@ -31,7 +31,7 @@ class MultiTenancyTest < ActiveSupport::TestCase | ||
31 | def test_multitenancy_is_off_if_it_is_not_a_hosted_environment_and_there_is_no_mapping | 31 | def test_multitenancy_is_off_if_it_is_not_a_hosted_environment_and_there_is_no_mapping |
32 | Noosfero::MultiTenancy.expects(:mapping).returns({}) | 32 | Noosfero::MultiTenancy.expects(:mapping).returns({}) |
33 | Noosfero::MultiTenancy.expects(:is_hosted_environment?).returns(false) | 33 | Noosfero::MultiTenancy.expects(:is_hosted_environment?).returns(false) |
34 | - assert !Noosfero::MultiTenancy.on? | 34 | + refute Noosfero::MultiTenancy.on? |
35 | end | 35 | end |
36 | 36 | ||
37 | def test_set_schema_by_host | 37 | def test_set_schema_by_host |
@@ -54,7 +54,7 @@ class MultiTenancyTest < ActiveSupport::TestCase | @@ -54,7 +54,7 @@ class MultiTenancyTest < ActiveSupport::TestCase | ||
54 | 54 | ||
55 | def test_if_is_not_hosted_environment | 55 | def test_if_is_not_hosted_environment |
56 | YAML.expects(:load_file).returns(db_config) | 56 | YAML.expects(:load_file).returns(db_config) |
57 | - assert !Noosfero::MultiTenancy.send(:is_hosted_environment?) | 57 | + refute Noosfero::MultiTenancy.send(:is_hosted_environment?) |
58 | end | 58 | end |
59 | 59 | ||
60 | private | 60 | private |
test/unit/national_region_test.rb
@@ -27,7 +27,7 @@ class NationalRegionTest < ActiveSupport::TestCase | @@ -27,7 +27,7 @@ class NationalRegionTest < ActiveSupport::TestCase | ||
27 | 27 | ||
28 | found_regions = NationalRegion.search_city('Santo %', true) | 28 | found_regions = NationalRegion.search_city('Santo %', true) |
29 | 29 | ||
30 | - assert !(found_regions.length != 3) | 30 | + refute (found_regions.length != 3) |
31 | 31 | ||
32 | found_regions.each do |region| | 32 | found_regions.each do |region| |
33 | assert city_names.find_index(region.city) >= 0 | 33 | assert city_names.find_index(region.city) >= 0 |
@@ -60,7 +60,7 @@ class NationalRegionTest < ActiveSupport::TestCase | @@ -60,7 +60,7 @@ class NationalRegionTest < ActiveSupport::TestCase | ||
60 | 60 | ||
61 | found_regions = NationalRegion.search_state('Rio %', true) | 61 | found_regions = NationalRegion.search_state('Rio %', true) |
62 | 62 | ||
63 | - assert !(found_regions.length != 3) | 63 | + refute (found_regions.length != 3) |
64 | 64 | ||
65 | found_regions.each do |region| | 65 | found_regions.each do |region| |
66 | assert state_names.find_index(region.state) >= 0 | 66 | assert state_names.find_index(region.state) >= 0 |
test/unit/notify_activity_to_profiles_job_test.rb
@@ -28,7 +28,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase | @@ -28,7 +28,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase | ||
28 | person = fast_create(Person) | 28 | person = fast_create(Person) |
29 | community = fast_create(Community) | 29 | community = fast_create(Community) |
30 | action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :verb => 'create_article') | 30 | action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :verb => 'create_article') |
31 | - assert !NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) | 31 | + refute NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) |
32 | p1, p2, m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) | 32 | p1, p2, m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) |
33 | fast_create(Friendship, :person_id => person.id, :friend_id => p1.id) | 33 | fast_create(Friendship, :person_id => person.id, :friend_id => p1.id) |
34 | fast_create(Friendship, :person_id => person.id, :friend_id => p2.id) | 34 | fast_create(Friendship, :person_id => person.id, :friend_id => p2.id) |
@@ -50,7 +50,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase | @@ -50,7 +50,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase | ||
50 | person = fast_create(Person) | 50 | person = fast_create(Person) |
51 | community = fast_create(Community) | 51 | community = fast_create(Community) |
52 | action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :target_id => community.id, :verb => 'create_article') | 52 | action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :target_id => community.id, :verb => 'create_article') |
53 | - assert !NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) | 53 | + refute NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) |
54 | m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) | 54 | m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) |
55 | fast_create(RoleAssignment, :accessor_id => m1.id, :role_id => 3, :resource_id => community.id) | 55 | fast_create(RoleAssignment, :accessor_id => m1.id, :role_id => 3, :resource_id => community.id) |
56 | fast_create(RoleAssignment, :accessor_id => m2.id, :role_id => 3, :resource_id => community.id) | 56 | fast_create(RoleAssignment, :accessor_id => m2.id, :role_id => 3, :resource_id => community.id) |
@@ -70,7 +70,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase | @@ -70,7 +70,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase | ||
70 | person = fast_create(Person) | 70 | person = fast_create(Person) |
71 | community = fast_create(Community) | 71 | community = fast_create(Community) |
72 | action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :target_id => community.id, :verb => 'create_article') | 72 | action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :target_id => community.id, :verb => 'create_article') |
73 | - assert !NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) | 73 | + refute NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) |
74 | p1, p2, m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) | 74 | p1, p2, m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) |
75 | fast_create(Friendship, :person_id => person.id, :friend_id => p1.id) | 75 | fast_create(Friendship, :person_id => person.id, :friend_id => p1.id) |
76 | fast_create(Friendship, :person_id => person.id, :friend_id => p2.id) | 76 | fast_create(Friendship, :person_id => person.id, :friend_id => p2.id) |
@@ -92,7 +92,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase | @@ -92,7 +92,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase | ||
92 | person = fast_create(Person) | 92 | person = fast_create(Person) |
93 | private_community = fast_create(Community, :public_profile => false) | 93 | private_community = fast_create(Community, :public_profile => false) |
94 | action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :target_id => private_community.id, :verb => 'create_article') | 94 | action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :target_id => private_community.id, :verb => 'create_article') |
95 | - assert !NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) | 95 | + refute NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) |
96 | p1, p2, m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) | 96 | p1, p2, m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) |
97 | fast_create(Friendship, :person_id => person.id, :friend_id => p1.id) | 97 | fast_create(Friendship, :person_id => person.id, :friend_id => p1.id) |
98 | fast_create(Friendship, :person_id => person.id, :friend_id => p2.id) | 98 | fast_create(Friendship, :person_id => person.id, :friend_id => p2.id) |
@@ -117,7 +117,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase | @@ -117,7 +117,7 @@ class NotifyActivityToProfilesJobTest < ActiveSupport::TestCase | ||
117 | person = fast_create(Person) | 117 | person = fast_create(Person) |
118 | community = fast_create(Community) | 118 | community = fast_create(Community) |
119 | action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :target_id => community.id, :verb => 'join_community') | 119 | action_tracker = fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person.id, :target_type => 'Profile', :target_id => community.id, :verb => 'join_community') |
120 | - assert !NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) | 120 | + refute NotifyActivityToProfilesJob::NOTIFY_ONLY_COMMUNITY.include?(action_tracker.verb) |
121 | p1, p2, m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) | 121 | p1, p2, m1, m2 = fast_create(Person), fast_create(Person), fast_create(Person), fast_create(Person) |
122 | fast_create(Friendship, :person_id => person.id, :friend_id => p1.id) | 122 | fast_create(Friendship, :person_id => person.id, :friend_id => p1.id) |
123 | fast_create(Friendship, :person_id => person.id, :friend_id => p2.id) | 123 | fast_create(Friendship, :person_id => person.id, :friend_id => p2.id) |
test/unit/organization_mailing_test.rb
@@ -22,7 +22,7 @@ class OrganizationMailingTest < ActiveSupport::TestCase | @@ -22,7 +22,7 @@ class OrganizationMailingTest < ActiveSupport::TestCase | ||
22 | 22 | ||
23 | mailing.source_id = community.id | 23 | mailing.source_id = community.id |
24 | mailing.valid? | 24 | mailing.valid? |
25 | - assert !mailing.errors[:source_id.to_s].present? | 25 | + refute mailing.errors[:source_id.to_s].present? |
26 | end | 26 | end |
27 | 27 | ||
28 | should 'return community name' do | 28 | should 'return community name' do |
@@ -115,7 +115,7 @@ class OrganizationMailingTest < ActiveSupport::TestCase | @@ -115,7 +115,7 @@ class OrganizationMailingTest < ActiveSupport::TestCase | ||
115 | mailing = create(OrganizationMailing, :source => community, :subject => 'Hello', :body => 'We have some news', :person => person) | 115 | mailing = create(OrganizationMailing, :source => community, :subject => 'Hello', :body => 'We have some news', :person => person) |
116 | process_delayed_job_queue | 116 | process_delayed_job_queue |
117 | 117 | ||
118 | - assert !mailing.mailing_sents.find_by_person_id(recipient.id) | 118 | + refute mailing.mailing_sents.find_by_person_id(recipient.id) |
119 | end | 119 | end |
120 | 120 | ||
121 | protected | 121 | protected |
test/unit/organization_test.rb
@@ -80,11 +80,11 @@ class OrganizationTest < ActiveSupport::TestCase | @@ -80,11 +80,11 @@ class OrganizationTest < ActiveSupport::TestCase | ||
80 | should 'validate contact_email if filled' do | 80 | should 'validate contact_email if filled' do |
81 | org = Organization.new | 81 | org = Organization.new |
82 | org.valid? | 82 | org.valid? |
83 | - assert !org.errors[:contact_email.to_s].present? | 83 | + refute org.errors[:contact_email.to_s].present? |
84 | 84 | ||
85 | org.contact_email = '' | 85 | org.contact_email = '' |
86 | org.valid? | 86 | org.valid? |
87 | - assert !org.errors[:contact_email.to_s].present? | 87 | + refute org.errors[:contact_email.to_s].present? |
88 | 88 | ||
89 | 89 | ||
90 | org.contact_email = 'invalid-email' | 90 | org.contact_email = 'invalid-email' |
@@ -93,7 +93,7 @@ class OrganizationTest < ActiveSupport::TestCase | @@ -93,7 +93,7 @@ class OrganizationTest < ActiveSupport::TestCase | ||
93 | 93 | ||
94 | org.contact_email = 'someone@somedomain.com' | 94 | org.contact_email = 'someone@somedomain.com' |
95 | org.valid? | 95 | org.valid? |
96 | - assert !org.errors[:contact_email.to_s].present? | 96 | + refute org.errors[:contact_email.to_s].present? |
97 | end | 97 | end |
98 | 98 | ||
99 | should 'list contact_email plus admin emails as "notification emails"' do | 99 | should 'list contact_email plus admin emails as "notification emails"' do |
@@ -191,7 +191,7 @@ class OrganizationTest < ActiveSupport::TestCase | @@ -191,7 +191,7 @@ class OrganizationTest < ActiveSupport::TestCase | ||
191 | 191 | ||
192 | org.foundation_year = 2007 | 192 | org.foundation_year = 2007 |
193 | org.valid? | 193 | org.valid? |
194 | - assert ! org.errors[:foundation_year.to_s].present? | 194 | + refute org.errors[:foundation_year.to_s].present? |
195 | end | 195 | end |
196 | 196 | ||
197 | should 'has closed' do | 197 | should 'has closed' do |
@@ -245,7 +245,7 @@ class OrganizationTest < ActiveSupport::TestCase | @@ -245,7 +245,7 @@ class OrganizationTest < ActiveSupport::TestCase | ||
245 | 245 | ||
246 | should 'be closed if organization is not public' do | 246 | should 'be closed if organization is not public' do |
247 | organization = fast_create(Organization) | 247 | organization = fast_create(Organization) |
248 | - assert !organization.closed | 248 | + refute organization.closed |
249 | 249 | ||
250 | organization.public_profile = false | 250 | organization.public_profile = false |
251 | organization.save! | 251 | organization.save! |
@@ -278,11 +278,11 @@ class OrganizationTest < ActiveSupport::TestCase | @@ -278,11 +278,11 @@ class OrganizationTest < ActiveSupport::TestCase | ||
278 | p2 = fast_create(Person) | 278 | p2 = fast_create(Person) |
279 | p3 = fast_create(Person) | 279 | p3 = fast_create(Person) |
280 | 280 | ||
281 | - assert !p1.is_member_of?(o) | 281 | + refute p1.is_member_of?(o) |
282 | o.add_member(p1) | 282 | o.add_member(p1) |
283 | assert p1.is_member_of?(o) | 283 | assert p1.is_member_of?(o) |
284 | 284 | ||
285 | - assert !p3.is_member_of?(o) | 285 | + refute p3.is_member_of?(o) |
286 | o.add_member(p3) | 286 | o.add_member(p3) |
287 | assert p3.is_member_of?(o) | 287 | assert p3.is_member_of?(o) |
288 | 288 | ||
@@ -380,7 +380,7 @@ class OrganizationTest < ActiveSupport::TestCase | @@ -380,7 +380,7 @@ class OrganizationTest < ActiveSupport::TestCase | ||
380 | 380 | ||
381 | organization.cnpj = '94.132.024/0001-48' | 381 | organization.cnpj = '94.132.024/0001-48' |
382 | organization.valid? | 382 | organization.valid? |
383 | - assert !organization.errors[:cnpj.to_s].present? | 383 | + refute organization.errors[:cnpj.to_s].present? |
384 | end | 384 | end |
385 | 385 | ||
386 | should 'get members by role' do | 386 | should 'get members by role' do |
@@ -429,7 +429,7 @@ class OrganizationTest < ActiveSupport::TestCase | @@ -429,7 +429,7 @@ class OrganizationTest < ActiveSupport::TestCase | ||
429 | assert organization.visible | 429 | assert organization.visible |
430 | 430 | ||
431 | organization.disable | 431 | organization.disable |
432 | - assert !organization.visible | 432 | + refute organization.visible |
433 | end | 433 | end |
434 | 434 | ||
435 | should 'increase members_count on new membership' do | 435 | should 'increase members_count on new membership' do |
@@ -467,14 +467,14 @@ class OrganizationTest < ActiveSupport::TestCase | @@ -467,14 +467,14 @@ class OrganizationTest < ActiveSupport::TestCase | ||
467 | 467 | ||
468 | member = create_user('memberuser').person | 468 | member = create_user('memberuser').person |
469 | c.add_member(member) | 469 | c.add_member(member) |
470 | - assert !c.is_admin?(member) | 470 | + refute c.is_admin?(member) |
471 | end | 471 | end |
472 | 472 | ||
473 | should 'a moderator user not be a community admin' do | 473 | should 'a moderator user not be a community admin' do |
474 | c = fast_create(Organization, :name => 'my test profile', :identifier => 'mytestprofile') | 474 | c = fast_create(Organization, :name => 'my test profile', :identifier => 'mytestprofile') |
475 | moderator = create_user('moderatoruser').person | 475 | moderator = create_user('moderatoruser').person |
476 | c.add_moderator(moderator) | 476 | c.add_moderator(moderator) |
477 | - assert !c.is_admin?(moderator) | 477 | + refute c.is_admin?(moderator) |
478 | end | 478 | end |
479 | 479 | ||
480 | end | 480 | end |
test/unit/person_notifier_test.rb
@@ -184,11 +184,11 @@ class PersonNotifierTest < ActiveSupport::TestCase | @@ -184,11 +184,11 @@ class PersonNotifierTest < ActiveSupport::TestCase | ||
184 | 184 | ||
185 | should 'exists? method in NotifyAllJob return false if there is no instance of this class created' do | 185 | should 'exists? method in NotifyAllJob return false if there is no instance of this class created' do |
186 | Delayed::Job.enqueue(PersonNotifier::NotifyJob.new) | 186 | Delayed::Job.enqueue(PersonNotifier::NotifyJob.new) |
187 | - assert !PersonNotifier::NotifyAllJob.exists? | 187 | + refute PersonNotifier::NotifyAllJob.exists? |
188 | end | 188 | end |
189 | 189 | ||
190 | should 'exists? method in NotifyAllJob return false if there is no jobs created' do | 190 | should 'exists? method in NotifyAllJob return false if there is no jobs created' do |
191 | - assert !PersonNotifier::NotifyAllJob.exists? | 191 | + refute PersonNotifier::NotifyAllJob.exists? |
192 | end | 192 | end |
193 | 193 | ||
194 | should 'exists? method in NotifyAllJob return true if there is at least one instance of this class' do | 194 | should 'exists? method in NotifyAllJob return true if there is at least one instance of this class' do |
@@ -222,7 +222,7 @@ class PersonNotifierTest < ActiveSupport::TestCase | @@ -222,7 +222,7 @@ class PersonNotifierTest < ActiveSupport::TestCase | ||
222 | 222 | ||
223 | process_delayed_job_queue | 223 | process_delayed_job_queue |
224 | jobs = PersonNotifier::NotifyJob.find(@member.id) | 224 | jobs = PersonNotifier::NotifyJob.find(@member.id) |
225 | - assert !jobs.select {|j| !j.failed? && j.last_error.nil? }.empty? | 225 | + refute jobs.select {|j| !j.failed? && j.last_error.nil? }.empty? |
226 | end | 226 | end |
227 | 227 | ||
228 | should 'render image tags for both internal and external src' do | 228 | should 'render image tags for both internal and external src' do |
test/unit/person_test.rb
@@ -6,9 +6,9 @@ class PersonTest < ActiveSupport::TestCase | @@ -6,9 +6,9 @@ class PersonTest < ActiveSupport::TestCase | ||
6 | 6 | ||
7 | def test_person_must_come_from_the_creation_of_an_user | 7 | def test_person_must_come_from_the_creation_of_an_user |
8 | p = build(Person, :environment => Environment.default, :name => 'John', :identifier => 'john') | 8 | p = build(Person, :environment => Environment.default, :name => 'John', :identifier => 'john') |
9 | - assert !p.valid? | 9 | + refute p.valid? |
10 | p.user = create_user('john', :email => 'john@doe.org', :password => 'dhoe', :password_confirmation => 'dhoe') | 10 | p.user = create_user('john', :email => 'john@doe.org', :password => 'dhoe', :password_confirmation => 'dhoe') |
11 | - assert !p.valid? | 11 | + refute p.valid? |
12 | p = create_user('johnz', :email => 'johnz@doe.org', :password => 'dhoe', :password_confirmation => 'dhoe').person | 12 | p = create_user('johnz', :email => 'johnz@doe.org', :password => 'dhoe', :password_confirmation => 'dhoe').person |
13 | assert p.valid? | 13 | assert p.valid? |
14 | end | 14 | end |
@@ -59,7 +59,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -59,7 +59,7 @@ class PersonTest < ActiveSupport::TestCase | ||
59 | 59 | ||
60 | p2 = build(Person, :environment => Environment.default) | 60 | p2 = build(Person, :environment => Environment.default) |
61 | p2.user = u | 61 | p2.user = u |
62 | - assert !p2.valid? | 62 | + refute p2.valid? |
63 | assert p2.errors[:user_id.to_s].present? | 63 | assert p2.errors[:user_id.to_s].present? |
64 | end | 64 | end |
65 | 65 | ||
@@ -86,7 +86,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -86,7 +86,7 @@ class PersonTest < ActiveSupport::TestCase | ||
86 | assert p.define_roles([r2], e) | 86 | assert p.define_roles([r2], e) |
87 | p = Person.find(p.id) | 87 | p = Person.find(p.id) |
88 | assert p.role_assignments.any? {|ra| ra.role == r2} | 88 | assert p.role_assignments.any? {|ra| ra.role == r2} |
89 | - assert !p.role_assignments.any? {|ra| ra.role == r1} | 89 | + refute p.role_assignments.any? {|ra| ra.role == r1} |
90 | end | 90 | end |
91 | 91 | ||
92 | should 'report that the user has the permission' do | 92 | should 'report that the user has the permission' do |
@@ -97,7 +97,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -97,7 +97,7 @@ class PersonTest < ActiveSupport::TestCase | ||
97 | p = Person.find(p.id) | 97 | p = Person.find(p.id) |
98 | assert e.reload | 98 | assert e.reload |
99 | assert p.has_permission?('edit_profile', e) | 99 | assert p.has_permission?('edit_profile', e) |
100 | - assert !p.has_permission?('destroy_profile', e) | 100 | + refute p.has_permission?('destroy_profile', e) |
101 | end | 101 | end |
102 | 102 | ||
103 | should 'get an email address from the associated user instance' do | 103 | should 'get an email address from the associated user instance' do |
@@ -144,7 +144,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -144,7 +144,7 @@ class PersonTest < ActiveSupport::TestCase | ||
144 | other = create_user('user', :email => 'other@example.com', :environment => other_env).person | 144 | other = create_user('user', :email => 'other@example.com', :environment => other_env).person |
145 | other.email = 'user@example.com' | 145 | other.email = 'user@example.com' |
146 | other.valid? | 146 | other.valid? |
147 | - assert !other.errors[:email.to_s].present? | 147 | + refute other.errors[:email.to_s].present? |
148 | end | 148 | end |
149 | 149 | ||
150 | should 'be an admin if have permission of environment administration' do | 150 | should 'be an admin if have permission of environment administration' do |
@@ -152,7 +152,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -152,7 +152,7 @@ class PersonTest < ActiveSupport::TestCase | ||
152 | env = fast_create(Environment) | 152 | env = fast_create(Environment) |
153 | person = create_user('just_another_person').person | 153 | person = create_user('just_another_person').person |
154 | env.affiliate(person, role) | 154 | env.affiliate(person, role) |
155 | - assert ! person.is_admin?(env) | 155 | + refute person.is_admin?(env) |
156 | role.update_attributes(:permissions => ['view_environment_admin_panel']) | 156 | role.update_attributes(:permissions => ['view_environment_admin_panel']) |
157 | person = Person.find(person.id) | 157 | person = Person.find(person.id) |
158 | assert person.is_admin?(env) | 158 | assert person.is_admin?(env) |
@@ -172,7 +172,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -172,7 +172,7 @@ class PersonTest < ActiveSupport::TestCase | ||
172 | 172 | ||
173 | person = Person.find(person.id) | 173 | person = Person.find(person.id) |
174 | assert person.is_admin?(env1) | 174 | assert person.is_admin?(env1) |
175 | - assert !person.is_admin?(env2) | 175 | + refute person.is_admin?(env2) |
176 | end | 176 | end |
177 | 177 | ||
178 | should 'create a default set of articles' do | 178 | should 'create a default set of articles' do |
@@ -187,9 +187,9 @@ class PersonTest < ActiveSupport::TestCase | @@ -187,9 +187,9 @@ class PersonTest < ActiveSupport::TestCase | ||
187 | should 'create a default set of blocks' do | 187 | should 'create a default set of blocks' do |
188 | p = create(User).person | 188 | p = create(User).person |
189 | 189 | ||
190 | - assert !p.boxes[0].blocks.empty?, 'person must have blocks in area 1' | ||
191 | - assert !p.boxes[1].blocks.empty?, 'person must have blocks in area 2' | ||
192 | - assert !p.boxes[2].blocks.empty?, 'person must have blocks in area 3' | 190 | + refute p.boxes[0].blocks.empty?, 'person must have blocks in area 1' |
191 | + refute p.boxes[1].blocks.empty?, 'person must have blocks in area 2' | ||
192 | + refute p.boxes[2].blocks.empty?, 'person must have blocks in area 3' | ||
193 | end | 193 | end |
194 | 194 | ||
195 | should 'link to all articles created by default' do | 195 | should 'link to all articles created by default' do |
@@ -317,7 +317,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -317,7 +317,7 @@ class PersonTest < ActiveSupport::TestCase | ||
317 | 317 | ||
318 | should 'required name' do | 318 | should 'required name' do |
319 | person = Person.new | 319 | person = Person.new |
320 | - assert !person.valid? | 320 | + refute person.valid? |
321 | assert person.errors[:name].present? | 321 | assert person.errors[:name].present? |
322 | end | 322 | end |
323 | 323 | ||
@@ -325,7 +325,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -325,7 +325,7 @@ class PersonTest < ActiveSupport::TestCase | ||
325 | p1 = create_user('testuser1').person | 325 | p1 = create_user('testuser1').person |
326 | p2 = create_user('testuser2').person | 326 | p2 = create_user('testuser2').person |
327 | create(AddFriend, person: p1, friend: p2).finish | 327 | create(AddFriend, person: p1, friend: p2).finish |
328 | - assert !p1.already_request_friendship?(p2) | 328 | + refute p1.already_request_friendship?(p2) |
329 | create(AddFriend, person: p1, friend: p2) | 329 | create(AddFriend, person: p1, friend: p2) |
330 | assert p1.already_request_friendship?(p2) | 330 | assert p1.already_request_friendship?(p2) |
331 | end | 331 | end |
@@ -394,7 +394,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -394,7 +394,7 @@ class PersonTest < ActiveSupport::TestCase | ||
394 | p1 = create_user('user_with_tasks').person | 394 | p1 = create_user('user_with_tasks').person |
395 | c1 = fast_create(Community) | 395 | c1 = fast_create(Community) |
396 | c1.tasks << Task.new | 396 | c1.tasks << Task.new |
397 | - assert !c1.tasks.pending.empty? | 397 | + refute c1.tasks.pending.empty? |
398 | c1.add_admin(p1) | 398 | c1.add_admin(p1) |
399 | 399 | ||
400 | c2 = fast_create(Community) | 400 | c2 = fast_create(Community) |
@@ -463,12 +463,12 @@ class PersonTest < ActiveSupport::TestCase | @@ -463,12 +463,12 @@ class PersonTest < ActiveSupport::TestCase | ||
463 | e = Environment.default | 463 | e = Environment.default |
464 | e.expects(:required_person_fields).returns(['cell_phone']).at_least_once | 464 | e.expects(:required_person_fields).returns(['cell_phone']).at_least_once |
465 | person = build(Person, :environment => e) | 465 | person = build(Person, :environment => e) |
466 | - assert ! person.valid? | 466 | + refute person.valid? |
467 | assert person.errors[:cell_phone.to_s].present? | 467 | assert person.errors[:cell_phone.to_s].present? |
468 | 468 | ||
469 | person.cell_phone = '99999' | 469 | person.cell_phone = '99999' |
470 | person.valid? | 470 | person.valid? |
471 | - assert ! person.errors[:cell_phone.to_s].present? | 471 | + refute person.errors[:cell_phone.to_s].present? |
472 | end | 472 | end |
473 | 473 | ||
474 | should 'require custom_area_of_study if area_of_study is others' do | 474 | should 'require custom_area_of_study if area_of_study is others' do |
@@ -476,12 +476,12 @@ class PersonTest < ActiveSupport::TestCase | @@ -476,12 +476,12 @@ class PersonTest < ActiveSupport::TestCase | ||
476 | e.expects(:required_person_fields).returns(['area_of_study', 'custom_area_of_study']).at_least_once | 476 | e.expects(:required_person_fields).returns(['area_of_study', 'custom_area_of_study']).at_least_once |
477 | 477 | ||
478 | person = build(Person, :environment => e, :area_of_study => 'Others') | 478 | person = build(Person, :environment => e, :area_of_study => 'Others') |
479 | - assert !person.valid? | 479 | + refute person.valid? |
480 | assert person.errors[:custom_area_of_study.to_s].present? | 480 | assert person.errors[:custom_area_of_study.to_s].present? |
481 | 481 | ||
482 | person.custom_area_of_study = 'Customized area of study' | 482 | person.custom_area_of_study = 'Customized area of study' |
483 | person.valid? | 483 | person.valid? |
484 | - assert ! person.errors[:custom_area_of_study.to_s].present? | 484 | + refute person.errors[:custom_area_of_study.to_s].present? |
485 | end | 485 | end |
486 | 486 | ||
487 | should 'not require custom_area_of_study if area_of_study is not others' do | 487 | should 'not require custom_area_of_study if area_of_study is not others' do |
@@ -490,7 +490,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -490,7 +490,7 @@ class PersonTest < ActiveSupport::TestCase | ||
490 | 490 | ||
491 | person = build(Person, :environment => e, :area_of_study => 'Agrometeorology') | 491 | person = build(Person, :environment => e, :area_of_study => 'Agrometeorology') |
492 | person.valid? | 492 | person.valid? |
493 | - assert ! person.errors[:custom_area_of_study.to_s].present? | 493 | + refute person.errors[:custom_area_of_study.to_s].present? |
494 | end | 494 | end |
495 | 495 | ||
496 | should 'require custom_formation if formation is others' do | 496 | should 'require custom_formation if formation is others' do |
@@ -498,12 +498,12 @@ class PersonTest < ActiveSupport::TestCase | @@ -498,12 +498,12 @@ class PersonTest < ActiveSupport::TestCase | ||
498 | e.expects(:required_person_fields).returns(['formation', 'custom_formation']).at_least_once | 498 | e.expects(:required_person_fields).returns(['formation', 'custom_formation']).at_least_once |
499 | 499 | ||
500 | person = build(Person, :environment => e, :formation => 'Others') | 500 | person = build(Person, :environment => e, :formation => 'Others') |
501 | - assert !person.valid? | 501 | + refute person.valid? |
502 | assert person.errors[:custom_formation.to_s].present? | 502 | assert person.errors[:custom_formation.to_s].present? |
503 | 503 | ||
504 | person.custom_formation = 'Customized formation' | 504 | person.custom_formation = 'Customized formation' |
505 | person.valid? | 505 | person.valid? |
506 | - assert ! person.errors[:custom_formation.to_s].present? | 506 | + refute person.errors[:custom_formation.to_s].present? |
507 | end | 507 | end |
508 | 508 | ||
509 | should 'not require custom_formation if formation is not others' do | 509 | should 'not require custom_formation if formation is not others' do |
@@ -511,20 +511,20 @@ class PersonTest < ActiveSupport::TestCase | @@ -511,20 +511,20 @@ class PersonTest < ActiveSupport::TestCase | ||
511 | e.expects(:required_person_fields).returns(['formation']).at_least_once | 511 | e.expects(:required_person_fields).returns(['formation']).at_least_once |
512 | 512 | ||
513 | person = build(Person, :environment => e, :formation => 'Agrometeorology') | 513 | person = build(Person, :environment => e, :formation => 'Agrometeorology') |
514 | - assert !person.valid? | ||
515 | - assert ! person.errors[:custom_formation.to_s].present? | 514 | + refute person.valid? |
515 | + refute person.errors[:custom_formation.to_s].present? | ||
516 | end | 516 | end |
517 | 517 | ||
518 | should 'not require fields if person is a template' do | 518 | should 'not require fields if person is a template' do |
519 | e = Environment.default | 519 | e = Environment.default |
520 | e.expects(:required_person_fields).returns(['cell_phone']).at_least_once | 520 | e.expects(:required_person_fields).returns(['cell_phone']).at_least_once |
521 | person = build(Person, :environment => e) | 521 | person = build(Person, :environment => e) |
522 | - assert ! person.valid? | 522 | + refute person.valid? |
523 | assert person.errors[:cell_phone.to_s].present? | 523 | assert person.errors[:cell_phone.to_s].present? |
524 | 524 | ||
525 | person.is_template = true | 525 | person.is_template = true |
526 | person.valid? | 526 | person.valid? |
527 | - assert ! person.errors[:cell_phone.to_s].present? | 527 | + refute person.errors[:cell_phone.to_s].present? |
528 | end | 528 | end |
529 | 529 | ||
530 | should 'identify when person is a friend' do | 530 | should 'identify when person is a friend' do |
@@ -538,7 +538,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -538,7 +538,7 @@ class PersonTest < ActiveSupport::TestCase | ||
538 | should 'identify when person isnt a friend' do | 538 | should 'identify when person isnt a friend' do |
539 | p1 = create_user('testuser1').person | 539 | p1 = create_user('testuser1').person |
540 | p2 = create_user('testuser2').person | 540 | p2 = create_user('testuser2').person |
541 | - assert !p1.is_a_friend?(p2) | 541 | + refute p1.is_a_friend?(p2) |
542 | end | 542 | end |
543 | 543 | ||
544 | should 'refuse join community' do | 544 | should 'refuse join community' do |
@@ -547,7 +547,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -547,7 +547,7 @@ class PersonTest < ActiveSupport::TestCase | ||
547 | 547 | ||
548 | assert p.ask_to_join?(c) | 548 | assert p.ask_to_join?(c) |
549 | p.refuse_join(c) | 549 | p.refuse_join(c) |
550 | - assert !p.ask_to_join?(c) | 550 | + refute p.ask_to_join?(c) |
551 | end | 551 | end |
552 | 552 | ||
553 | should 'not ask to join for a member' do | 553 | should 'not ask to join for a member' do |
@@ -555,7 +555,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -555,7 +555,7 @@ class PersonTest < ActiveSupport::TestCase | ||
555 | c = fast_create(Community) | 555 | c = fast_create(Community) |
556 | c.add_member(p) | 556 | c.add_member(p) |
557 | 557 | ||
558 | - assert !p.ask_to_join?(c) | 558 | + refute p.ask_to_join?(c) |
559 | end | 559 | end |
560 | 560 | ||
561 | should 'not ask to join if already asked' do | 561 | should 'not ask to join if already asked' do |
@@ -563,7 +563,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -563,7 +563,7 @@ class PersonTest < ActiveSupport::TestCase | ||
563 | c = fast_create(Community) | 563 | c = fast_create(Community) |
564 | create(AddMember, :person => p, :organization => c) | 564 | create(AddMember, :person => p, :organization => c) |
565 | 565 | ||
566 | - assert !p.ask_to_join?(c) | 566 | + refute p.ask_to_join?(c) |
567 | end | 567 | end |
568 | 568 | ||
569 | should 'ask to join if community is not public' do | 569 | should 'ask to join if community is not public' do |
@@ -577,7 +577,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -577,7 +577,7 @@ class PersonTest < ActiveSupport::TestCase | ||
577 | person = fast_create(Person) | 577 | person = fast_create(Person) |
578 | community = fast_create(Community, :visible => false) | 578 | community = fast_create(Community, :visible => false) |
579 | 579 | ||
580 | - assert !person.ask_to_join?(community) | 580 | + refute person.ask_to_join?(community) |
581 | end | 581 | end |
582 | 582 | ||
583 | should 'save organization_website with http' do | 583 | should 'save organization_website with http' do |
@@ -606,7 +606,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -606,7 +606,7 @@ class PersonTest < ActiveSupport::TestCase | ||
606 | p2 = create_user('testuser2').person | 606 | p2 = create_user('testuser2').person |
607 | assert p1.add_friend(p2) | 607 | assert p1.add_friend(p2) |
608 | assert Profile['testuser1'].is_a_friend?(p2) | 608 | assert Profile['testuser1'].is_a_friend?(p2) |
609 | - assert !Profile['testuser1'].add_friend(p2) | 609 | + refute Profile['testuser1'].add_friend(p2) |
610 | end | 610 | end |
611 | 611 | ||
612 | should 'not raise exception when validates person without e-mail' do | 612 | should 'not raise exception when validates person without e-mail' do |
@@ -614,7 +614,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -614,7 +614,7 @@ class PersonTest < ActiveSupport::TestCase | ||
614 | person.user.email = nil | 614 | person.user.email = nil |
615 | 615 | ||
616 | assert_nothing_raised ActiveRecord::RecordInvalid do | 616 | assert_nothing_raised ActiveRecord::RecordInvalid do |
617 | - assert !person.save | 617 | + refute person.save |
618 | end | 618 | end |
619 | end | 619 | end |
620 | 620 | ||
@@ -766,11 +766,11 @@ class PersonTest < ActiveSupport::TestCase | @@ -766,11 +766,11 @@ class PersonTest < ActiveSupport::TestCase | ||
766 | p2 = fast_create(Person) | 766 | p2 = fast_create(Person) |
767 | p3 = fast_create(Person) | 767 | p3 = fast_create(Person) |
768 | 768 | ||
769 | - assert !p1.is_member_of?(c) | 769 | + refute p1.is_member_of?(c) |
770 | c.add_member(p1) | 770 | c.add_member(p1) |
771 | assert p1.is_member_of?(c) | 771 | assert p1.is_member_of?(c) |
772 | 772 | ||
773 | - assert !p3.is_member_of?(c) | 773 | + refute p3.is_member_of?(c) |
774 | c.add_member(p3) | 774 | c.add_member(p3) |
775 | assert p3.is_member_of?(c) | 775 | assert p3.is_member_of?(c) |
776 | 776 | ||
@@ -786,11 +786,11 @@ class PersonTest < ActiveSupport::TestCase | @@ -786,11 +786,11 @@ class PersonTest < ActiveSupport::TestCase | ||
786 | p2 = fast_create(Person) | 786 | p2 = fast_create(Person) |
787 | p3 = fast_create(Person) | 787 | p3 = fast_create(Person) |
788 | 788 | ||
789 | - assert !p1.is_member_of?(e) | 789 | + refute p1.is_member_of?(e) |
790 | e.add_member(p1) | 790 | e.add_member(p1) |
791 | assert p1.is_member_of?(e) | 791 | assert p1.is_member_of?(e) |
792 | 792 | ||
793 | - assert !p3.is_member_of?(e) | 793 | + refute p3.is_member_of?(e) |
794 | e.add_member(p3) | 794 | e.add_member(p3) |
795 | assert p3.is_member_of?(e) | 795 | assert p3.is_member_of?(e) |
796 | 796 | ||
@@ -843,7 +843,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -843,7 +843,7 @@ class PersonTest < ActiveSupport::TestCase | ||
843 | 843 | ||
844 | p1.add_friend(p2) | 844 | p1.add_friend(p2) |
845 | assert p1.is_a_friend?(p2) | 845 | assert p1.is_a_friend?(p2) |
846 | - assert !p1.is_a_friend?(p3) | 846 | + refute p1.is_a_friend?(p3) |
847 | p1.add_friend(p4) | 847 | p1.add_friend(p4) |
848 | assert p1.is_a_friend?(p4) | 848 | assert p1.is_a_friend?(p4) |
849 | 849 | ||
@@ -867,7 +867,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -867,7 +867,7 @@ class PersonTest < ActiveSupport::TestCase | ||
867 | 867 | ||
868 | p1.add_friend(p2) | 868 | p1.add_friend(p2) |
869 | assert p1.is_a_friend?(p2) | 869 | assert p1.is_a_friend?(p2) |
870 | - assert !p1.is_a_friend?(p3) | 870 | + refute p1.is_a_friend?(p3) |
871 | p1.add_friend(p4) | 871 | p1.add_friend(p4) |
872 | assert p1.is_a_friend?(p4) | 872 | assert p1.is_a_friend?(p4) |
873 | 873 | ||
@@ -886,7 +886,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -886,7 +886,7 @@ class PersonTest < ActiveSupport::TestCase | ||
886 | 886 | ||
887 | p1.add_friend(p2) | 887 | p1.add_friend(p2) |
888 | assert p1.is_a_friend?(p2) | 888 | assert p1.is_a_friend?(p2) |
889 | - assert !p1.is_a_friend?(p3) | 889 | + refute p1.is_a_friend?(p3) |
890 | p1.add_friend(p4) | 890 | p1.add_friend(p4) |
891 | assert p1.is_a_friend?(p4) | 891 | assert p1.is_a_friend?(p4) |
892 | 892 | ||
@@ -913,7 +913,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -913,7 +913,7 @@ class PersonTest < ActiveSupport::TestCase | ||
913 | assert p1.is_member_of?(community) | 913 | assert p1.is_member_of?(community) |
914 | community.add_member(p3) | 914 | community.add_member(p3) |
915 | assert p3.is_member_of?(community) | 915 | assert p3.is_member_of?(community) |
916 | - assert !p2.is_member_of?(community) | 916 | + refute p2.is_member_of?(community) |
917 | process_delayed_job_queue | 917 | process_delayed_job_queue |
918 | 918 | ||
919 | action_tracker = fast_create(ActionTracker::Record, :verb => 'create_article') | 919 | action_tracker = fast_create(ActionTracker::Record, :verb => 'create_article') |
@@ -943,7 +943,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -943,7 +943,7 @@ class PersonTest < ActiveSupport::TestCase | ||
943 | assert p3.is_member_of?(community) | 943 | assert p3.is_member_of?(community) |
944 | community.add_member(p4) | 944 | community.add_member(p4) |
945 | assert p4.is_member_of?(community) | 945 | assert p4.is_member_of?(community) |
946 | - assert !p2.is_member_of?(community) | 946 | + refute p2.is_member_of?(community) |
947 | 947 | ||
948 | action_tracker = fast_create(ActionTracker::Record) | 948 | action_tracker = fast_create(ActionTracker::Record) |
949 | article = mock() | 949 | article = mock() |
@@ -990,14 +990,14 @@ class PersonTest < ActiveSupport::TestCase | @@ -990,14 +990,14 @@ class PersonTest < ActiveSupport::TestCase | ||
990 | p1, p2 = fast_create(Person), fast_create(Person) | 990 | p1, p2 = fast_create(Person), fast_create(Person) |
991 | s = fast_create(Scrap, :sender_id => p1.id, :receiver_id => p1.id) | 991 | s = fast_create(Scrap, :sender_id => p1.id, :receiver_id => p1.id) |
992 | assert p1.can_control_scrap?(s) | 992 | assert p1.can_control_scrap?(s) |
993 | - assert !p2.can_control_scrap?(s) | 993 | + refute p2.can_control_scrap?(s) |
994 | end | 994 | end |
995 | 995 | ||
996 | should "control activity or not" do | 996 | should "control activity or not" do |
997 | p1, p2 = fast_create(Person), fast_create(Person) | 997 | p1, p2 = fast_create(Person), fast_create(Person) |
998 | a = fast_create(ActionTracker::Record, :user_id => p2.id) | 998 | a = fast_create(ActionTracker::Record, :user_id => p2.id) |
999 | n = fast_create(ActionTrackerNotification, :profile_id => p2.id, :action_tracker_id => a.id) | 999 | n = fast_create(ActionTrackerNotification, :profile_id => p2.id, :action_tracker_id => a.id) |
1000 | - assert !p1.reload.can_control_activity?(a) | 1000 | + refute p1.reload.can_control_activity?(a) |
1001 | assert p2.reload.can_control_activity?(a) | 1001 | assert p2.reload.can_control_activity?(a) |
1002 | end | 1002 | end |
1003 | 1003 | ||
@@ -1121,7 +1121,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -1121,7 +1121,7 @@ class PersonTest < ActiveSupport::TestCase | ||
1121 | organization.add_admin(person) | 1121 | organization.add_admin(person) |
1122 | 1122 | ||
1123 | assert person.is_last_admin_leaving?(organization, []) | 1123 | assert person.is_last_admin_leaving?(organization, []) |
1124 | - assert !person.is_last_admin_leaving?(organization, [Role.find_by_key('profile_admin')]) | 1124 | + refute person.is_last_admin_leaving?(organization, [Role.find_by_key('profile_admin')]) |
1125 | end | 1125 | end |
1126 | 1126 | ||
1127 | should 'return unique members of a community' do | 1127 | should 'return unique members of a community' do |
@@ -1226,7 +1226,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -1226,7 +1226,7 @@ class PersonTest < ActiveSupport::TestCase | ||
1226 | should 'check if person already reported profile' do | 1226 | should 'check if person already reported profile' do |
1227 | person = create_user('some-user').person | 1227 | person = create_user('some-user').person |
1228 | profile = fast_create(Profile) | 1228 | profile = fast_create(Profile) |
1229 | - assert !person.already_reported?(profile) | 1229 | + refute person.already_reported?(profile) |
1230 | 1230 | ||
1231 | person.register_report(build(AbuseReport, :reason => 'some reason'), profile) | 1231 | person.register_report(build(AbuseReport, :reason => 'some reason'), profile) |
1232 | person.reload | 1232 | person.reload |
@@ -1240,7 +1240,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -1240,7 +1240,7 @@ class PersonTest < ActiveSupport::TestCase | ||
1240 | 1240 | ||
1241 | person.disable | 1241 | person.disable |
1242 | 1242 | ||
1243 | - assert !person.visible | 1243 | + refute person.visible |
1244 | assert_not_equal password, person.user.password | 1244 | assert_not_equal password, person.user.password |
1245 | end | 1245 | end |
1246 | 1246 | ||
@@ -1334,7 +1334,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -1334,7 +1334,7 @@ class PersonTest < ActiveSupport::TestCase | ||
1334 | person = create_user('person').person | 1334 | person = create_user('person').person |
1335 | 1335 | ||
1336 | assert abuser.abuser? | 1336 | assert abuser.abuser? |
1337 | - assert !person.abuser? | 1337 | + refute person.abuser? |
1338 | end | 1338 | end |
1339 | 1339 | ||
1340 | should 'be able to retrieve abusers and non abusers' do | 1340 | should 'be able to retrieve abusers and non abusers' do |
@@ -1661,19 +1661,19 @@ class PersonTest < ActiveSupport::TestCase | @@ -1661,19 +1661,19 @@ class PersonTest < ActiveSupport::TestCase | ||
1661 | comment = fast_create(Comment) | 1661 | comment = fast_create(Comment) |
1662 | person = fast_create(Person) | 1662 | person = fast_create(Person) |
1663 | 1663 | ||
1664 | - assert !person.voted_for?(comment) | 1664 | + refute person.voted_for?(comment) |
1665 | person.vote_for(comment) | 1665 | person.vote_for(comment) |
1666 | assert person.voted_for?(comment) | 1666 | assert person.voted_for?(comment) |
1667 | - assert !person.voted_against?(comment) | 1667 | + refute person.voted_against?(comment) |
1668 | end | 1668 | end |
1669 | 1669 | ||
1670 | should 'vote against a comment' do | 1670 | should 'vote against a comment' do |
1671 | comment = fast_create(Comment) | 1671 | comment = fast_create(Comment) |
1672 | person = fast_create(Person) | 1672 | person = fast_create(Person) |
1673 | 1673 | ||
1674 | - assert !person.voted_against?(comment) | 1674 | + refute person.voted_against?(comment) |
1675 | person.vote_against(comment) | 1675 | person.vote_against(comment) |
1676 | - assert !person.voted_for?(comment) | 1676 | + refute person.voted_for?(comment) |
1677 | assert person.voted_against?(comment) | 1677 | assert person.voted_against?(comment) |
1678 | end | 1678 | end |
1679 | 1679 | ||
@@ -1682,7 +1682,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -1682,7 +1682,7 @@ class PersonTest < ActiveSupport::TestCase | ||
1682 | person = fast_create(Person) | 1682 | person = fast_create(Person) |
1683 | 1683 | ||
1684 | assert person.vote_against(comment) | 1684 | assert person.vote_against(comment) |
1685 | - assert !person.vote_against(comment) | 1685 | + refute person.vote_against(comment) |
1686 | end | 1686 | end |
1687 | 1687 | ||
1688 | should 'do not vote for a comment twice' do | 1688 | should 'do not vote for a comment twice' do |
@@ -1690,7 +1690,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -1690,7 +1690,7 @@ class PersonTest < ActiveSupport::TestCase | ||
1690 | person = fast_create(Person) | 1690 | person = fast_create(Person) |
1691 | 1691 | ||
1692 | assert person.vote_for(comment) | 1692 | assert person.vote_for(comment) |
1693 | - assert !person.vote_for(comment) | 1693 | + refute person.vote_for(comment) |
1694 | end | 1694 | end |
1695 | 1695 | ||
1696 | should 'not vote against a voted for comment' do | 1696 | should 'not vote against a voted for comment' do |
@@ -1700,7 +1700,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -1700,7 +1700,7 @@ class PersonTest < ActiveSupport::TestCase | ||
1700 | person.vote_for(comment) | 1700 | person.vote_for(comment) |
1701 | person.vote_against(comment) | 1701 | person.vote_against(comment) |
1702 | assert person.voted_for?(comment) | 1702 | assert person.voted_for?(comment) |
1703 | - assert !person.voted_against?(comment) | 1703 | + refute person.voted_against?(comment) |
1704 | end | 1704 | end |
1705 | 1705 | ||
1706 | should 'not vote for a voted against comment' do | 1706 | should 'not vote for a voted against comment' do |
@@ -1709,7 +1709,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -1709,7 +1709,7 @@ class PersonTest < ActiveSupport::TestCase | ||
1709 | 1709 | ||
1710 | person.vote_against(comment) | 1710 | person.vote_against(comment) |
1711 | person.vote_for(comment) | 1711 | person.vote_for(comment) |
1712 | - assert !person.voted_for?(comment) | 1712 | + refute person.voted_for?(comment) |
1713 | assert person.voted_against?(comment) | 1713 | assert person.voted_against?(comment) |
1714 | end | 1714 | end |
1715 | 1715 | ||
@@ -1720,7 +1720,7 @@ class PersonTest < ActiveSupport::TestCase | @@ -1720,7 +1720,7 @@ class PersonTest < ActiveSupport::TestCase | ||
1720 | person.vote_for(comment) | 1720 | person.vote_for(comment) |
1721 | assert person.voted_for?(comment) | 1721 | assert person.voted_for?(comment) |
1722 | person.votes.for_voteable(comment).destroy_all | 1722 | person.votes.for_voteable(comment).destroy_all |
1723 | - assert !person.voted_for?(comment) | 1723 | + refute person.voted_for?(comment) |
1724 | end | 1724 | end |
1725 | 1725 | ||
1726 | should 'count comments voted' do | 1726 | should 'count comments voted' do |
@@ -1751,19 +1751,19 @@ class PersonTest < ActiveSupport::TestCase | @@ -1751,19 +1751,19 @@ class PersonTest < ActiveSupport::TestCase | ||
1751 | article = fast_create(Article) | 1751 | article = fast_create(Article) |
1752 | person = fast_create(Person) | 1752 | person = fast_create(Person) |
1753 | 1753 | ||
1754 | - assert !person.voted_for?(article) | 1754 | + refute person.voted_for?(article) |
1755 | person.vote_for(article) | 1755 | person.vote_for(article) |
1756 | assert person.voted_for?(article) | 1756 | assert person.voted_for?(article) |
1757 | - assert !person.voted_against?(article) | 1757 | + refute person.voted_against?(article) |
1758 | end | 1758 | end |
1759 | 1759 | ||
1760 | should 'vote against a article' do | 1760 | should 'vote against a article' do |
1761 | article = fast_create(Article) | 1761 | article = fast_create(Article) |
1762 | person = fast_create(Person) | 1762 | person = fast_create(Person) |
1763 | 1763 | ||
1764 | - assert !person.voted_against?(article) | 1764 | + refute person.voted_against?(article) |
1765 | person.vote_against(article) | 1765 | person.vote_against(article) |
1766 | - assert !person.voted_for?(article) | 1766 | + refute person.voted_for?(article) |
1767 | assert person.voted_against?(article) | 1767 | assert person.voted_against?(article) |
1768 | end | 1768 | end |
1769 | 1769 |
test/unit/product_categories_block_test.rb
@@ -11,7 +11,7 @@ class ProductCategoriesBlockTest < ActiveSupport::TestCase | @@ -11,7 +11,7 @@ class ProductCategoriesBlockTest < ActiveSupport::TestCase | ||
11 | assert block.visible? | 11 | assert block.visible? |
12 | 12 | ||
13 | block.box.environment.disable('products_for_enterprises') | 13 | block.box.environment.disable('products_for_enterprises') |
14 | - assert !block.visible? | 14 | + refute block.visible? |
15 | end | 15 | end |
16 | 16 | ||
17 | should 'have display option to show only on catalog' do | 17 | should 'have display option to show only on catalog' do |
@@ -29,7 +29,7 @@ class ProductCategoriesBlockTest < ActiveSupport::TestCase | @@ -29,7 +29,7 @@ class ProductCategoriesBlockTest < ActiveSupport::TestCase | ||
29 | block.box = box | 29 | block.box = box |
30 | block.box.environment.enable('products_for_enterprises') | 30 | block.box.environment.enable('products_for_enterprises') |
31 | 31 | ||
32 | - assert !block.visible?(:params => {:controller => 'any_other'}) | 32 | + refute block.visible?(:params => {:controller => 'any_other'}) |
33 | assert block.visible?(:params => {:controller => 'catalog'}) | 33 | assert block.visible?(:params => {:controller => 'catalog'}) |
34 | end | 34 | end |
35 | end | 35 | end |
test/unit/product_test.rb
@@ -130,7 +130,7 @@ class ProductTest < ActiveSupport::TestCase | @@ -130,7 +130,7 @@ class ProductTest < ActiveSupport::TestCase | ||
130 | e1.public_profile = false | 130 | e1.public_profile = false |
131 | e1.save!; p1.reload; | 131 | e1.save!; p1.reload; |
132 | 132 | ||
133 | - assert !p1.public? | 133 | + refute p1.public? |
134 | end | 134 | end |
135 | 135 | ||
136 | should 'accept prices in american\'s or brazilian\'s currency format' do | 136 | should 'accept prices in american\'s or brazilian\'s currency format' do |
@@ -267,7 +267,7 @@ class ProductTest < ActiveSupport::TestCase | @@ -267,7 +267,7 @@ class ProductTest < ActiveSupport::TestCase | ||
267 | 267 | ||
268 | should 'has basic info if filled unit, price or discount' do | 268 | should 'has basic info if filled unit, price or discount' do |
269 | product = Product.new | 269 | product = Product.new |
270 | - assert !product.has_basic_info? | 270 | + refute product.has_basic_info? |
271 | 271 | ||
272 | product = build(Product, :unit => Unit.new) | 272 | product = build(Product, :unit => Unit.new) |
273 | assert product.has_basic_info? | 273 | assert product.has_basic_info? |
@@ -349,7 +349,7 @@ class ProductTest < ActiveSupport::TestCase | @@ -349,7 +349,7 @@ class ProductTest < ActiveSupport::TestCase | ||
349 | product = fast_create(Product, :price => 30.0) | 349 | product = fast_create(Product, :price => 30.0) |
350 | 350 | ||
351 | first = fast_create(Input, :product_id => product.id, :product_category_id => fast_create(ProductCategory).id, :price_per_unit => 20.0, :amount_used => 1) | 351 | first = fast_create(Input, :product_id => product.id, :product_category_id => fast_create(ProductCategory).id, :price_per_unit => 20.0, :amount_used => 1) |
352 | - assert !Product.find(product.id).price_described? | 352 | + refute Product.find(product.id).price_described? |
353 | 353 | ||
354 | second = fast_create(Input, :product_id => product.id, :product_category_id => fast_create(ProductCategory).id, :price_per_unit => 10.0, :amount_used => 1) | 354 | second = fast_create(Input, :product_id => product.id, :product_category_id => fast_create(ProductCategory).id, :price_per_unit => 10.0, :amount_used => 1) |
355 | assert Product.find(product.id).price_described? | 355 | assert Product.find(product.id).price_described? |
@@ -375,7 +375,7 @@ class ProductTest < ActiveSupport::TestCase | @@ -375,7 +375,7 @@ class ProductTest < ActiveSupport::TestCase | ||
375 | cost = fast_create(ProductionCost, :owner_id => Environment.default.id, :owner_type => 'Environment') | 375 | cost = fast_create(ProductionCost, :owner_id => Environment.default.id, :owner_type => 'Environment') |
376 | cost2 = fast_create(ProductionCost, :owner_id => Environment.default.id, :owner_type => 'Environment') | 376 | cost2 = fast_create(ProductionCost, :owner_id => Environment.default.id, :owner_type => 'Environment') |
377 | price_detail = product.price_details.create(:production_cost_id => cost.id, :price => 10) | 377 | price_detail = product.price_details.create(:production_cost_id => cost.id, :price => 10) |
378 | - assert !product.price_details.empty? | 378 | + refute product.price_details.empty? |
379 | 379 | ||
380 | product.update_price_details([{:production_cost_id => cost.id, :price => 20}, {:production_cost_id => cost2.id, :price => 30}]) | 380 | product.update_price_details([{:production_cost_id => cost.id, :price => 20}, {:production_cost_id => cost2.id, :price => 30}]) |
381 | assert_equal 20, product.price_details.find_by_production_cost_id(cost.id).price | 381 | assert_equal 20, product.price_details.find_by_production_cost_id(cost.id).price |
test/unit/production_cost_test.rb
@@ -9,7 +9,7 @@ class ProductionCostTest < ActiveSupport::TestCase | @@ -9,7 +9,7 @@ class ProductionCostTest < ActiveSupport::TestCase | ||
9 | 9 | ||
10 | p.name = 'Taxes' | 10 | p.name = 'Taxes' |
11 | p.valid? | 11 | p.valid? |
12 | - assert !p.errors[:name.to_s].present? | 12 | + refute p.errors[:name.to_s].present? |
13 | end | 13 | end |
14 | 14 | ||
15 | should 'not validates name if it is blank' do | 15 | should 'not validates name if it is blank' do |
@@ -28,7 +28,7 @@ class ProductionCostTest < ActiveSupport::TestCase | @@ -28,7 +28,7 @@ class ProductionCostTest < ActiveSupport::TestCase | ||
28 | 28 | ||
29 | p.name = 'a'*30 | 29 | p.name = 'a'*30 |
30 | p.valid? | 30 | p.valid? |
31 | - assert !p.errors[:name.to_s].present? | 31 | + refute p.errors[:name.to_s].present? |
32 | end | 32 | end |
33 | 33 | ||
34 | should 'not have duplicated name on same environment' do | 34 | should 'not have duplicated name on same environment' do |
@@ -58,7 +58,7 @@ class ProductionCostTest < ActiveSupport::TestCase | @@ -58,7 +58,7 @@ class ProductionCostTest < ActiveSupport::TestCase | ||
58 | 58 | ||
59 | cost2.valid? | 59 | cost2.valid? |
60 | 60 | ||
61 | - assert !cost2.errors[:name.to_s].present? | 61 | + refute cost2.errors[:name.to_s].present? |
62 | end | 62 | end |
63 | 63 | ||
64 | should 'allow duplicated name on different enterprises' do | 64 | should 'allow duplicated name on different enterprises' do |
@@ -70,7 +70,7 @@ class ProductionCostTest < ActiveSupport::TestCase | @@ -70,7 +70,7 @@ class ProductionCostTest < ActiveSupport::TestCase | ||
70 | 70 | ||
71 | cost2.valid? | 71 | cost2.valid? |
72 | 72 | ||
73 | - assert !cost2.errors[:name.to_s].present? | 73 | + refute cost2.errors[:name.to_s].present? |
74 | end | 74 | end |
75 | 75 | ||
76 | should 'be associated to an environment as owner' do | 76 | should 'be associated to an environment as owner' do |
@@ -80,7 +80,7 @@ class ProductionCostTest < ActiveSupport::TestCase | @@ -80,7 +80,7 @@ class ProductionCostTest < ActiveSupport::TestCase | ||
80 | 80 | ||
81 | p.owner = Environment.default | 81 | p.owner = Environment.default |
82 | p.valid? | 82 | p.valid? |
83 | - assert !p.errors[:owner.to_s].present? | 83 | + refute p.errors[:owner.to_s].present? |
84 | end | 84 | end |
85 | 85 | ||
86 | should 'be associated to an enterprise as owner' do | 86 | should 'be associated to an enterprise as owner' do |
@@ -91,7 +91,7 @@ class ProductionCostTest < ActiveSupport::TestCase | @@ -91,7 +91,7 @@ class ProductionCostTest < ActiveSupport::TestCase | ||
91 | 91 | ||
92 | p.owner = enterprise | 92 | p.owner = enterprise |
93 | p.valid? | 93 | p.valid? |
94 | - assert !p.errors[:owner.to_s].present? | 94 | + refute p.errors[:owner.to_s].present? |
95 | end | 95 | end |
96 | 96 | ||
97 | should 'create a production cost on an enterprise' do | 97 | should 'create a production cost on an enterprise' do |
test/unit/profile_test.rb
@@ -19,19 +19,19 @@ class ProfileTest < ActiveSupport::TestCase | @@ -19,19 +19,19 @@ class ProfileTest < ActiveSupport::TestCase | ||
19 | 19 | ||
20 | p.identifier = 'rightformat2007' | 20 | p.identifier = 'rightformat2007' |
21 | p.valid? | 21 | p.valid? |
22 | - assert ! p.errors[:identifier.to_s].present? | 22 | + refute p.errors[:identifier.to_s].present? |
23 | 23 | ||
24 | p.identifier = 'rightformat' | 24 | p.identifier = 'rightformat' |
25 | p.valid? | 25 | p.valid? |
26 | - assert ! p.errors[:identifier.to_s].present? | 26 | + refute p.errors[:identifier.to_s].present? |
27 | 27 | ||
28 | p.identifier = 'right_format' | 28 | p.identifier = 'right_format' |
29 | p.valid? | 29 | p.valid? |
30 | - assert ! p.errors[:identifier.to_s].present? | 30 | + refute p.errors[:identifier.to_s].present? |
31 | 31 | ||
32 | p.identifier = 'identifier-with-dashes' | 32 | p.identifier = 'identifier-with-dashes' |
33 | p.valid? | 33 | p.valid? |
34 | - assert ! p.errors[:identifier.to_s].present?, 'Profile should accept identifier with dashes' | 34 | + refute p.errors[:identifier.to_s].present?, 'Profile should accept identifier with dashes' |
35 | end | 35 | end |
36 | 36 | ||
37 | def test_has_domains | 37 | def test_has_domains |
@@ -63,11 +63,11 @@ class ProfileTest < ActiveSupport::TestCase | @@ -63,11 +63,11 @@ class ProfileTest < ActiveSupport::TestCase | ||
63 | should 'set default environment for users created' do | 63 | should 'set default environment for users created' do |
64 | user = create_user 'mytestuser' | 64 | user = create_user 'mytestuser' |
65 | assert_equal 'mytestuser', user.login | 65 | assert_equal 'mytestuser', user.login |
66 | - assert !user.new_record? | 66 | + refute user.new_record? |
67 | 67 | ||
68 | p = user.person | 68 | p = user.person |
69 | 69 | ||
70 | - assert !p.new_record? | 70 | + refute p.new_record? |
71 | assert_equal 'mytestuser', p.identifier | 71 | assert_equal 'mytestuser', p.identifier |
72 | e = p.environment | 72 | e = p.environment |
73 | assert_equal Environment.default, e | 73 | assert_equal Environment.default, e |
@@ -84,7 +84,7 @@ class ProfileTest < ActiveSupport::TestCase | @@ -84,7 +84,7 @@ class ProfileTest < ActiveSupport::TestCase | ||
84 | assert p.errors[:name.to_s].present? | 84 | assert p.errors[:name.to_s].present? |
85 | p.name = 'a very unprobable name' | 85 | p.name = 'a very unprobable name' |
86 | p.valid? | 86 | p.valid? |
87 | - assert !p.errors[:name.to_s].present? | 87 | + refute p.errors[:name.to_s].present? |
88 | end | 88 | end |
89 | 89 | ||
90 | def test_can_have_affiliated_people | 90 | def test_can_have_affiliated_people |
@@ -178,7 +178,7 @@ class ProfileTest < ActiveSupport::TestCase | @@ -178,7 +178,7 @@ class ProfileTest < ActiveSupport::TestCase | ||
178 | top = profile.top_level_articles | 178 | top = profile.top_level_articles |
179 | assert top.include?(p1) | 179 | assert top.include?(p1) |
180 | assert top.include?(p2) | 180 | assert top.include?(p2) |
181 | - assert !top.include?(child) | 181 | + refute top.include?(child) |
182 | end | 182 | end |
183 | 183 | ||
184 | should 'be able to optionally reload the list of top level articles' do | 184 | should 'be able to optionally reload the list of top level articles' do |
@@ -420,15 +420,15 @@ class ProfileTest < ActiveSupport::TestCase | @@ -420,15 +420,15 @@ class ProfileTest < ActiveSupport::TestCase | ||
420 | should 'not advertise articles created together with the profile' do | 420 | should 'not advertise articles created together with the profile' do |
421 | Profile.any_instance.stubs(:default_set_of_articles).returns([Article.new(:name => 'home'), RssFeed.new(:name => 'feed')]) | 421 | Profile.any_instance.stubs(:default_set_of_articles).returns([Article.new(:name => 'home'), RssFeed.new(:name => 'feed')]) |
422 | profile = create(Profile) | 422 | profile = create(Profile) |
423 | - assert !profile.articles.find_by_path('home').advertise? | ||
424 | - assert !profile.articles.find_by_path('feed').advertise? | 423 | + refute profile.articles.find_by_path('home').advertise? |
424 | + refute profile.articles.find_by_path('feed').advertise? | ||
425 | end | 425 | end |
426 | 426 | ||
427 | should 'advertise article after update' do | 427 | should 'advertise article after update' do |
428 | Profile.any_instance.stubs(:default_set_of_articles).returns([Article.new(:name => 'home')]) | 428 | Profile.any_instance.stubs(:default_set_of_articles).returns([Article.new(:name => 'home')]) |
429 | profile = create(Profile) | 429 | profile = create(Profile) |
430 | article = profile.articles.find_by_path('home') | 430 | article = profile.articles.find_by_path('home') |
431 | - assert !article.advertise? | 431 | + refute article.advertise? |
432 | article.name = 'Changed name' | 432 | article.name = 'Changed name' |
433 | article.save! | 433 | article.save! |
434 | assert article.advertise? | 434 | assert article.advertise? |
@@ -482,7 +482,7 @@ class ProfileTest < ActiveSupport::TestCase | @@ -482,7 +482,7 @@ class ProfileTest < ActiveSupport::TestCase | ||
482 | end | 482 | end |
483 | 483 | ||
484 | should 'not display private profile to unauthenticated user' do | 484 | should 'not display private profile to unauthenticated user' do |
485 | - assert !Profile.new(:public_profile => false).display_info_to?(nil) | 485 | + refute Profile.new(:public_profile => false).display_info_to?(nil) |
486 | end | 486 | end |
487 | 487 | ||
488 | should 'display private profile for its owner' do | 488 | should 'display private profile for its owner' do |
@@ -640,11 +640,11 @@ class ProfileTest < ActiveSupport::TestCase | @@ -640,11 +640,11 @@ class ProfileTest < ActiveSupport::TestCase | ||
640 | end | 640 | end |
641 | 641 | ||
642 | should 'not accept product category as category' do | 642 | should 'not accept product category as category' do |
643 | - assert !Profile.new.accept_category?(ProductCategory.new) | 643 | + refute Profile.new.accept_category?(ProductCategory.new) |
644 | end | 644 | end |
645 | 645 | ||
646 | should 'not accept region as a category' do | 646 | should 'not accept region as a category' do |
647 | - assert !Profile.new.accept_category?(Region.new) | 647 | + refute Profile.new.accept_category?(Region.new) |
648 | end | 648 | end |
649 | 649 | ||
650 | should 'query region for location' do | 650 | should 'query region for location' do |
@@ -886,7 +886,7 @@ class ProfileTest < ActiveSupport::TestCase | @@ -886,7 +886,7 @@ class ProfileTest < ActiveSupport::TestCase | ||
886 | p2 = fast_create(Profile, :public_profile => false) | 886 | p2 = fast_create(Profile, :public_profile => false) |
887 | 887 | ||
888 | assert p1.public? | 888 | assert p1.public? |
889 | - assert !p2.public? | 889 | + refute p2.public? |
890 | end | 890 | end |
891 | 891 | ||
892 | should 'remove member with many roles' do | 892 | should 'remove member with many roles' do |
@@ -964,7 +964,7 @@ class ProfileTest < ActiveSupport::TestCase | @@ -964,7 +964,7 @@ class ProfileTest < ActiveSupport::TestCase | ||
964 | 964 | ||
965 | a_copy = p.articles[0] | 965 | a_copy = p.articles[0] |
966 | 966 | ||
967 | - assert !a_copy.advertise | 967 | + refute a_copy.advertise |
968 | end | 968 | end |
969 | 969 | ||
970 | should 'copy set of boxes from profile template' do | 970 | should 'copy set of boxes from profile template' do |
@@ -1115,7 +1115,7 @@ class ProfileTest < ActiveSupport::TestCase | @@ -1115,7 +1115,7 @@ class ProfileTest < ActiveSupport::TestCase | ||
1115 | template.boxes[0].blocks << b | 1115 | template.boxes[0].blocks << b |
1116 | 1116 | ||
1117 | p = create(Profile) | 1117 | p = create(Profile) |
1118 | - assert !b[:title].blank? | 1118 | + refute b[:title].blank? |
1119 | 1119 | ||
1120 | p.copy_blocks_from(template) | 1120 | p.copy_blocks_from(template) |
1121 | 1121 | ||
@@ -1130,7 +1130,7 @@ class ProfileTest < ActiveSupport::TestCase | @@ -1130,7 +1130,7 @@ class ProfileTest < ActiveSupport::TestCase | ||
1130 | template.boxes[0].blocks << b | 1130 | template.boxes[0].blocks << b |
1131 | 1131 | ||
1132 | p = create(Profile) | 1132 | p = create(Profile) |
1133 | - assert !b[:title].blank? | 1133 | + refute b[:title].blank? |
1134 | 1134 | ||
1135 | p.copy_blocks_from(template) | 1135 | p.copy_blocks_from(template) |
1136 | 1136 | ||
@@ -1205,7 +1205,7 @@ class ProfileTest < ActiveSupport::TestCase | @@ -1205,7 +1205,7 @@ class ProfileTest < ActiveSupport::TestCase | ||
1205 | p1 = fast_create(Profile, :identifier => 'mytestprofile', :environment_id => env.id) | 1205 | p1 = fast_create(Profile, :identifier => 'mytestprofile', :environment_id => env.id) |
1206 | p2 = build(Profile, :identifier => 'mytestprofile', :environment => env) | 1206 | p2 = build(Profile, :identifier => 'mytestprofile', :environment => env) |
1207 | 1207 | ||
1208 | - assert !p2.valid? | 1208 | + refute p2.valid? |
1209 | assert p2.errors[:identifier] | 1209 | assert p2.errors[:identifier] |
1210 | assert_equal p1.environment, p2.environment | 1210 | assert_equal p1.environment, p2.environment |
1211 | end | 1211 | end |
@@ -1227,7 +1227,7 @@ class ProfileTest < ActiveSupport::TestCase | @@ -1227,7 +1227,7 @@ class ProfileTest < ActiveSupport::TestCase | ||
1227 | 1227 | ||
1228 | should 'not has blog' do | 1228 | should 'not has blog' do |
1229 | p = fast_create(Profile) | 1229 | p = fast_create(Profile) |
1230 | - assert !p.has_blog? | 1230 | + refute p.has_blog? |
1231 | end | 1231 | end |
1232 | 1232 | ||
1233 | should 'get nil when no blog' do | 1233 | should 'get nil when no blog' do |
@@ -1369,14 +1369,14 @@ class ProfileTest < ActiveSupport::TestCase | @@ -1369,14 +1369,14 @@ class ProfileTest < ActiveSupport::TestCase | ||
1369 | child = profile.articles.create!(:name => 'child', :parent => p1) | 1369 | child = profile.articles.create!(:name => 'child', :parent => p1) |
1370 | profile.reload | 1370 | profile.reload |
1371 | assert_equivalent [p1, p2], profile.folders | 1371 | assert_equivalent [p1, p2], profile.folders |
1372 | - assert !profile.folders.include?(child) | 1372 | + refute profile.folders.include?(child) |
1373 | end | 1373 | end |
1374 | 1374 | ||
1375 | should 'profile is invalid when image not valid' do | 1375 | should 'profile is invalid when image not valid' do |
1376 | profile = build(Profile, :image_builder => {:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')}) | 1376 | profile = build(Profile, :image_builder => {:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')}) |
1377 | profile.image.expects(:valid?).returns(false).at_least_once | 1377 | profile.image.expects(:valid?).returns(false).at_least_once |
1378 | profile.image.errors.add(:size, "fake error") | 1378 | profile.image.errors.add(:size, "fake error") |
1379 | - assert !profile.valid? | 1379 | + refute profile.valid? |
1380 | end | 1380 | end |
1381 | 1381 | ||
1382 | should 'profile be valid when image is empty' do | 1382 | should 'profile be valid when image is empty' do |
@@ -1411,7 +1411,7 @@ class ProfileTest < ActiveSupport::TestCase | @@ -1411,7 +1411,7 @@ class ProfileTest < ActiveSupport::TestCase | ||
1411 | template.is_template = true | 1411 | template.is_template = true |
1412 | template.save! | 1412 | template.save! |
1413 | profile.valid? | 1413 | profile.valid? |
1414 | - assert !profile.errors[:template.to_s].present? | 1414 | + refute profile.errors[:template.to_s].present? |
1415 | end | 1415 | end |
1416 | 1416 | ||
1417 | should 'be able to have a template' do | 1417 | should 'be able to have a template' do |
@@ -1802,7 +1802,7 @@ class ProfileTest < ActiveSupport::TestCase | @@ -1802,7 +1802,7 @@ class ProfileTest < ActiveSupport::TestCase | ||
1802 | 1802 | ||
1803 | should 'not have forum' do | 1803 | should 'not have forum' do |
1804 | p = fast_create(Profile) | 1804 | p = fast_create(Profile) |
1805 | - assert !p.has_forum? | 1805 | + refute p.has_forum? |
1806 | end | 1806 | end |
1807 | 1807 | ||
1808 | should 'get nil when no forum' do | 1808 | should 'get nil when no forum' do |
@@ -1839,7 +1839,7 @@ class ProfileTest < ActiveSupport::TestCase | @@ -1839,7 +1839,7 @@ class ProfileTest < ActiveSupport::TestCase | ||
1839 | should 'know if url is the profile homepage' do | 1839 | should 'know if url is the profile homepage' do |
1840 | profile = fast_create(Profile) | 1840 | profile = fast_create(Profile) |
1841 | 1841 | ||
1842 | - assert !profile.is_on_homepage?("/#{profile.identifier}/any_page") | 1842 | + refute profile.is_on_homepage?("/#{profile.identifier}/any_page") |
1843 | assert profile.is_on_homepage?("/#{profile.identifier}") | 1843 | assert profile.is_on_homepage?("/#{profile.identifier}") |
1844 | end | 1844 | end |
1845 | 1845 | ||
@@ -1851,7 +1851,7 @@ class ProfileTest < ActiveSupport::TestCase | @@ -1851,7 +1851,7 @@ class ProfileTest < ActiveSupport::TestCase | ||
1851 | profile.home_page = homepage | 1851 | profile.home_page = homepage |
1852 | profile.save | 1852 | profile.save |
1853 | 1853 | ||
1854 | - assert !profile.is_on_homepage?("/#{profile.identifier}/#{not_homepage.slug}",not_homepage) | 1854 | + refute profile.is_on_homepage?("/#{profile.identifier}/#{not_homepage.slug}",not_homepage) |
1855 | assert profile.is_on_homepage?("/#{profile.identifier}/#{homepage.slug}", homepage) | 1855 | assert profile.is_on_homepage?("/#{profile.identifier}/#{homepage.slug}", homepage) |
1856 | end | 1856 | end |
1857 | 1857 | ||
@@ -1958,7 +1958,7 @@ class ProfileTest < ActiveSupport::TestCase | @@ -1958,7 +1958,7 @@ class ProfileTest < ActiveSupport::TestCase | ||
1958 | 1958 | ||
1959 | def assert_invalid_identifier(id) | 1959 | def assert_invalid_identifier(id) |
1960 | profile = Profile.new(:identifier => id) | 1960 | profile = Profile.new(:identifier => id) |
1961 | - assert !profile.valid? | 1961 | + refute profile.valid? |
1962 | assert profile.errors[:identifier.to_s].present? | 1962 | assert profile.errors[:identifier.to_s].present? |
1963 | end | 1963 | end |
1964 | 1964 | ||
@@ -1987,7 +1987,7 @@ class ProfileTest < ActiveSupport::TestCase | @@ -1987,7 +1987,7 @@ class ProfileTest < ActiveSupport::TestCase | ||
1987 | Environment.login_redirection_options.keys.each do |redirection| | 1987 | Environment.login_redirection_options.keys.each do |redirection| |
1988 | profile.redirection_after_login = redirection | 1988 | profile.redirection_after_login = redirection |
1989 | profile.save | 1989 | profile.save |
1990 | - assert !profile.errors[:redirection_after_login.to_s].present? | 1990 | + refute profile.errors[:redirection_after_login.to_s].present? |
1991 | end | 1991 | end |
1992 | end | 1992 | end |
1993 | 1993 | ||
@@ -2009,7 +2009,7 @@ class ProfileTest < ActiveSupport::TestCase | @@ -2009,7 +2009,7 @@ class ProfileTest < ActiveSupport::TestCase | ||
2009 | profile = fast_create(Profile) | 2009 | profile = fast_create(Profile) |
2010 | profile.stubs(:active_fields).returns(['field']) | 2010 | profile.stubs(:active_fields).returns(['field']) |
2011 | profile.stubs(:public_fields).returns([]) | 2011 | profile.stubs(:public_fields).returns([]) |
2012 | - assert !profile.may_display_field_to?('field', nil) | 2012 | + refute profile.may_display_field_to?('field', nil) |
2013 | end | 2013 | end |
2014 | 2014 | ||
2015 | should 'not display field if field is active but not public and user is not friend' do | 2015 | should 'not display field if field is active but not public and user is not friend' do |
@@ -2018,7 +2018,7 @@ class ProfileTest < ActiveSupport::TestCase | @@ -2018,7 +2018,7 @@ class ProfileTest < ActiveSupport::TestCase | ||
2018 | profile.expects(:public_fields).returns([]) | 2018 | profile.expects(:public_fields).returns([]) |
2019 | user = mock | 2019 | user = mock |
2020 | user.expects(:is_a_friend?).with(profile).returns(false) | 2020 | user.expects(:is_a_friend?).with(profile).returns(false) |
2021 | - assert !profile.may_display_field_to?('field', user) | 2021 | + refute profile.may_display_field_to?('field', user) |
2022 | end | 2022 | end |
2023 | 2023 | ||
2024 | should 'display field if field is active and not public but user is profile owner' do | 2024 | should 'display field if field is active and not public but user is profile owner' do |
@@ -2057,7 +2057,7 @@ class ProfileTest < ActiveSupport::TestCase | @@ -2057,7 +2057,7 @@ class ProfileTest < ActiveSupport::TestCase | ||
2057 | assert profile.may_display_location_to?(user) | 2057 | assert profile.may_display_location_to?(user) |
2058 | 2058 | ||
2059 | profile.stubs(:may_display_field_to?).with(Profile::LOCATION_FIELDS[0], user).returns(false) | 2059 | profile.stubs(:may_display_field_to?).with(Profile::LOCATION_FIELDS[0], user).returns(false) |
2060 | - assert !profile.may_display_location_to?(user) | 2060 | + refute profile.may_display_location_to?(user) |
2061 | end | 2061 | end |
2062 | 2062 | ||
2063 | should 'destroy profile if its environment is destroyed' do | 2063 | should 'destroy profile if its environment is destroyed' do |
@@ -2099,13 +2099,13 @@ class ProfileTest < ActiveSupport::TestCase | @@ -2099,13 +2099,13 @@ class ProfileTest < ActiveSupport::TestCase | ||
2099 | end | 2099 | end |
2100 | 2100 | ||
2101 | should 'not copy rss_feed' do | 2101 | should 'not copy rss_feed' do |
2102 | - assert !fast_create(Profile).copy_article?(fast_create(RssFeed)) | 2102 | + refute fast_create(Profile).copy_article?(fast_create(RssFeed)) |
2103 | end | 2103 | end |
2104 | 2104 | ||
2105 | should 'not copy template welcome_page' do | 2105 | should 'not copy template welcome_page' do |
2106 | template = fast_create(Person, :is_template => true) | 2106 | template = fast_create(Person, :is_template => true) |
2107 | welcome_page = fast_create(TinyMceArticle, :slug => 'welcome-page', :profile_id => template.id) | 2107 | welcome_page = fast_create(TinyMceArticle, :slug => 'welcome-page', :profile_id => template.id) |
2108 | - assert !template.copy_article?(welcome_page) | 2108 | + refute template.copy_article?(welcome_page) |
2109 | end | 2109 | end |
2110 | 2110 | ||
2111 | should 'return nil on welcome_page_content if template has no welcome page' do | 2111 | should 'return nil on welcome_page_content if template has no welcome page' do |
test/unit/qualifier_test.rb
@@ -5,7 +5,7 @@ class QualifierTest < ActiveSupport::TestCase | @@ -5,7 +5,7 @@ class QualifierTest < ActiveSupport::TestCase | ||
5 | 5 | ||
6 | should 'environment is mandatory' do | 6 | should 'environment is mandatory' do |
7 | qualifier = Qualifier.new(:name => 'Qualifier without environment') | 7 | qualifier = Qualifier.new(:name => 'Qualifier without environment') |
8 | - assert !qualifier.valid? | 8 | + refute qualifier.valid? |
9 | 9 | ||
10 | qualifier.environment = fast_create(Environment) | 10 | qualifier.environment = fast_create(Environment) |
11 | assert qualifier.valid? | 11 | assert qualifier.valid? |
@@ -25,7 +25,7 @@ class QualifierTest < ActiveSupport::TestCase | @@ -25,7 +25,7 @@ class QualifierTest < ActiveSupport::TestCase | ||
25 | should 'name is mandatory' do | 25 | should 'name is mandatory' do |
26 | env_one = fast_create(Environment) | 26 | env_one = fast_create(Environment) |
27 | qualifier = env_one.qualifiers.build | 27 | qualifier = env_one.qualifiers.build |
28 | - assert !qualifier.valid? | 28 | + refute qualifier.valid? |
29 | 29 | ||
30 | qualifier.name = 'Qualifier name' | 30 | qualifier.name = 'Qualifier name' |
31 | assert qualifier.valid? | 31 | assert qualifier.valid? |
test/unit/region_test.rb
@@ -26,7 +26,7 @@ class RegionTest < ActiveSupport::TestCase | @@ -26,7 +26,7 @@ class RegionTest < ActiveSupport::TestCase | ||
26 | should 'has no validator' do | 26 | should 'has no validator' do |
27 | env = fast_create(Environment) | 27 | env = fast_create(Environment) |
28 | region = fast_create(Region, :environment_id => env.id, :name => 'My Region') | 28 | region = fast_create(Region, :environment_id => env.id, :name => 'My Region') |
29 | - assert !region.has_validator? | 29 | + refute region.has_validator? |
30 | end | 30 | end |
31 | 31 | ||
32 | should 'list regions with validators' do | 32 | should 'list regions with validators' do |
test/unit/rss_feed_test.rb
@@ -15,7 +15,7 @@ class RssFeedTest < ActiveSupport::TestCase | @@ -15,7 +15,7 @@ class RssFeedTest < ActiveSupport::TestCase | ||
15 | :search => 'parent_and_children', | 15 | :search => 'parent_and_children', |
16 | } | 16 | } |
17 | feed.valid? | 17 | feed.valid? |
18 | - assert !feed.errors['body'.to_s].present? | 18 | + refute feed.errors['body'.to_s].present? |
19 | end | 19 | end |
20 | 20 | ||
21 | should 'alias body as "settings"' do | 21 | should 'alias body as "settings"' do |
@@ -172,11 +172,11 @@ class RssFeedTest < ActiveSupport::TestCase | @@ -172,11 +172,11 @@ class RssFeedTest < ActiveSupport::TestCase | ||
172 | 172 | ||
173 | feed.include = 'parent_and_children' | 173 | feed.include = 'parent_and_children' |
174 | feed.valid? | 174 | feed.valid? |
175 | - assert !feed.errors[:include.to_s].present? | 175 | + refute feed.errors[:include.to_s].present? |
176 | 176 | ||
177 | feed.include = 'all' | 177 | feed.include = 'all' |
178 | feed.valid? | 178 | feed.valid? |
179 | - assert !feed.errors[:include.to_s].present? | 179 | + refute feed.errors[:include.to_s].present? |
180 | end | 180 | end |
181 | 181 | ||
182 | should 'provide proper short description' do | 182 | should 'provide proper short description' do |
@@ -194,7 +194,7 @@ class RssFeedTest < ActiveSupport::TestCase | @@ -194,7 +194,7 @@ class RssFeedTest < ActiveSupport::TestCase | ||
194 | should 'advertise is false before create' do | 194 | should 'advertise is false before create' do |
195 | profile = create_user('testuser').person | 195 | profile = create_user('testuser').person |
196 | feed = create(RssFeed, :name => 'testfeed', :profile => profile) | 196 | feed = create(RssFeed, :name => 'testfeed', :profile => profile) |
197 | - assert !feed.advertise? | 197 | + refute feed.advertise? |
198 | end | 198 | end |
199 | 199 | ||
200 | should 'can display hits' do | 200 | should 'can display hits' do |
test/unit/scope_tool.rb
@@ -23,9 +23,9 @@ class ScopeToolTest < ActiveSupport::TestCase | @@ -23,9 +23,9 @@ class ScopeToolTest < ActiveSupport::TestCase | ||
23 | assert orgs.include? ent2 | 23 | assert orgs.include? ent2 |
24 | orgs = orgs.visible | 24 | orgs = orgs.visible |
25 | assert orgs.include? cmm1 | 25 | assert orgs.include? cmm1 |
26 | - assert !orgs.include?(cmm2) | 26 | + refute orgs.include?(cmm2) |
27 | assert orgs.include? ent1 | 27 | assert orgs.include? ent1 |
28 | - assert !orgs.include?(ent2) | 28 | + refute orgs.include?(ent2) |
29 | end | 29 | end |
30 | 30 | ||
31 | end | 31 | end |
test/unit/scrap_test.rb
@@ -19,7 +19,7 @@ class ScrapTest < ActiveSupport::TestCase | @@ -19,7 +19,7 @@ class ScrapTest < ActiveSupport::TestCase | ||
19 | 19 | ||
20 | s.content = 'some content' | 20 | s.content = 'some content' |
21 | s.valid? | 21 | s.valid? |
22 | - assert !s.errors[:content.to_s].present? | 22 | + refute s.errors[:content.to_s].present? |
23 | end | 23 | end |
24 | 24 | ||
25 | should "have the sender" do | 25 | should "have the sender" do |
@@ -29,7 +29,7 @@ class ScrapTest < ActiveSupport::TestCase | @@ -29,7 +29,7 @@ class ScrapTest < ActiveSupport::TestCase | ||
29 | 29 | ||
30 | s.sender_id = 1 | 30 | s.sender_id = 1 |
31 | s.valid? | 31 | s.valid? |
32 | - assert !s.errors[:sender_id.to_s].present? | 32 | + refute s.errors[:sender_id.to_s].present? |
33 | end | 33 | end |
34 | 34 | ||
35 | should "have the receiver" do | 35 | should "have the receiver" do |
@@ -39,7 +39,7 @@ class ScrapTest < ActiveSupport::TestCase | @@ -39,7 +39,7 @@ class ScrapTest < ActiveSupport::TestCase | ||
39 | 39 | ||
40 | s.receiver_id = 1 | 40 | s.receiver_id = 1 |
41 | s.valid? | 41 | s.valid? |
42 | - assert !s.errors[:receiver_id.to_s].present? | 42 | + refute s.errors[:receiver_id.to_s].present? |
43 | end | 43 | end |
44 | 44 | ||
45 | should "be associated to Person as sender" do | 45 | should "be associated to Person as sender" do |
@@ -258,7 +258,7 @@ class ScrapTest < ActiveSupport::TestCase | @@ -258,7 +258,7 @@ class ScrapTest < ActiveSupport::TestCase | ||
258 | should 'strip html before validate' do | 258 | should 'strip html before validate' do |
259 | s, r = create_user.person, create_user.person | 259 | s, r = create_user.person, create_user.person |
260 | s = build Scrap, :sender => s, :receiver => r, :content => "<p><b></b></p>" | 260 | s = build Scrap, :sender => s, :receiver => r, :content => "<p><b></b></p>" |
261 | - assert !s.valid? | 261 | + refute s.valid? |
262 | s.content = "<p>Test</p>" | 262 | s.content = "<p>Test</p>" |
263 | assert s.valid? | 263 | assert s.valid? |
264 | end | 264 | end |
test/unit/search_helper_test.rb
@@ -14,14 +14,14 @@ class SearchHelperTest < ActiveSupport::TestCase | @@ -14,14 +14,14 @@ class SearchHelperTest < ActiveSupport::TestCase | ||
14 | 14 | ||
15 | stubs(:params).returns({:action => 'products', :display => 'map'}) | 15 | stubs(:params).returns({:action => 'products', :display => 'map'}) |
16 | @results = {:products => [1,2]} | 16 | @results = {:products => [1,2]} |
17 | - assert !multiple_search? | 17 | + refute multiple_search? |
18 | end | 18 | end |
19 | 19 | ||
20 | should 'return whether on a map search' do | 20 | should 'return whether on a map search' do |
21 | stubs(:params).returns({:action => 'index', :display => 'map'}) | 21 | stubs(:params).returns({:action => 'index', :display => 'map'}) |
22 | @results = {:articles => [1,2], :products => [1,2]} | 22 | @results = {:articles => [1,2], :products => [1,2]} |
23 | @query = '' | 23 | @query = '' |
24 | - assert !map_search? | 24 | + refute map_search? |
25 | 25 | ||
26 | stubs(:params).returns({:action => 'products', :display => 'map'}) | 26 | stubs(:params).returns({:action => 'products', :display => 'map'}) |
27 | @results = {:products => [1,2]} | 27 | @results = {:products => [1,2]} |
test/unit/search_term_occurrence_test.rb
@@ -10,7 +10,7 @@ class SearchTermOccurrenceTest < ActiveSupport::TestCase | @@ -10,7 +10,7 @@ class SearchTermOccurrenceTest < ActiveSupport::TestCase | ||
10 | 10 | ||
11 | should 'have term' do | 11 | should 'have term' do |
12 | search_term_occurrence = SearchTermOccurrence.new | 12 | search_term_occurrence = SearchTermOccurrence.new |
13 | - assert !search_term_occurrence.valid? | 13 | + refute search_term_occurrence.valid? |
14 | assert search_term_occurrence.errors.has_key?(:search_term) | 14 | assert search_term_occurrence.errors.has_key?(:search_term) |
15 | end | 15 | end |
16 | 16 |
test/unit/search_term_test.rb
@@ -3,13 +3,13 @@ require 'test_helper' | @@ -3,13 +3,13 @@ require 'test_helper' | ||
3 | class SearchTermTest < ActiveSupport::TestCase | 3 | class SearchTermTest < ActiveSupport::TestCase |
4 | should 'have term' do | 4 | should 'have term' do |
5 | search_term = SearchTerm.new | 5 | search_term = SearchTerm.new |
6 | - assert !search_term.valid? | 6 | + refute search_term.valid? |
7 | assert search_term.errors.has_key?(:term) | 7 | assert search_term.errors.has_key?(:term) |
8 | end | 8 | end |
9 | 9 | ||
10 | should 'have context' do | 10 | should 'have context' do |
11 | search_term = SearchTerm.new | 11 | search_term = SearchTerm.new |
12 | - assert !search_term.valid? | 12 | + refute search_term.valid? |
13 | assert search_term.errors.has_key?(:context) | 13 | assert search_term.errors.has_key?(:context) |
14 | end | 14 | end |
15 | 15 | ||
@@ -21,12 +21,12 @@ class SearchTermTest < ActiveSupport::TestCase | @@ -21,12 +21,12 @@ class SearchTermTest < ActiveSupport::TestCase | ||
21 | 21 | ||
22 | search_term.asset = 'alternate_universe' | 22 | search_term.asset = 'alternate_universe' |
23 | search_term.valid? | 23 | search_term.valid? |
24 | - assert !search_term.errors.has_key?(:term) | 24 | + refute search_term.errors.has_key?(:term) |
25 | 25 | ||
26 | search_term.asset = 'universe' | 26 | search_term.asset = 'universe' |
27 | search_term.context = fast_create(Profile) | 27 | search_term.context = fast_create(Profile) |
28 | search_term.valid? | 28 | search_term.valid? |
29 | - assert !search_term.errors.has_key?(:term) | 29 | + refute search_term.errors.has_key?(:term) |
30 | end | 30 | end |
31 | 31 | ||
32 | should 'create a search term' do | 32 | should 'create a search term' do |
test/unit/suggest_article_test.rb
@@ -13,28 +13,28 @@ class SuggestArticleTest < ActiveSupport::TestCase | @@ -13,28 +13,28 @@ class SuggestArticleTest < ActiveSupport::TestCase | ||
13 | 13 | ||
14 | should 'have the article_name' do | 14 | should 'have the article_name' do |
15 | t = SuggestArticle.new | 15 | t = SuggestArticle.new |
16 | - assert !t.article_object.errors[:name].present? | 16 | + refute t.article_object.errors[:name].present? |
17 | t.article_object.valid? | 17 | t.article_object.valid? |
18 | assert t.article_object.errors[:name].present? | 18 | assert t.article_object.errors[:name].present? |
19 | end | 19 | end |
20 | 20 | ||
21 | should 'have the email' do | 21 | should 'have the email' do |
22 | t = SuggestArticle.new | 22 | t = SuggestArticle.new |
23 | - assert !t.errors[:email.to_s].present? | 23 | + refute t.errors[:email.to_s].present? |
24 | t.valid? | 24 | t.valid? |
25 | assert t.errors[:email.to_s].present? | 25 | assert t.errors[:email.to_s].present? |
26 | end | 26 | end |
27 | 27 | ||
28 | should 'have the name' do | 28 | should 'have the name' do |
29 | t = SuggestArticle.new | 29 | t = SuggestArticle.new |
30 | - assert !t.errors[:name.to_s].present? | 30 | + refute t.errors[:name.to_s].present? |
31 | t.valid? | 31 | t.valid? |
32 | assert t.errors[:name.to_s].present? | 32 | assert t.errors[:name.to_s].present? |
33 | end | 33 | end |
34 | 34 | ||
35 | should 'have the target_id' do | 35 | should 'have the target_id' do |
36 | t = SuggestArticle.new | 36 | t = SuggestArticle.new |
37 | - assert !t.errors[:target_id.to_s].present? | 37 | + refute t.errors[:target_id.to_s].present? |
38 | t.valid? | 38 | t.valid? |
39 | assert t.errors[:target_id.to_s].present? | 39 | assert t.errors[:target_id.to_s].present? |
40 | end | 40 | end |
@@ -42,7 +42,7 @@ class SuggestArticleTest < ActiveSupport::TestCase | @@ -42,7 +42,7 @@ class SuggestArticleTest < ActiveSupport::TestCase | ||
42 | should 'have the article' do | 42 | should 'have the article' do |
43 | t = SuggestArticle.new | 43 | t = SuggestArticle.new |
44 | assert t.respond_to?(:article_object) | 44 | assert t.respond_to?(:article_object) |
45 | - assert !t.errors[:article_object].present? | 45 | + refute t.errors[:article_object].present? |
46 | t.valid? | 46 | t.valid? |
47 | assert t.errors[:article_object].present? | 47 | assert t.errors[:article_object].present? |
48 | end | 48 | end |
test/unit/task_mailer_test.rb
@@ -31,7 +31,7 @@ class TaskMailerTest < ActiveSupport::TestCase | @@ -31,7 +31,7 @@ class TaskMailerTest < ActiveSupport::TestCase | ||
31 | task.expects(:environment).returns(environment).at_least_once | 31 | task.expects(:environment).returns(environment).at_least_once |
32 | 32 | ||
33 | task.send(:send_notification, :finished).deliver | 33 | task.send(:send_notification, :finished).deliver |
34 | - assert !ActionMailer::Base.deliveries.empty? | 34 | + refute ActionMailer::Base.deliveries.empty? |
35 | end | 35 | end |
36 | 36 | ||
37 | should 'be able to send a "task cancelled" message' do | 37 | should 'be able to send a "task cancelled" message' do |
@@ -54,7 +54,7 @@ class TaskMailerTest < ActiveSupport::TestCase | @@ -54,7 +54,7 @@ class TaskMailerTest < ActiveSupport::TestCase | ||
54 | task.expects(:environment).returns(environment).at_least_once | 54 | task.expects(:environment).returns(environment).at_least_once |
55 | 55 | ||
56 | task.send(:send_notification, :cancelled).deliver | 56 | task.send(:send_notification, :cancelled).deliver |
57 | - assert !ActionMailer::Base.deliveries.empty? | 57 | + refute ActionMailer::Base.deliveries.empty? |
58 | end | 58 | end |
59 | 59 | ||
60 | should 'be able to send a "task created" message' do | 60 | should 'be able to send a "task created" message' do |
@@ -78,7 +78,7 @@ class TaskMailerTest < ActiveSupport::TestCase | @@ -78,7 +78,7 @@ class TaskMailerTest < ActiveSupport::TestCase | ||
78 | task.expects(:environment).returns(environment).at_least_once | 78 | task.expects(:environment).returns(environment).at_least_once |
79 | 79 | ||
80 | task.send(:send_notification, :created).deliver | 80 | task.send(:send_notification, :created).deliver |
81 | - assert !ActionMailer::Base.deliveries.empty? | 81 | + refute ActionMailer::Base.deliveries.empty? |
82 | end | 82 | end |
83 | 83 | ||
84 | should 'be able to send a "target notification" message' do | 84 | should 'be able to send a "target notification" message' do |
@@ -88,7 +88,7 @@ class TaskMailerTest < ActiveSupport::TestCase | @@ -88,7 +88,7 @@ class TaskMailerTest < ActiveSupport::TestCase | ||
88 | task.expects(:target_notification_description).returns('the task') | 88 | task.expects(:target_notification_description).returns('the task') |
89 | 89 | ||
90 | TaskMailer.target_notification(task, 'the message').deliver | 90 | TaskMailer.target_notification(task, 'the message').deliver |
91 | - assert !ActionMailer::Base.deliveries.empty? | 91 | + refute ActionMailer::Base.deliveries.empty? |
92 | end | 92 | end |
93 | 93 | ||
94 | should 'be able to send a "invitation notification" message' do | 94 | should 'be able to send a "invitation notification" message' do |
@@ -121,7 +121,7 @@ class TaskMailerTest < ActiveSupport::TestCase | @@ -121,7 +121,7 @@ class TaskMailerTest < ActiveSupport::TestCase | ||
121 | assert_equal "Hello friend name, my name invite you, please follow this link: http://example.com/account/signup?invitation_code=123456", mail.body.to_s | 121 | assert_equal "Hello friend name, my name invite you, please follow this link: http://example.com/account/signup?invitation_code=123456", mail.body.to_s |
122 | 122 | ||
123 | mail.deliver | 123 | mail.deliver |
124 | - assert !ActionMailer::Base.deliveries.empty? | 124 | + refute ActionMailer::Base.deliveries.empty? |
125 | end | 125 | end |
126 | 126 | ||
127 | should 'use environment name and no-reply email' do | 127 | should 'use environment name and no-reply email' do |
test/unit/task_test.rb
@@ -114,7 +114,7 @@ class TaskTest < ActiveSupport::TestCase | @@ -114,7 +114,7 @@ class TaskTest < ActiveSupport::TestCase | ||
114 | task1 = Task.create! | 114 | task1 = Task.create! |
115 | task2 = build(Task, :code => task1.code) | 115 | task2 = build(Task, :code => task1.code) |
116 | 116 | ||
117 | - assert !task2.valid? | 117 | + refute task2.valid? |
118 | assert task2.errors[:code.to_s].present? | 118 | assert task2.errors[:code.to_s].present? |
119 | end | 119 | end |
120 | 120 | ||
@@ -391,15 +391,15 @@ class TaskTest < ActiveSupport::TestCase | @@ -391,15 +391,15 @@ class TaskTest < ActiveSupport::TestCase | ||
391 | t = Task.new | 391 | t = Task.new |
392 | t.spam = true | 392 | t.spam = true |
393 | assert t.spam? | 393 | assert t.spam? |
394 | - assert !t.ham? | 394 | + refute t.ham? |
395 | 395 | ||
396 | t.spam = false | 396 | t.spam = false |
397 | assert t.ham? | 397 | assert t.ham? |
398 | - assert !t.spam? | 398 | + refute t.spam? |
399 | 399 | ||
400 | t.spam = nil | 400 | t.spam = nil |
401 | - assert !t.spam? | ||
402 | - assert !t.ham? | 401 | + refute t.spam? |
402 | + refute t.ham? | ||
403 | end | 403 | end |
404 | 404 | ||
405 | should 'be able to select non-spam tasks' do | 405 | should 'be able to select non-spam tasks' do |
test/unit/text_article_test.rb
@@ -92,7 +92,7 @@ class TextArticleTest < ActiveSupport::TestCase | @@ -92,7 +92,7 @@ class TextArticleTest < ActiveSupport::TestCase | ||
92 | 92 | ||
93 | text = TextArticle.new(:profile => profile) | 93 | text = TextArticle.new(:profile => profile) |
94 | 94 | ||
95 | - assert !text.translatable? | 95 | + refute text.translatable? |
96 | end | 96 | end |
97 | 97 | ||
98 | should 'be translatable if there is languages on environment' do | 98 | should 'be translatable if there is languages on environment' do |
@@ -101,7 +101,7 @@ class TextArticleTest < ActiveSupport::TestCase | @@ -101,7 +101,7 @@ class TextArticleTest < ActiveSupport::TestCase | ||
101 | profile = fast_create(Person, :environment_id => environment.id) | 101 | profile = fast_create(Person, :environment_id => environment.id) |
102 | text = fast_create(TextArticle, :profile_id => profile.id) | 102 | text = fast_create(TextArticle, :profile_id => profile.id) |
103 | 103 | ||
104 | - assert !text.translatable? | 104 | + refute text.translatable? |
105 | 105 | ||
106 | environment.languages = ['en','pt','fr'] | 106 | environment.languages = ['en','pt','fr'] |
107 | environment.save | 107 | environment.save |
test/unit/theme_test.rb
@@ -167,7 +167,7 @@ class ThemeTest < ActiveSupport::TestCase | @@ -167,7 +167,7 @@ class ThemeTest < ActiveSupport::TestCase | ||
167 | [Theme.find(t2.id), Theme.find(t1.id)].each do |theme| | 167 | [Theme.find(t2.id), Theme.find(t1.id)].each do |theme| |
168 | assert Theme.approved_themes(profile).include?(theme) | 168 | assert Theme.approved_themes(profile).include?(theme) |
169 | end | 169 | end |
170 | - assert ! Theme.approved_themes(profile).include?(Theme.find(t3.id)) | 170 | + refute Theme.approved_themes(profile).include?(Theme.find(t3.id)) |
171 | end | 171 | end |
172 | 172 | ||
173 | should 'not list non theme files or dirs inside themes dir' do | 173 | should 'not list non theme files or dirs inside themes dir' do |
@@ -188,7 +188,7 @@ class ThemeTest < ActiveSupport::TestCase | @@ -188,7 +188,7 @@ class ThemeTest < ActiveSupport::TestCase | ||
188 | end | 188 | end |
189 | 189 | ||
190 | should 'not be public by default' do | 190 | should 'not be public by default' do |
191 | - assert ! Theme.new('test').public | 191 | + refute Theme.new('test').public |
192 | end | 192 | end |
193 | 193 | ||
194 | should 'not crash with nil or invalid owner_type' do | 194 | should 'not crash with nil or invalid owner_type' do |
test/unit/translatable_content_test.rb
@@ -18,7 +18,7 @@ class TranslatableContentTest < ActiveSupport::TestCase | @@ -18,7 +18,7 @@ class TranslatableContentTest < ActiveSupport::TestCase | ||
18 | 18 | ||
19 | should 'not be translatable if parent is a forum' do | 19 | should 'not be translatable if parent is a forum' do |
20 | content.parent = Forum.new | 20 | content.parent = Forum.new |
21 | - assert !content.translatable? | 21 | + refute content.translatable? |
22 | end | 22 | end |
23 | 23 | ||
24 | should 'be translatable if parent is not a forum' do | 24 | should 'be translatable if parent is not a forum' do |
test/unit/uploaded_file_test.rb
@@ -74,7 +74,7 @@ class UploadedFileTest < ActiveSupport::TestCase | @@ -74,7 +74,7 @@ class UploadedFileTest < ActiveSupport::TestCase | ||
74 | should 'not upload files bigger than max_size' do | 74 | should 'not upload files bigger than max_size' do |
75 | f = build(UploadedFile, :profile => @profile, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')) | 75 | f = build(UploadedFile, :profile => @profile, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')) |
76 | f.expects(:size).returns(UploadedFile.attachment_options[:max_size] + 1024) | 76 | f.expects(:size).returns(UploadedFile.attachment_options[:max_size] + 1024) |
77 | - assert !f.valid? | 77 | + refute f.valid? |
78 | end | 78 | end |
79 | 79 | ||
80 | should 'upload files smaller than max_size' do | 80 | should 'upload files smaller than max_size' do |
@@ -175,7 +175,7 @@ class UploadedFileTest < ActiveSupport::TestCase | @@ -175,7 +175,7 @@ class UploadedFileTest < ActiveSupport::TestCase | ||
175 | end | 175 | end |
176 | 176 | ||
177 | should 'return false by default in thumbnails_processed' do | 177 | should 'return false by default in thumbnails_processed' do |
178 | - assert !UploadedFile.new.thumbnails_processed | 178 | + refute UploadedFile.new.thumbnails_processed |
179 | end | 179 | end |
180 | 180 | ||
181 | should 'set thumbnails_processed to true' do | 181 | should 'set thumbnails_processed to true' do |
test/unit/user_test.rb
@@ -10,7 +10,7 @@ class UserTest < ActiveSupport::TestCase | @@ -10,7 +10,7 @@ class UserTest < ActiveSupport::TestCase | ||
10 | def test_should_create_user | 10 | def test_should_create_user |
11 | assert_difference 'User.count' do | 11 | assert_difference 'User.count' do |
12 | user = new_user | 12 | user = new_user |
13 | - assert !user.new_record?, "#{user.errors.full_messages.to_sentence}" | 13 | + refute user.new_record?, "#{user.errors.full_messages.to_sentence}" |
14 | end | 14 | end |
15 | end | 15 | end |
16 | 16 | ||
@@ -110,15 +110,15 @@ class UserTest < ActiveSupport::TestCase | @@ -110,15 +110,15 @@ class UserTest < ActiveSupport::TestCase | ||
110 | 110 | ||
111 | u.login = 'rightformat2007' | 111 | u.login = 'rightformat2007' |
112 | u.valid? | 112 | u.valid? |
113 | - assert ! u.errors[:login.to_s].present? | 113 | + refute u.errors[:login.to_s].present? |
114 | 114 | ||
115 | u.login = 'rightformat' | 115 | u.login = 'rightformat' |
116 | u.valid? | 116 | u.valid? |
117 | - assert ! u.errors[:login.to_s].present? | 117 | + refute u.errors[:login.to_s].present? |
118 | 118 | ||
119 | u.login = 'right_format' | 119 | u.login = 'right_format' |
120 | u.valid? | 120 | u.valid? |
121 | - assert ! u.errors[:login.to_s].present? | 121 | + refute u.errors[:login.to_s].present? |
122 | end | 122 | end |
123 | 123 | ||
124 | def test_should_change_password | 124 | def test_should_change_password |
@@ -126,7 +126,7 @@ class UserTest < ActiveSupport::TestCase | @@ -126,7 +126,7 @@ class UserTest < ActiveSupport::TestCase | ||
126 | assert_nothing_raised do | 126 | assert_nothing_raised do |
127 | user.change_password!('test', 'newpass', 'newpass') | 127 | user.change_password!('test', 'newpass', 'newpass') |
128 | end | 128 | end |
129 | - assert !user.authenticated?('test') | 129 | + refute user.authenticated?('test') |
130 | assert user.authenticated?('newpass') | 130 | assert user.authenticated?('newpass') |
131 | end | 131 | end |
132 | 132 | ||
@@ -135,7 +135,7 @@ class UserTest < ActiveSupport::TestCase | @@ -135,7 +135,7 @@ class UserTest < ActiveSupport::TestCase | ||
135 | assert_raise User::IncorrectPassword do | 135 | assert_raise User::IncorrectPassword do |
136 | user.change_password!('wrong', 'newpass', 'newpass') | 136 | user.change_password!('wrong', 'newpass', 'newpass') |
137 | end | 137 | end |
138 | - assert !user.authenticated?('newpass') | 138 | + refute user.authenticated?('newpass') |
139 | assert user.authenticated?('test') | 139 | assert user.authenticated?('test') |
140 | end | 140 | end |
141 | 141 | ||
@@ -144,7 +144,7 @@ class UserTest < ActiveSupport::TestCase | @@ -144,7 +144,7 @@ class UserTest < ActiveSupport::TestCase | ||
144 | assert_raise ActiveRecord::RecordInvalid do | 144 | assert_raise ActiveRecord::RecordInvalid do |
145 | user.force_change_password!('newpass', 'newpasswrong') | 145 | user.force_change_password!('newpass', 'newpasswrong') |
146 | end | 146 | end |
147 | - assert !user.authenticated?('newpass') | 147 | + refute user.authenticated?('newpass') |
148 | assert user.authenticated?('test') | 148 | assert user.authenticated?('test') |
149 | end | 149 | end |
150 | 150 | ||
@@ -158,7 +158,7 @@ class UserTest < ActiveSupport::TestCase | @@ -158,7 +158,7 @@ class UserTest < ActiveSupport::TestCase | ||
158 | 158 | ||
159 | def test_should_create_person_when_creating_user | 159 | def test_should_create_person_when_creating_user |
160 | count = Person.count | 160 | count = Person.count |
161 | - assert !Person.find_by_identifier('lalala') | 161 | + refute Person.find_by_identifier('lalala') |
162 | new_user(:login => 'lalala', :email => 'lalala@example.com') | 162 | new_user(:login => 'lalala', :email => 'lalala@example.com') |
163 | assert Person.find_by_identifier('lalala') | 163 | assert Person.find_by_identifier('lalala') |
164 | end | 164 | end |
@@ -174,7 +174,7 @@ class UserTest < ActiveSupport::TestCase | @@ -174,7 +174,7 @@ class UserTest < ActiveSupport::TestCase | ||
174 | user = new_user(:login => 'lalala', :email => 'lalala@example.com') | 174 | user = new_user(:login => 'lalala', :email => 'lalala@example.com') |
175 | assert Person.find_by_identifier('lalala') | 175 | assert Person.find_by_identifier('lalala') |
176 | user.destroy | 176 | user.destroy |
177 | - assert !Person.find_by_identifier('lalala') | 177 | + refute Person.find_by_identifier('lalala') |
178 | end | 178 | end |
179 | 179 | ||
180 | def test_should_encrypt_password_with_salted_sha1 | 180 | def test_should_encrypt_password_with_salted_sha1 |
@@ -291,7 +291,7 @@ class UserTest < ActiveSupport::TestCase | @@ -291,7 +291,7 @@ class UserTest < ActiveSupport::TestCase | ||
291 | 291 | ||
292 | should 'enable email' do | 292 | should 'enable email' do |
293 | user = create_user('cooler') | 293 | user = create_user('cooler') |
294 | - assert !user.enable_email | 294 | + refute user.enable_email |
295 | assert user.enable_email! | 295 | assert user.enable_email! |
296 | assert user.enable_email | 296 | assert user.enable_email |
297 | end | 297 | end |
@@ -307,7 +307,7 @@ class UserTest < ActiveSupport::TestCase | @@ -307,7 +307,7 @@ class UserTest < ActiveSupport::TestCase | ||
307 | user = create_user('cooler') | 307 | user = create_user('cooler') |
308 | user.expects(:environment).returns(nil) | 308 | user.expects(:environment).returns(nil) |
309 | EmailActivation.create!(:requestor => user.person, :target => Environment.default) | 309 | EmailActivation.create!(:requestor => user.person, :target => Environment.default) |
310 | - assert !user.email_activation_pending? | 310 | + refute user.email_activation_pending? |
311 | end | 311 | end |
312 | 312 | ||
313 | should 'has moderate registration pending' do | 313 | should 'has moderate registration pending' do |
@@ -318,7 +318,7 @@ class UserTest < ActiveSupport::TestCase | @@ -318,7 +318,7 @@ class UserTest < ActiveSupport::TestCase | ||
318 | 318 | ||
319 | should 'not has moderate registration pending if not have a pending task' do | 319 | should 'not has moderate registration pending if not have a pending task' do |
320 | user = create_user('cooler') | 320 | user = create_user('cooler') |
321 | - assert !user.moderate_registration_pending? | 321 | + refute user.moderate_registration_pending? |
322 | end | 322 | end |
323 | 323 | ||
324 | should 'be able to use [] operator to find users by login' do | 324 | should 'be able to use [] operator to find users by login' do |
@@ -527,7 +527,7 @@ class UserTest < ActiveSupport::TestCase | @@ -527,7 +527,7 @@ class UserTest < ActiveSupport::TestCase | ||
527 | user = new_user | 527 | user = new_user |
528 | assert_not_nil user.activation_code | 528 | assert_not_nil user.activation_code |
529 | assert_nil user.activated_at | 529 | assert_nil user.activated_at |
530 | - assert !user.person.visible | 530 | + refute user.person.visible |
531 | end | 531 | end |
532 | 532 | ||
533 | should 'activate an user' do | 533 | should 'activate an user' do |
@@ -540,7 +540,7 @@ class UserTest < ActiveSupport::TestCase | @@ -540,7 +540,7 @@ class UserTest < ActiveSupport::TestCase | ||
540 | 540 | ||
541 | should 'return if the user is activated' do | 541 | should 'return if the user is activated' do |
542 | user = new_user | 542 | user = new_user |
543 | - assert !user.activated? | 543 | + refute user.activated? |
544 | user.activate | 544 | user.activate |
545 | assert user.activated? | 545 | assert user.activated? |
546 | end | 546 | end |
@@ -573,7 +573,7 @@ class UserTest < ActiveSupport::TestCase | @@ -573,7 +573,7 @@ class UserTest < ActiveSupport::TestCase | ||
573 | user.activate | 573 | user.activate |
574 | assert user.deactivate | 574 | assert user.deactivate |
575 | assert_nil user.activated_at | 575 | assert_nil user.activated_at |
576 | - assert !user.person.visible | 576 | + refute user.person.visible |
577 | end | 577 | end |
578 | 578 | ||
579 | should 'return if the user is deactivated' do | 579 | should 'return if the user is deactivated' do |
@@ -581,7 +581,7 @@ class UserTest < ActiveSupport::TestCase | @@ -581,7 +581,7 @@ class UserTest < ActiveSupport::TestCase | ||
581 | user.activate | 581 | user.activate |
582 | assert user.activated? | 582 | assert user.activated? |
583 | user.deactivate | 583 | user.deactivate |
584 | - assert !user.activated? | 584 | + refute user.activated? |
585 | end | 585 | end |
586 | 586 | ||
587 | should 'activate right after creation when confirmation is not required' do | 587 | should 'activate right after creation when confirmation is not required' do |
@@ -595,7 +595,7 @@ class UserTest < ActiveSupport::TestCase | @@ -595,7 +595,7 @@ class UserTest < ActiveSupport::TestCase | ||
595 | should 'cancel activation if user has no person associated' do | 595 | should 'cancel activation if user has no person associated' do |
596 | user = new_user | 596 | user = new_user |
597 | user.stubs(:person).returns(nil) | 597 | user.stubs(:person).returns(nil) |
598 | - assert !user.activate | 598 | + refute user.activate |
599 | end | 599 | end |
600 | 600 | ||
601 | should 'be able to skip the password requirement' do | 601 | should 'be able to skip the password requirement' do |
test/unit/validation_info_test.rb
@@ -8,7 +8,7 @@ class ValidationInfoTest < ActiveSupport::TestCase | @@ -8,7 +8,7 @@ class ValidationInfoTest < ActiveSupport::TestCase | ||
8 | assert info.errors[:validation_methodology].any? | 8 | assert info.errors[:validation_methodology].any? |
9 | info.validation_methodology = 'lalala' | 9 | info.validation_methodology = 'lalala' |
10 | info.valid? | 10 | info.valid? |
11 | - assert !info.errors[:validation_methodology].any? | 11 | + refute info.errors[:validation_methodology].any? |
12 | end | 12 | end |
13 | 13 | ||
14 | should 'refer to and validate the presence of an organization' do | 14 | should 'refer to and validate the presence of an organization' do |