Skip to content
Snippets Groups Projects

Add a test for User#ci_authorized_runners

What does this MR do?

Add a test for User#ci_authorized_runners

Are there points in the code the reviewer needs to double check?

Should we add Project#add_user so that it's similar to Group#add_user?

Why was this MR needed?

I am going to make some changes to this method for !4093 (merged), but I couldn't find a corresponding test so I want to add it in case I would break anything.

What are the relevant issue numbers?

This is a test for current behaviour, before implementing #3407 (closed)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Good idea. I'm confident that we are cross testing this with other Runner related tests.

  • @grzesiek Please review.

  • Reassigned to @grzesiek

  • Kamil Trzcińśki Added ~19173 label

    Added ~19173 label

  • Added 3 commits:

    • 6e3ff333 - This is easier to write:
    • 4a27c781 - Use subject for more consistent testing style:
    • e5f22ff9 - Use rspec's matchers and update style:
  • @ayufan Thanks for all the feedback! All updated :) But since I can't find where this was tested in other places, if this didn't take too much time, could you point me out?

  • Added 1 commit:

    • efe791bd - Fix method definition style
  • 796
    797 it 'does not load' do
    798 is_expected.to be_empty
    799 end
    800 end
    801
    802 context 'with personal projects runners' do
    803 let(:namespace) { create(:namespace, owner: user) }
    804 let(:project) { create(:project, namespace: namespace) }
    805
    806 it 'loads' do
    807 is_expected.to contain_exactly(runner)
    808 end
    809 end
    810
    811 shared_examples :member do
    • I prefer to use strings instead of symbols as argument to shared_examples just to be consistent with describe. Using symbols for describe and context may introduce problems.

    • I am ok with strings (i.e. I'll update it, any preferred words?) but I find it harder to find a sentence than a word for shared_examples. This is different than describe or context which I don't have to "refer" them in any sense. But for shared_examples, I'll need to refer it like a variable, and in Sublime, if you selected a word it would highlight all the same words, which makes it very easy to find where the shared_examples are used for it_behaves_like.

      So it would be great if the name could be kept exactly as a word. (well_this_is_a_word_too)

  • @godfat I :heart: love it. LGTM! Good work!

    Edited by Grzegorz Bizon
  • Added 1 commit:

    • 45b62b01 - Prefer string name over symbol name:
  • @grzesiek Thanks! Reassign to @DouweM

  • Reassigned to @DouweM

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading