diff options
author | Rémy Coutable <remy@rymai.me> | 2017-09-07 16:22:09 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-09-07 16:22:09 +0000 |
commit | 45510326d0ebec81539b855ec7789c8bb092eb67 (patch) | |
tree | 4c9ab8c938d2b03974470abdb1c0acfa06e3468d /spec | |
parent | 523a1c69ab6c51969f2613c4042d91318f841081 (diff) | |
parent | 091b1c5ed59b5c505d29c8905c78a867b12d5641 (diff) | |
download | gitlab-ce-45510326d0ebec81539b855ec7789c8bb092eb67.tar.gz |
Merge branch '31362_decrease_cyclomatic_complexity_threshold_step3' into 'master'
Decrease Cyclomatic Complexity threshold to 14
See merge request !13972
Diffstat (limited to 'spec')
-rw-r--r-- | spec/helpers/projects_helper_spec.rb | 29 | ||||
-rw-r--r-- | spec/services/ci/create_pipeline_service_spec.rb | 2 |
2 files changed, 26 insertions, 5 deletions
diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb index d1efa318d14..49cb7c954b4 100644 --- a/spec/helpers/projects_helper_spec.rb +++ b/spec/helpers/projects_helper_spec.rb @@ -191,10 +191,31 @@ describe ProjectsHelper do end end - describe 'link_to_member' do - let(:group) { create(:group) } - let(:project) { create(:project, group: group) } - let(:user) { create(:user) } + describe '#link_to_member_avatar' do + let(:user) { build_stubbed(:user) } + let(:expected) { double } + + before do + expect(helper).to receive(:avatar_icon).with(user, 16).and_return(expected) + end + + it 'returns image tag for member avatar' do + expect(helper).to receive(:image_tag).with(expected, { width: 16, class: ["avatar", "avatar-inline", "s16"], alt: "" }) + + helper.link_to_member_avatar(user) + end + + it 'returns image tag with avatar class' do + expect(helper).to receive(:image_tag).with(expected, { width: 16, class: ["avatar", "avatar-inline", "s16", "any-avatar-class"], alt: "" }) + + helper.link_to_member_avatar(user, avatar_class: "any-avatar-class") + end + end + + describe '#link_to_member' do + let(:group) { build_stubbed(:group) } + let(:project) { build_stubbed(:project, group: group) } + let(:user) { build_stubbed(:user) } describe 'using the default options' do it 'returns an HTML link to the user' do diff --git a/spec/services/ci/create_pipeline_service_spec.rb b/spec/services/ci/create_pipeline_service_spec.rb index 49d7c663128..009d67a3fbe 100644 --- a/spec/services/ci/create_pipeline_service_spec.rb +++ b/spec/services/ci/create_pipeline_service_spec.rb @@ -489,7 +489,7 @@ describe Ci::CreatePipelineService do subject do described_class.new(project, user, ref: ref) - .send(:allowed_to_create?, user) + .send(:allowed_to_create?) end context 'when user is a developer' do |