diff --git a/plugins/serpro_integration/test/unit/sonar_plugin_test.rb b/plugins/serpro_integration/test/unit/sonar_plugin_test.rb index 92b4e1d..ec46f86 100644 --- a/plugins/serpro_integration/test/unit/sonar_plugin_test.rb +++ b/plugins/serpro_integration/test/unit/sonar_plugin_test.rb @@ -1,41 +1,5 @@ require File.dirname(__FILE__) + '/../../../../test/test_helper' -class RequireAuthToCommentPluginTest < ActiveSupport::TestCase - - def setup - @plugin = RequireAuthToCommentPlugin.new - @comment = Comment.new - end - - attr_reader :plugin, :comment - - should 'reject comments for unauthenticated users' do - plugin.context = logged_in(false) - plugin.filter_comment(comment) - assert comment.rejected? - end - - should 'allow comments from authenticated users' do - plugin.context = logged_in(true) - plugin.filter_comment(comment) - assert !comment.rejected? - end - - should 'allow comments from unauthenticated users if allowed by profile' do - plugin.context = logged_in(false) - plugin.context.profile.allow_unauthenticated_comments = true - - plugin.filter_comment(comment) - assert !comment.rejected? - end - - protected - - def logged_in(boolean) - controller = mock() - controller.stubs(:logged_in?).returns(boolean) - controller.stubs(:profile).returns(Profile.new) - controller - end +class SonarPluginTest < ActiveSupport::TestCase end -- libgit2 0.21.2