Commit c05eb345abd2af40c2fa6b18a61d62ff8d9547e7

Authored by Victor Costa
2 parents 3e028f74 57efc389

Merge branch 'rails3_AI3033-serpro_integration' into stable

plugins/serpro_integration/Gemfile
1   -gem 'gitlab', '~> 3.1.0'
  1 +gem 'gitlab', '~> 3.3.0'
2 2 gem 'jenkins_api_client', '~> 0.14.1'
... ...
plugins/serpro_integration/lib/serpro_integration_plugin/gitlab_integration.rb
... ... @@ -46,6 +46,7 @@ class SerproIntegrationPlugin::GitlabIntegration
46 46 @client.add_group_member(group.id, user.id, 40)
47 47 rescue Gitlab::Error::Conflict => e
48 48 #already member
  49 + Rails.logger.info e.to_s
49 50 end
50 51 user
51 52 end
... ...
plugins/serpro_integration/test/unit/sonar_plugin_test.rb
1 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 5 end
... ...