Commit e4fa547372c366dcfcdf1a1e532852a613561067
1 parent
6946395b
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
serpro_integration: remove wrong tests
Showing
1 changed file
with
1 additions
and
37 deletions
Show diff stats
plugins/serpro_integration/test/unit/sonar_plugin_test.rb
| 1 | require File.dirname(__FILE__) + '/../../../../test/test_helper' | 1 | require File.dirname(__FILE__) + '/../../../../test/test_helper' |
| 2 | 2 | ||
| 3 | -class RequireAuthToCommentPluginTest < ActiveSupport::TestCase | ||
| 4 | - | ||
| 5 | - def setup | ||
| 6 | - @plugin = RequireAuthToCommentPlugin.new | ||
| 7 | - @comment = Comment.new | ||
| 8 | - end | ||
| 9 | - | ||
| 10 | - attr_reader :plugin, :comment | ||
| 11 | - | ||
| 12 | - should 'reject comments for unauthenticated users' do | ||
| 13 | - plugin.context = logged_in(false) | ||
| 14 | - plugin.filter_comment(comment) | ||
| 15 | - assert comment.rejected? | ||
| 16 | - end | ||
| 17 | - | ||
| 18 | - should 'allow comments from authenticated users' do | ||
| 19 | - plugin.context = logged_in(true) | ||
| 20 | - plugin.filter_comment(comment) | ||
| 21 | - assert !comment.rejected? | ||
| 22 | - end | ||
| 23 | - | ||
| 24 | - should 'allow comments from unauthenticated users if allowed by profile' do | ||
| 25 | - plugin.context = logged_in(false) | ||
| 26 | - plugin.context.profile.allow_unauthenticated_comments = true | ||
| 27 | - | ||
| 28 | - plugin.filter_comment(comment) | ||
| 29 | - assert !comment.rejected? | ||
| 30 | - end | ||
| 31 | - | ||
| 32 | - protected | ||
| 33 | - | ||
| 34 | - def logged_in(boolean) | ||
| 35 | - controller = mock() | ||
| 36 | - controller.stubs(:logged_in?).returns(boolean) | ||
| 37 | - controller.stubs(:profile).returns(Profile.new) | ||
| 38 | - controller | ||
| 39 | - end | 3 | +class SonarPluginTest < ActiveSupport::TestCase |
| 40 | 4 | ||
| 41 | end | 5 | end |