Skip to content

Commit

Permalink
[ci] Fix flaky test
Browse files Browse the repository at this point in the history
This makes sure that the subject maintainer is logged in when calling
add_maintainer.
This wasn't the case before and could fail occasionally.
  • Loading branch information
bgeuken committed Oct 12, 2017
1 parent 8817c9c commit f2e75f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/spec/models/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@
end

describe '#add_maintainer' do
subject { project }
subject { create(:user).home_project }

it_behaves_like "makes a user a maintainer of the subject"
end
Expand Down
3 changes: 3 additions & 0 deletions src/api/spec/support/shared_examples/relationships.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
let(:maintainer_role) { Role.where(title: 'maintainer')}

before do
object = (subject.kind_of?(Project) ? subject : subject.project)
login(object.relationships.maintainers.first.user)

subject.add_maintainer(other_user)
end

Expand Down

0 comments on commit f2e75f8

Please sign in to comment.